1. 程式人生 > >Ubuntu18.04更換映象源

Ubuntu18.04更換映象源

換成國內最快的阿里雲源

第一步:備份原來的原始檔

#切換到apt配置檔案的目錄
cd /etc/apt/
#備份source.list
sudo cp sources.list sources.list.bak 

第二步:替換源

使用vi文字編輯器開啟source.list,需要加上sudo即使用管理員許可權開啟

sudo gedit source.list

將source.list內容清空,粘帖下面的阿里雲的映象地址,儲存並退出

deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##測試版源  
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
# 原始碼  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  

deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##測試版源  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
# Canonical 合作伙伴和附加  
deb http://archive.canonical.com/ubuntu/ xenial partner  
deb http://extras.ubuntu.com/ubuntu/ xenial main  

 

第三步:更新源和軟體

sudo apt-get update 更新源  
sudo apt-get upgrade 更新軟體