修改 Ubuntu的源爲阿里源

安裝Ubuntu 18.04後,使用國外源太慢了,修改成國內源會快不少。linux

修改阿里源爲Ubuntu 18.04默認的源ubuntu

備份/etc/apt/sources.list
#備份
cp /etc/apt/sources.list /etc/apt/sources.list.bakionic

在/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 multiversespa

最後執行以下命令更新源
##更新
sudo apt-get update
sudo apt-get upgraderest

apt-get三個重要命令get

apt-get update 更新軟件源中的全部軟件列表。 
apt-get upgrade 更新軟件。 
apt-get dist-upgrade 更新系統版本。若是你對新版本軟件的需求不是那麼迫切,能夠不執行

相關文章
相關標籤/搜索