linux下配置yum源方法詳解
本人使用的方法一,成功配置,方法二沒測過,可以作為參考
方法一:
1.確保RHEL5中已經(jīng)安裝了yum
[root@lvs-master ~]# rpm -qa |grep yum yum-metadata-parser-2-el5 yum-updatesd-9-el5 yum-22-el5 yum-security-16-el5 yum-rhn-plugin-4-el5
2.修改源配置文件 #vim /etc/yum.repos.d/CentOS-Base.repo
(如果目錄下沒有.repo文件自己創(chuàng)建一個)
[base] name=CentOS-5-Base #mirrorlist=http://mirrorlistcentosorg/?release=$releasever5&arch=$basearch&repo=os #baseurl=http://mirrorcentosorg/centos/$releasever/os/$basearch/ baseurl=http://ftpsjtueducn/centos/5/os/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-centos5 #released updates [update] name=CentOS-5-Updates #mirrorlist=http://mirrorlistcentosorg/?release=4&arch=$basearch&repo=updates baseurl=http://ftpsjtueducn/centos/5/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-centos5 #packages used/produced in the build but not released [addons] name=CentOS-5-Addons #mirrorlist=http://mirrorlistcentosorg/?release=4&arch=$basearch&repo=addons baseurl=http://ftpsjtueducn/centos/5/addons/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-centos5 #additional packages that may be useful [extras] name=CentOS-5-Extras #mirrorlist=http://mirrorlistcentosorg/?release=4&arch=$basearch&repo=extras baseurl=http://ftpsjtueducn/centos/5/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-centos5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-5-Plus #mirrorlist=http://mirrorlistcentosorg/?release=4&arch=$basearch&repo=centosplus baseurl=http://ftpsjtueducn/centos/5/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-centos5 #contrib - packages by Centos Users [contrib] name=CentOS-5-Contrib #mirrorlist=http://mirrorlistcentosorg/?release=4&arch=$basearch&repo=contrib baseurl=http://ftpsjtueducn/centos/5/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-centos5 # vi dagrepo [dag] name=Dag RPM Repository for RHEL5 baseurl=http://ftprikenjp/Linux/dag/redhat/el5/en/$basearch/dag/ enabled=1 gpgcheck=1 gpgkey=http://ftprikenjp/Linux/dag/packages/RPM-GPG-KEYdagtxt
3. 導(dǎo)入key
#rpm --import http://ftp.sjtu.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
4. 運(yùn)行,測試
#yum update
5.clean操作
#yum clean all
方法二:
# cd /etc/yum.repos.d/ #mv CentOS-Baserepo CentOS-Baserepobak #wget http://docslinuxtoneorg/soft/lemp/CentOS-Baserepo 該文件內(nèi)容如下: [base] name=CentOS-5 - Base baseurl=http://centosustceducn/centos/5/os/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5 #released updates [update] name=CentOS-5 - Updates baseurl=http://centosustceducn/centos/5/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5 #packages used/produced in the build but not released [addons] name=CentOS-5 - Addons baseurl=http://centosustceducn/centos/5/addons/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5 #additional packages that may be useful [extras] name=CentOS-5 - Extras baseurl=http://centosustceducn/centos/5/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5 #additional packages that extend functionality of existing packages [centosplus] name=CentOS-5 - Plus baseurl=http://centosustceducn/centos/5/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5 #contrib - packages by Centos Users [contrib] name=CentOS-5 - Contrib baseurl=http://centosustceducn/centos/5/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5 #packages in testing [testing] name=CentOS-5 - Testing baseurl=http://centosustceducn/centos/5/testing/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrorcentosorg/centos/RPM-GPG-KEY-CentOS-5
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
在Apache服務(wù)器上啟用GZip壓縮靜態(tài)內(nèi)容的方法
這篇文章主要介紹了在Apache服務(wù)器上啟用GZip壓縮靜態(tài)內(nèi)容的方法,通過配置.htaccess文件即可輕松實(shí)現(xiàn),同時附帶了一些GZip的常用命令,需要的朋友可以參考下2015-08-08Linux上通過SSH掛載遠(yuǎn)程文件系統(tǒng)方法詳解
在本篇內(nèi)容里小編給大家整理了關(guān)于在Linux上通過SSH掛載遠(yuǎn)程文件系統(tǒng)的相關(guān)知識點(diǎn),需要的朋友們跟著學(xué)習(xí)下。2019-03-03詳解CentOS 7 網(wǎng)卡命名修改為eth0格式
這篇文章主要介紹了詳解CentOS 7 網(wǎng)卡命名修改為eth0格式,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧2017-03-03CentOS8.0 網(wǎng)絡(luò)配置的實(shí)現(xiàn)
這篇文章主要介紹了CentOS8.0 網(wǎng)絡(luò)配置的實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2019-10-10