centos系統更換國內源
docker ubuntu18.04 apt-get更換國內源:
# 阿里源
deb bionic main restricted universe multiverse
deb bionic-security main restricted universe multiverse
deb bionic-updates main restricted universe multiverse
deb bionic-proposed main restricted universe multiverse
deb bionic-backports main restricted universe multiverse
deb-src bionic main restricted universe multiverse
deb-src bionic-security main restricted universe multiverse
deb-src bionic-updates main restricted universe multiverse
deb-src bionic-proposed main restricted universe multiverse
deb-src bionic-backports main restricted universe multiverse
2、更新列表
sudo apt-get update
對於dockerfile檔案,新增以下run命令,修改並新增阿里雲源到/etc/apt/sources.list檔案:
run echo "">/etc/apt/sources.list \
&& echo "deb bionic main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb bionic-security main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb bionic-updates main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb bionic-proposed main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb bionic-backports main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb-src bionic main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb-src bionic-security main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb-src bionic-updates main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb-src bionic-proposed main restricted universe multiverse">>/etc/apt/sources.list \
&& echo "deb-src bionic-backports main restricted universe multiverse">>/etc/apt/sources.list \
&& apt-get clean && apt-get update \
也可以使用 sed 命令修改 /etc/apt/sources.list 檔案:
但是這種方法並沒有修改source.list 檔案中包含 security.ubuntu.com 字樣的源。所以不推薦。
總之,可以使用echo命令、sed命令 修改 /etc/apt/source.list檔案 , 不一定要使用vi、vim、gedit等命令來編輯檔案。
參考:
什麼是軟體源?
源,在ubuntu下,它相當於軟體庫,需要什麼軟體,只要記得正確的軟體名就可以用命令安裝:
sudo apt-get install
軟體名
ubuntu 中安裝軟體的方式:
它主要可以分為下面三種安裝方式:
參考:詳解ubuntu軟體源
更換源:
ubuntu更換軟體源
Linux系統pip更換國內源
如果想將國內pip源配置成預設的源,方法如下 需要建立或修改配置檔案 一般都是建立 系統使用的是ubuntu系統所以要在root使用者和ubuntu使用者下都要建立一遍一下操作 root使用者 mkdir pip vim pip pip.conf ubuntu使用者 mkdir pip vim pi...
conda更換國內源 網速問題?更換國內源吧!
當時我還是個孩子,懷著對python對無限敬仰敲下了conda upgrade的回車,3kb公升級速度讓我一度懷疑人生,網速問題!經過一番搜尋研究,的確是網速的問題,國內訪問不到部分pip源的位址。既然這樣那就換上中國特色pip源吧,嘻嘻 conda upgrade開啟terminal home p...
Ubuntu 更換國內源
sudo cp etc apt sources.list etc apt sources.list.bak 備份 sudo vim etc apt sources.list 修改 sudo apt get update 更新列表 阿里雲源 deb trusty main restricted uni...