Ubuntu换国内源
原创
©著作权归作者所有:来自51CTO博客作者yitahutu79的原创作品,请联系作者获取转载授权,否则将追究法律责任
一、命令行方式
1.备份原有源
sudo cp /etc/apt/sources.list /etc/apt/sources.list.old
2.添加国内源
sudo gedit /etc/apt/sources.list
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-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
3.更新
sudo apt-get update #这个命令会访问源列表里的每个网址,并读取软件列表,将其保存在本地
sudo apt-get upgrade #这个命令会更新本地已安装的软件
二、图形界面
1.打开软件与更新
2.选择下载自其它站点
3.更新
sudo apt-get update
sudo apt-get upgrade