Ubuntu中如何更换apt-get源
今天小编给大家分享一下Ubuntu中如何更换apt-get源的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。
使用apt-get安装时,会很慢,更换了国内的源后,就可以解决这个问题了。
1. 备份sources.list文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 打开sources.list文件
sudo gedit /etc/apt/sources.list
3. 删除原内容,添加下列内容
#清华源
deb bionic main restricted universe multiversedeb-src bionic main restricted universe multiversedeb bionic-updates main restricted universe multiversedeb-src bionic-updates main restricted universe multiversedeb bionic-backports main restricted universe multiversedeb-src bionic-backports main restricted universe multiversedeb bionic-security main restricted universe multiversedeb-src bionic-security main restricted universe multiversedeb bionic-proposed main restricted universe multiversedeb-src bionic-proposed main restricted universe multiverse
#阿里云源
deb bionic main restricted universe multiverse
deb bionic-security main restricted universe multiverse
deb bionic-updates main restricted universe multiverse
deb bionic-proposed main restricted universe multiverse
deb bionic-backports main restricted universe multiverse
deb-src bionic main restricted universe multiverse
deb-src bionic-security main restricted universe multiverse
deb-src bionic-updates main restricted universe multiverse
deb-src bionic-proposed main restricted universe multiverse
deb-src bionic-backports main restricted universe multiverse
这两个源都可以用,我都试过,感觉阿里云源速度更快。
4. 更新
保存sources.list文件后需要更新apt-get。
sudo apt-get update
更新完成后就可以正常使用了。
以上就是“Ubuntu中如何更换apt-get源”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注美国cn2行业资讯频道。