Ubuntu20.04 如何更新国内源
Posted 玩电脑的辣条哥
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu20.04 如何更新国内源相关的知识,希望对你有一定的参考价值。
环境:
电脑:联想E14
系统:Windows 10 专业版 64位
VMware 16.0 :Ubuntu20.04
问题描述:
如何更新国内源,原因是安装ssh没成功
解决方案:
1.备份原来的源
sudo cp /etc/apt/sources.list /etc/apt/sources_init.list
将以前的源备份一下
2.更换源(在桌面里操作)
sudo gedit /etc/apt/sources.list
使用gedit打开文档,将下边的阿里源复制进去,然后点击保存关闭。
阿里源
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
清华源
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security multiverse
3.更新
更新源
sudo apt-get update
复损坏的软件包,尝试卸载出错的包,重新安装正确版本的。
sudo apt-get -f install
更新软件
sudo apt-get upgrade
以上是关于Ubuntu20.04 如何更新国内源的主要内容,如果未能解决你的问题,请参考以下文章
ubuntu20.04 LTS 更换国内163源阿里源清华源中科大源
ubuntu20.04 LTS 更换国内163源、阿里源、清华源、中科大源
Ubuntu20.04 LTS国内源安装指定版本Docker/docker-compose