Centos7配置yum源詳解
第一步:安裝yum必備外掛(如果已安裝請自動忽略):
http://mirrors.163.com/centos/7/os/x86_64/Packages/
到上面這個網站去下載如下RPM包
python-iniparse-0.4-9.el7.noarch.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
yum-3.4.3-150.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
下載完成之後,用rpm命令進行安裝,如下:
rpm -ivh --force --nodeps python-iniparse-0.4-9.el7.noarch.rpm
rpm -ivh --force --nodeps yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
rpm -ivh --force --nodeps yum-3.4.3-150.el7.centos.noarch.rpm
rpm -ivh --force --nodeps yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm
第二步:下載最新的yum-3.4.3.tar.gz並解壓
wget?http://yum.baseurl.org/download/3.4/yum-3.4.3.tar.gz
tar xvf yum-3.4.3.tar.gz
執行安裝
touch/etc/ yum.conf
cd yum-3.2.28
yummain.py install?yum
更新系統,搞定收工
yum check-update
yum update
yum clean all
備註:如果在安裝過程中報以下錯誤:
[[email protected]?~]#?yum
error:?rpmdb:?BDB0113?Thread/process?18967/139716328294400?failed:?BDB1507?Thread?died?in?Berkeley?DB?library
error:?db5?error(-30973)?from?dbenv->failchk:?BDB0087?DB_RUNRECOVERY:?Fatal?error,?run?database?recovery
error:?cannot?open?Packages?index?using?db5?-?(-30973)
error:?cannot?open?Packages?database?in?/var/lib/rpm
CRITICAL:yum.main:
Error:?rpmdb?open?failed
原因:rpm資料庫損壞。
解決方法(重新構建rpm資料庫):
[[email protected] ~]# cd /var/lib/rpm [[email protected] rpm]# rm -rf __db.* [[email protected] rpm]# rpm --rebuilddb