Ubuntu更换更新源-手记

2021/7/16 7:11:25

本文主要是介绍Ubuntu更换更新源-手记,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

查看版本:

因为Ubuntu每个版本更新源不同 首先查看版本
#lsb_release -a
记录Codename,如hirsute

替换源的:

执行sudo gedit ‘/etc/apt/sources.list’
进入编辑器,将下面模板中的codename替换成自己版本的,然后复制进去并保存

# 阿里云源
deb http://mirrors.aliyun.com/ubuntu/ codename main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ codename-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ codename-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ codename-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ codename-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.aliyun.com/ubuntu/ codename main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ codename-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ codename-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ codename-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.aliyun.com/ubuntu/ codename-proposed main restricted universe multiverse
# 清华大学源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-security main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-backports main restricted universe multiverse
##测试版源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-proposed main restricted universe multiverse
# 源码
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-security main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-updates main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-backports main restricted universe multiverse
##测试版源
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ codename-proposed main restricted universe multiverse

更新:

保存后再次更新即可
sudo apt-get update
sudo apt-get upgrade



这篇关于Ubuntu更换更新源-手记的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程