最快配置本地Yum倉庫


配置本地Yum倉庫

[root@localhost test]# ls
aa.txt  bb.txt  rhel-6.4-x86_64.iso  test.sh
[root@localhost test]# mount -o loop rhel-6.4-x86_64.iso /media/  //系統介質掛載到/media/

[root@localhost yum.repos.d]# cd /etc/yum.repos.d/ | ls
rhel-source.repo
[root@localhost yum.repos.d]# cp rhel-source.repo rhel-source.repo.bak
[root@localhost yum.repos.d]# vim rhel-source.repo
[root@localhost yum.repos.d]# cat rhel-source.repo
[rhel-source]      //[rhel-source]與下面的[rhel-source-beta]改一個就好,這是兩個源
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=file:///media/
enabled=1           //是否啓用,1爲啓用,0爲不啓用
gpgcheck=1          //是否校驗
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
//配置文件完成,yum配置結束,下面查看repolist,下面的3648表示有這麼多rpm包可以直接安裝
[root@localhost yum.repos.d] yum repolist
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                                            repo name                                                                                 status
rhel-source                                        Red Hat Enterprise Linux 6Server - x86_64 - Source                                        3,648
repolist: 3,648
[root@localhost yum.repos.d]# 


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