Ubuntu 18.04更換apt-get源的方法
使用apt-get安裝時(shí),會(huì)很慢,更換了國(guó)內(nèi)的源后,就可以解決這個(gè)問題了。
1. 備份sources.list文件
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
2. 打開sources.list文件
sudo gedit /etc/apt/sources.list
3. 刪除原內(nèi)容,添加下列內(nèi)容
#清華源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.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
這兩個(gè)源都可以用,我都試過,感覺阿里云源速度更快。
4. 更新
保存sources.list文件后需要更新apt-get。
sudo apt-get update
更新完成后就可以正常使用了。
到此這篇關(guān)于Ubuntu 18.04更換apt-get源的文章就介紹到這了,更多相關(guān)Ubuntu 18.04更換apt-get源內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
ubuntu開啟SSH服務(wù)遠(yuǎn)程登錄操作的實(shí)現(xiàn)
這篇文章主要介紹了ubuntu開啟SSH服務(wù)遠(yuǎn)程登錄操作的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2020-08-08Ubuntu服務(wù)器下搭建php運(yùn)行環(huán)境的方法
這篇文章主要介紹了Ubuntu服務(wù)器下搭建php運(yùn)行環(huán)境的方法,簡(jiǎn)單分析了Ubuntu操作系統(tǒng)環(huán)境下搭建Apache、php及mysql模塊相關(guān)步驟、命令與操作技巧,需要的朋友可以參考下2018-04-04Linux?Tomcat的服務(wù)器查看接口請(qǐng)求方式的方法
本文講述了在安卓開發(fā)中遇到的接口405錯(cuò)誤,懷疑是由于客戶端用GET請(qǐng)求代替了POST,通過查看ApacheTomcat的localhost_access_log日志確認(rèn)請(qǐng)求方式并定位問題,可能是緩存導(dǎo)致,所以講解了Linux?Tomcat的服務(wù)器查看接口請(qǐng)求方式的方法,需要的朋友可以參考下2024-07-07Linux命令學(xué)習(xí)總結(jié)之rmdir命令
這篇文章主要介紹了Linux命令學(xué)習(xí)總結(jié)之rmdir命令的相關(guān)資料,需要的朋友可以參考下2016-01-01