Ubuntu 18.04 更新源

【原因】

  使用国外的源,在更新软件的时候会很慢,换成国内的源会快很多。

【命令】

1、备份源文件

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak  

2、添加源到sources.list中

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

 

posted @ 2019-03-28 14:09  _Mickey  阅读(5937)  评论(0编辑  收藏  举报