linux修改軟體源
阿新 • • 發佈:2019-02-18
Ubuntu
sudo cp /etc/apt/sources.list /etc/apt/sources.list_backup
sudo vim /etc/apt/sources.list
國內常用源列表
- 網易163更新伺服器(廣東廣州電信/聯通千兆雙線接入),包含其他開源映象:
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.163.com/ubuntu/ trusty-backports main restricted universe multiverse
- 阿里雲更新伺服器(北京萬網/浙江杭州阿里雲伺服器雙線接入),包含其他開源映象:
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main multiverse restricted universe deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main multiverse restricted universe
首先備份/etc/yum.repos.d/CentOS-Base.repo
下載對應版本repo檔案, 放入/etc/yum.repos.d/(操作前請做好相應備份),阿里雲修改檔名為 CentOS-Base-aliyun.repo
- http://mirrors.163.com/.help/CentOS5-Base-163.repo
- http://mirrors.163.com/.help/CentOS6-Base-163.repo
- http://mirrors.aliyun.com/repo/Centos-5.repo
- http://mirrors.aliyun.com/repo/Centos-6.repo
執行以下命令生成快取
yum clean all yum makecache
Fedora
1、備份
mv
/etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora.repo.backup
mv
/etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates.repo.backup
2、下載新的fedora.repo和fedora-updates.repo 到/etc/yum.repos.d/
fedora
wget
-O /etc/yum.repos.d/fedora.repo http://mirrors.aliyun.com/repo/fedora.repo
fedora updates
wget
-O /etc/yum.repos.d/fedora-updates.repo http://mirrors.aliyun.com/repo/fedora-updates.repo