共計 1597 個字符,預計需要花費 4 分鐘才能閱讀完成。
本篇內容介紹了“linux 源的配置如何更新”的有關知識,在實際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓丸趣 TV 小編帶領大家學習一下如何處理這些情況吧!希望大家仔細閱讀,能夠學有所成!
Ubuntu 首先編輯 sources.list 這個文件
vi /etc/apt/sources.list
把 sources.list 文件內容替換成如下
deb http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy main contrib non-free
deb http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian wheezy-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian-security wheezy/updates main contrib non-free
接下來執行以下命令,就完成阿里云 kali linux 鏡像源了
apt-get update
Centos
修改 CentOS 默認 yum 源為 mirrors.aliyun.com
1、首先備份系統自帶 yum 源配置文件 /etc/yum.repos.d/CentOS-Base.repo
[root@localhost ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2、下載 ailiyun 的 yum 源配置文件到 /etc/yum.repos.d/ CentOS7
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
CentOS6
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS5
[root@localhost ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
3、運行 yum makecache 生成緩存
[root@localhost ~]# yum makecache
4、這時候再更新系統就會看到以下 mirrors.aliyun.com 信息
[root@localhost ~]# yum -y update
已加載插件:fastestmirror, refresh-packagekit, security
設置更新進程 Loading mirror speeds from cached hostfile
base: mirrors.aliyun.com
extras: mirrors.aliyun.com
updates: mirrors.aliyun.com
“linux 源的配置如何更新”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業相關的知識可以關注丸趣 TV 網站,丸趣 TV 小編將為大家輸出更多高質量的實用文章!