CentOS 和 Ubuntu 更新源

yum,是Yellow dog Updater, Modified 的簡稱,是杜克大學爲了提高RPM 軟件包安裝性而開發的一種軟件包管理器。起初是由yellow dog 這一發行版的開發者Terra Soft 研發,用Python 寫成,那時還叫做yup(yellow dog updater),後經杜克大學的Linux@Duke 開發團隊進行改進,遂有此名。yum 的宗旨是自動化地升級,安裝/移除rpm 包,收集rpm 包的相關信息,檢查依賴性並自動提示用戶解決。yum 的關鍵之處是要有可靠的repository,顧名思義,這是軟件的倉庫,它可以是http 或ftp 站點,也可以是本地軟件池,但必須包含rpm 的header,header 包括了rpm 包的各種信息,包括描述,功能,提供的文件,依賴性等。正是收集了這些header 並加以分析,才能自動化地完成餘下的任務。

  yum 的理念是使用一箇中心倉庫(repository)管理一部分甚至一個distribution 的應用程序相互關係,根據計算出來的軟件依賴關係進行相關的升級、安裝、刪除等等操作,減少了Linux 用戶一直頭痛的dependencies 的問題。這一點上,yum 和apt 相同。apt 原爲debian 的deb 類型軟件管理所使用,但是現在也能用到RedHat 門下的rpm 了。

  yum 主要功能是更方便的添加/刪除/更新RPM 包,自動解決包的倚賴性問題,便於管理大量系統的更新問題。

  yum 可以同時配置多個資源庫(Repository),簡潔的配置文件(/etc/yum.conf),自動解決增加或刪除rpm 包時遇到的依賴性問題,保持與RPM 數據庫的一致性。

安裝完CentOS後,爲避免從國外站點安裝更新速度過慢,需要更改yum更新源,所以從網上找了下更改linux yum源的方法,
和大家進行下分享。原理很簡單,就是把yum配置文件中的更新源改一下,這裏直接用163的鏡像站點中的配置文件。

CentOS更換163源

1.進入yum配置文件目錄

cd /etc/yum.repos.d/

2.備份配置文件

mv CentOS-Base.repo CentOS-Base.repo.bak

3.下載163的配置

wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

下載下來的文件名爲 CentOS6-Base-163.repo

4.改名

mv CentOS6-Base-163.repo CentOS-Base.repo

5.更新數據庫

yum update

CentOS更換ali源

1.備份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.下載ali源

CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

3.更新

yum clean all
yum makecache

Ubuntu更換源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo gedit /etc/apt/sources.list
sudo apt-get update

sources.list

deb http://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.ustc.edu.cn/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://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.sohu.com/ubuntu/ trusty-backports main restricted universe multiverse



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章