Centos,、Ubuntu,、Debian,、Fedora,、OpenSUSE、FreeBSD系統(tǒng)換軟件源 Linux系統(tǒng)安裝完后軟件源一般都是國外服務(wù)器,,在國內(nèi)特別慢,,這時候就需要更換國內(nèi)的鏡像源。 高性價比和便宜的VPS/云服務(wù)器推薦:https://blog./archives/383.html Centos1,、備份mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2、更換源下載新的 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 或者 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 注意 3、運行yum makecache生成緩存yum makecache Ubuntu1.備份sudo cp /etc/apt/sources.list /etc/apt/sources_init.list 將以前的源備份一下,,以防以后可以用的,。 2.更改文件權(quán)限使其可編輯sudo chmod 777 /etc/apt/source.list 3.更換源sudo nano /etc/apt/sources.list 使用nano打開文本,刪除原來文件里的內(nèi)容,,將下面其中一個源復(fù)制進(jìn)去,,然后保存。 阿里源: 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-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ xenial-backports 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-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 清華源: deb https://mirrors.tuna./ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.tuna./ubuntu/ bionic main restricted universe multiverse deb https://mirrors.tuna./ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.tuna./ubuntu/ bionic-updates main restricted universe multiverse deb https://mirrors.tuna./ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.tuna./ubuntu/ bionic-backports main restricted universe multiverse deb https://mirrors.tuna./ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.tuna./ubuntu/ bionic-security main restricted universe multiverse deb https://mirrors.tuna./ubuntu/ bionic-proposed main restricted universe multiverse deb-src https://mirrors.tuna./ubuntu/ bionic-proposed main restricted universe multiverse 3.更新更新源 sudo apt-get update 修復(fù)損壞的軟件包,,嘗試卸載出錯的包,,重新安裝正確版本的。 sudo apt-get -f install 更新軟件 sudo apt-get upgrade Debian1.備份sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak 2.更換源一般情況下,,將 sudo sed -i 's/deb./mirrors.ustc.edu.cn/g' /etc/apt/sources.list 也可以直接編輯 sudo vi /etc/apt/sources.list 加入如下內(nèi)容即可 deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free # deb-src http://mirrors.ustc.edu.cn/debian stable main contrib non-free deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free # deb-src http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free # deb http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free # deb-src http://mirrors.ustc.edu.cn/debian stable-proposed-updates main contrib non-free 敲擊 其他鏡像源: 阿里云:http://mirrors.aliyun.com/ 搜狐:http://mirrors.sohu.com/ 網(wǎng)易:http://mirrors.163.com/ 3.更新sudo apt-get update Fedorasu cd /etc/yum.repos.d/mv fedora.repo fedora.repo.backup mv fedora-updates.repo fedora-updates.repo.backup wget -O /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo wget -O /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo dnf clean all dnf makecache OpenSUSE1.禁用原有軟件源sudo zypper mr -da 2.添加科大鏡像源sudo zypper ar -fc https://mirrors.ustc.edu.cn/opensuse/distribution/leap/42.1/repo/oss USTC:42.1:OSSsudo zypper ar -fc https://mirrors.ustc.edu.cn/opensuse/distribution/leap/42.1/repo/non-oss USTC:42.1:NON-OSSsudo zypper ar -fc https://mirrors.ustc.edu.cn/opensuse/update/leap/42.1/oss USTC:42.1:UPDATE-OSSsudo zypper ar -fc https://mirrors.ustc.edu.cn/opensuse/update/leap/42.1/non-oss USTC:42.1:UPDATE-NON-OSS 3.手動刷新軟件源sudo zypper ref 4.更新系統(tǒng)sudo zypper up FreeBSD1.修改 pkg 源mkdir -p /usr/local/etc/pkg/repos vim /usr/local/etc/pkg/repos/FreeBSD.conf # content of FreeBSD.conf FreeBSD: { url: "pkg+http://mirrors.ustc.edu.cn/freebsd-pkg/${ABI}/quarterly",} 2.修改 ports 源vim /etc/make.conf # content of make.confFETCH_CMD=axel -n 10 -aDISABLE_SIZE=yesMASTER_SITE_OVERRIDE?=http://mirrors.ustc.edu.cn/freebsd-ports/distfiles/${DIST_SUBDIR}/ 3.修改 portsnap 源vim /etc/portsnap.conf # content of porsnap.confSERVERNAME=porsnap.tw.freebsd.org 本文分享自微信公眾號 - Zeruns(zeruns-gzh),,作者:zeruns 原文出處及轉(zhuǎn)載信息見文內(nèi)詳細(xì)說明,,如有侵權(quán),請聯(lián)系 [email protected] 刪除,。 原始發(fā)表時間:2020-03-30 本文參與騰訊云自媒體分享計劃,,歡迎正在閱讀的你也加入,一起分享,。 點贊 3 |
|
來自: 昵稱QAb6ICvc > 《電腦知識》