天天看點

Ubuntu18 替換阿裡雲軟體源

Ubuntu 安裝後,軟體源預設為國外源,下載下傳速度很慢,替換國内阿裡巴巴軟體源

一、備份原來的源檔案

1、首先,進入源檔案 sources.list 所在的目錄:

cd /etc/apt/
           

2、對源檔案進行備份,以防萬一

sudo cp sources.list sources.list.bak
           

二、修改源檔案内容

1、 Gedit 編輯源檔案

sudo gedit sources.list
           

2、複制如下内容到源檔案

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
           

三、更新源和軟體

1、更新擷取 阿裡雲軟體源 提供的軟體清單

sudo apt-get update
           

2、更新軟體

sudo apt-get upgrade