編碼的世界 / 優質文選 / 女人

ubuntu19.10更改國內鏡像源(附其他版本ubuntu換源教程,史上最全!)


2022年8月02日
-   

ubuntu又雙叕更新啦!安裝好ubuntu雙系統或者ubuntu虛擬機之後,默認的軟件更新源是國外的,在國內使用速度很慢,用"apt install"安裝軟件時各種網絡問題層出不窮,因此我們需要更換成國內的源,這樣才能正常安裝和更新軟件。
首先將我們的原來的軟件源另存起來備份:
sudo cp -v /etc/apt/sources.list /etc/apt/sources.list.backup

終端執行chmod命令更改文件權限使軟件源文件可編輯:
sudo chmod 777 /etc/apt/sources.list

之後通過gedit命令編輯軟件源:
sudo gedit /etc/apt/sources.list

然後將下面任意一個源複制進去保存就好了:
阿裏雲源:
deb http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ eoan-backports main restricted universe multiverse

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

修改完軟件源後,更新軟件列表和軟件:
sudo apt update
sudo apt upgrade

注意:“eoan”為ubuntu版本名!“eoan”代表ubuntu19.10,“xenial”代表ubuntu16.04,“bionic”代表ubuntu18.04,“disco”代表ubuntu19.04,如果自己的版本不再所描述的上面,可以通過查看,並更改相應位置就ok了!
lsb_release -c

 

熱門文章