這篇文章主要介紹“如何給RHEL系統(tǒng)替換軟件更新源”,在日常操作中,相信很多人在如何給RHEL系統(tǒng)替換軟件更新源問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”如何給RHEL系統(tǒng)替換軟件更新源”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!
公司主營業(yè)務(wù):成都網(wǎng)站制作、成都網(wǎng)站設(shè)計、移動網(wǎng)站開發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競爭能力。創(chuàng)新互聯(lián)公司是一支青春激揚、勤奮敬業(yè)、活力青春激揚、勤奮敬業(yè)、活力澎湃、和諧高效的團隊。公司秉承以“開放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對我們的高要求,感謝他們從不同領(lǐng)域給我們帶來的挑戰(zhàn),讓我們激情的團隊有機會用頭腦與智慧不斷的給客戶帶來驚喜。創(chuàng)新互聯(lián)公司推出涿鹿免費做網(wǎng)站回饋大家。RHEL5.X 替換更新源
代碼如下:
cd /etc/yum.repos.d
wget http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo
mv CentOS-Base.repo rhel-debuginfo.repo
rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
RHEL6.1替換更新源
1.移除Yum
代碼如下:
rpm -aq|grep yum|xargs rpm -e --nodeps
2.下載Yum
代碼如下:
wget http://mirrors.163.com/centos/6.2/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
wget http://mirrors.163.com/centos/6.2/os/x86_64/Packages/yum-3.2.29-22.el6.centos.noarch.rpm
wget http://mirrors.163.com/centos/6.2/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
wget http://mirrors.163.com/centos/6.2/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
3.安裝Yum
代碼如下:
rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
rpm -ivh yum-3.2.29-22.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-10.el6.noarch.rpm
4.更新repo文件,使用網(wǎng)易文件
切換目錄到 /etc/yum.repos.d/目錄下
代碼如下:
cd /etc/yum.repos.d/
wget /tupian/20230522/CentOS6-Base-163.repo
vi CentOS6-Base-163.repo
編輯文件,把文件里面的$releasever全部替換為版本號,即6 最后保存!或者直接把下面的內(nèi)存拷貝到CentOS6-Base-163.repo文件中即可(已經(jīng)修改好)。
代碼如下:
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
代碼如下:
[base]
name=CentOS-6 - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
#mirrorlist=/tupian/20230522/release=6&arch=$basearch&repo=os
gpgcheck=1
gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-6
代碼如下:
#released updates
[updates]
name=CentOS-6 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
#mirrorlist=/tupian/20230522/release=6&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-6
代碼如下:
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
#mirrorlist=/tupian/20230522/release=6&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-6
代碼如下:
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
#mirrorlist=/tupian/20230522/release=6&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-6
代碼如下:
#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/
#mirrorlist=/tupian/20230522/release=6&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=/tupian/20230522/RPM-GPG-KEY-CentOS-6
5.最后一步
代碼如下:
yum clean all #清理yum緩存
yum makecache #將服務(wù)器上的軟件包信息緩存到本地,以提高搜索安裝軟件的速度。
yum list yum #測試配置的yum源是否已經(jīng)生效。
到此,關(guān)于“如何給RHEL系統(tǒng)替換軟件更新源”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>
當(dāng)前標(biāo)題:如何給RHEL系統(tǒng)替換軟件更新源-創(chuàng)新互聯(lián)
轉(zhuǎn)載源于:http://weahome.cn/article/dighsc.html