Debian系统更换国内源

香蕉你个不呐呐
2024-01-17 / 0 评论 / 13 阅读 / 正在检测是否收录...

在Debian系统中更换为国内源,您可以按照以下步骤进行操作:

#备份源列表文件:首先,打开终端并以管理员身份运行以下命令,备份当前的源列表文件:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
#编辑源列表文件:使用文本编辑器(如nano或vim)打开源列表文件:
sudo nano /etc/apt/sources.list

替换为国内源:将文件中的内容替换为适合您所在地区的国内源。以下是一些常用的国内源示例:
阿里云源:

deb http://mirrors.aliyun.com/debian/ buster main contrib non-free
deb-src http://mirrors.aliyun.com/debian/ buster main contrib non-free
 
deb http://mirrors.aliyun.com/debian-security/ buster/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security/ buster/updates main contrib non-free
 
deb http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian/ buster-updates main contrib non-free
 
deb http://mirrors.aliyun.com/debian/ buster-backports main contrib non-free
deb-src http://mirrors.aliyun.com/debian/ buster-backports main contrib non-free

清华大学源:

deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster/updates main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
 
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free

保存并关闭文件。然后,运行以下命令更新软件包缓存:
sudo apt update
sudo apt-get upgrade

0

评论

博主关闭了所有页面的评论