Ubuntu 18.04更换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/sourcesfxRyLam.list
3. 删除原内容,添加下列内容
#清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb-class="lazy" data-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb-class="lazy" data-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb-class="lazy" data-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb-class="lazy" data-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiversedeb-class="lazy" data-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
#阿里云源
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-class="lazy" data-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-class="lazy" data-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-class="lazy" data-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-class="lazy" data-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-class="lazy" data-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
这两个源都可以用,我都试过,感觉阿里云源速度更快。
4. 更新
保存sources.list文件后需要更新apt-get。
sudo apt-get update
更新完成后就可以正常使用了。
到此这篇关于Ubuntu 18.04更换apt-get源的文章就介绍到这了,更多相关Ubuntu 18.04更换apt-get源内容请搜索我们以前的文章或继续浏览下面的相关文章希望大家以后多多支持我们!
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341