通用方法
- 換國內(nèi)源斗忌,最直接的就是上阿里、中科大的鏡像官網(wǎng)兔院。
-
根據(jù)選擇自己的Linux發(fā)行版姿鸿,點幫助help就有詳細了谆吴,復制到sources.list,更新下源就好了苛预。
Ubuntu換國內(nèi)源
Xubunut句狼、Kubuntu都是ubuntu發(fā)行版,只是桌面環(huán)境不同热某,換源也是一樣鲜锚。
-
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
備份原來的sorce文件 -
sudo gedit /etc/apt/sources.list
修改sources.list文件
gedit是ubuntu自帶的圖像界面編輯器突诬,xubuntu苫拍、kubuntu自帶的不是gedit芜繁,Kubuntu自帶kate。你也可以用vi/vim去編輯绒极。
sudo vim /etc/apt/sources.list
- 添加阿里骏令、中科大鏡像源
# 中科大鏡像源
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# 阿里鏡像源
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
將上面的鏡像源覆蓋到sources.list里,保存垄提。
-
sudo apt-get update
更新源
Deepin換國內(nèi)源
-
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
備份原來的sorce文件 -
sudo deepin-editor /etc/apt/sources.list
修改sources.list文件
deepin-editor是deepin自帶的圖像界面編輯器榔袋,和ubuntu的gedit一樣。你也可以用vim去編輯铡俐』硕遥看自己嘛。
- 更換為阿里或者中科大的鏡像源
- 阿里
# aliyun
deb [by-hash=force] http://mirrors.aliyun.com/deepin panda main contrib non-free
#deb-src http://mirrors.aliyun.com/deepin panda main contrib non-free
- 中科大
# ustc
deb [by-hash=force] http://mirrors.ustc.edu.cn/deepin panda main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/deepin panda main contrib non-free
將上面的一個鏡像源 覆蓋 到sources.list里审丘,保存吏够。
-
sudo apt-get update
更新源
4.1 如果出現(xiàn)lock報錯,刪除lock文件就好了
4.2 sudo rm -f /var/lib/apt/lists/lock
刪除lock文件
4.3 再用 sudo apt-get update
更新源