Ubantu系统更换国内源

Ubantu系统更换国内源

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 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

清华源:

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

浙大源:

deb http://mirrors.zju.edu.cn/ubuntu xenial main universe restricted multiverse
deb http://mirrors.zju.edu.cn/ubuntu xenial-security main universe restricted multiverse
deb http://mirrors.zju.edu.cn/ubuntu xenial-updates main universe restricted multiverse
deb http://mirrors.zju.edu.cn/ubuntu xenial-backports main universe restricted multiverse
deb-src http://mirrors.zju.edu.cn/ubuntu xenial main universe restricted multiverse
deb-src http://mirrors.zju.edu.cn/ubuntu xenial-security main universe restricted multiverse
deb-src http://mirrors.zju.edu.cn/ubuntu xenial-updates main universe restricted multiverse
deb-src http://mirrors.zju.edu.cn/ubuntu xenial-backports main universe restricted multiverse

4、然后执行以下命令切换为root账户

sudo -i
在这里插入图片描述

5、执行更新命令

apt update

在这里插入图片描述

apt upgrade

在这里插入图片描述
最后分享一个浙大的开源镜像站
浙江大学开源镜像站:http://mirrors.zju.edu.cn/

猜你喜欢

转载自blog.csdn.net/weixin_44412272/article/details/106445934
今日推荐