linux6.2 网络yum,配置RHEL6.2的YUM源
服務(wù)器端:
1、?? ?由于yum安裝支持三種協(xié)議:file://、ftp://和http://,因此如果是使用本地文件作為源,則可直接使用file:\\協(xié)議,否則需要先準(zhǔn)備好ftp或者h(yuǎn)ttp服務(wù)。這次測(cè)試的是ftp源,因此需要配置好ftp服務(wù),并且要把ftp服務(wù)配置為可匿名登錄,并且要把rpm包都放在ftp匿名登錄的root目錄下面。Vsftp匿名登錄的配置為:
anonymous_enable=YES
anon_root=/share(這個(gè)為vsftp匿名登錄的root目錄,并且其屬性不能為/etc/vsftp/ftpusers,/etc/vsftp/user_list文件中所配置的用戶,否則不能匿名登錄)
如果不配置匿名登錄或者匿名登錄root目錄設(shè)置不對(duì)會(huì)出現(xiàn)如下錯(cuò)誤:
[root@srcbdc yum.repos.d]# yum list
Loaded plugins: aliases, rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
ftp://yumserver/RHEL/Server/repodata/repomd.xml: [Errno 4] IOError: [Errno ftp error] 550 Failed to change directory.
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: RHEL-Server. Please verify its path and try again
2、?? ?先檢查yum是否已安裝,如果沒(méi)有安裝可以從光盤里面安裝
[root@srcbdc ~]# rpm -qa|grep yum
yum-security-1.1.16-13.el5
yum-rhn-plugin-0.5.4-13.el5
yum-metadata-parser-1.1.2-3.el5
yum-updatesd-0.9-2.el5
yum-aliases-1.1.16-13.el5
yum-3.2.22-20.el5
3、?? ?安裝另一個(gè)用于yum的包c(diǎn)reaterepo
[root@srcbdc Server]# rpm -ivh createrepo-0.4.11-3.el5.noarch.rpm
warning: createrepo-0.4.11-3.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...??????????????? ########################################### [100%]
1:createrepo???????????? ########################################### [100%]
這個(gè)工具主要是用來(lái)生產(chǎn)yum所需要用到的安裝包關(guān)系的數(shù)據(jù)庫(kù)。
4、?? ?把系統(tǒng)盤中的Server目錄和VT目錄拷貝到新的目錄里面,我的是從ISO文件里面復(fù)制出來(lái)的
先掛載ISO文件
[root@srcbdc ~]# mount -o loop /instsvr/ISO/rhel-server-6.2-x86_64-dvd.iso /mnt
Copy文件
[root@srcbdc ~]# mkdir -p /instsvr/RHEL6.2/x64
[root@srcbdc ~]# cp -r /mnt/ /instsvr/RHEL6.2/x64
5、?? ?創(chuàng)建rpm關(guān)系數(shù)據(jù)庫(kù)
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/Server/repodata/*comps-rhel6-Server.xml -o /instsvr/RHEL6.2/x64/Server -i /instsvr/RHEL6.2/x64/Server/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/HighAvailability/repodata/*comps-rhel6-HighAvailability.xml -o /instsvr/RHEL6.2/x64/HighAvailability -i /instsvr/RHEL6.2/x64/HighAvailability/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/LoadBalancer/repodata/*comps-rhel6-LoadBalancer.xml -o /instsvr/RHEL6.2/x64/LoadBalancer -i /instsvr/RHEL6.2/x64/LoadBalancer/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/ResilientStorage/repodata/*comps-rhel6-ResilientStorage.xml -o /instsvr/RHEL6.2/x64/ResilientStorage -i /instsvr/RHEL6.2/x64/ResilientStorage/listing /instsvr/RHEL6.2/x64/Packages/
[root@srcbdc ~]# createrepo -g /instsvr/RHEL6.2/x64/ScalableFileSystem/repodata/*comps-rhel6-ScalableFileSystem.xml -o /instsvr/RHEL6.2/x64/ScalableFileSystem -i /instsvr/RHEL6.2/x64/ScalableFileSystem/listing /instsvr/RHEL6.2/x64/Packages/
創(chuàng)建rpm包的link文件:
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/Server
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/HighAvailability
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/LoadBalancer
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/ResilientStorage
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
[root@srcbdc ~]# cd /instsvr/RHEL6.2/x64/ScalableFileSystem
[root@srcbdc ScalableFileSystem]# for i in `cat listing`; do ln -s ../Packages/$i $i; done
6、?? ?清除yum緩存信息
[root@srcbdc yum.repos.d]# yum clean all
Loaded plugins: aliases, rhnplugin, security
Cleaning up Everything
7、?? ?再使用yum list名稱查看rpm包,正常的話會(huì)列出所有的rpm包
客戶端:
客戶端就比較好配置了,只需要在/etc/yum.d.repo/目錄小添加本地yum源配置文件即可
[root@instsvr1 yum.repos.d]# cat rhel6.2-x64.repo
[RHEL6.2-Server-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-RedHat-release
[RHEL6.2-HighAvailability-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/HighAvailability/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL6.2-LoadBalancer-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/LoadBalancer/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL6.2-ResilientStorage-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/ResilientStorage/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL6.2-ScalableFileSystem-X64]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/RHEL6.2/x64/ScalableFileSystem/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[RHEL-RPMS]
name=Red Hat Enterprise Linux Install Server
baseurl=ftp://192.168.220.46/rpms
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
【網(wǎng)摘】:
repodata 數(shù)據(jù)庫(kù)介紹
repodata 數(shù)據(jù)庫(kù)中的文件主要是 XML 格式,精確描述一個(gè) rpm 包的詳細(xì)信息,如依賴關(guān)系,包含文件,校驗(yàn)碼信息。目前,這個(gè)格式被 apt-rpm,smartpm,red carpet 和 yum 支持。
通常有以下幾個(gè)文件:
repomd.xml (md 意思是 metadata)
repomd.xml 是描述其他 metadata 文件的文件。相當(dāng)于其他文件的索引。包含其他文件的時(shí)間戳和校驗(yàn)值(checksums)。這樣客戶端只要下載這一個(gè)文件(通常很小,幾KB),就可以知道其他文件中哪些有“更新”。這也意味只,只要對(duì)這一個(gè)文件簽名,就可以達(dá)到對(duì)其他文件簽名的作用。
primary.xml.[gz]
這個(gè)文件存儲(chǔ)主要的 metadata 信息,這些信息包括:
repomd.xml this is the file that describes the other metadata files. It is like an index file to point to the other files. It contains timestamps and checksums for the other files. This lets a client download this one, small file and know if anything else has changed. This also means that cryptographically (ex: gpg) signing this one file can ensure repository integrity.
primary.xml.[gz] this file stores the primary metadata information. This includes information such as:
name, epoch, version, release, architecture
file size, file location, description, summary, format, checksums header byte-ranges, etc.
dependencies, provides, conflicts, obsoletes, suggests, recommends
file lists for the package for CERTAIN files - specifically files matching: /etc*, *bin/*, /usr/lib/sendmail [1]
filelists.xml.[gz] this file stores the complete file and directory listings for the packages. The package is identified by: name, epoch, version, release, architecture and package checksum id.
other.xml.[gz] this file currently only stores the changelog data from packages. However, this file could be used for any other additional metadata that could be useful for clients.
groups.xml.[gz] this file is tentatively described. The intention is for a common package-groups specification as well. There is still some sections for this format that need to be fleshed out.
總結(jié)
以上是生活随笔為你收集整理的linux6.2 网络yum,配置RHEL6.2的YUM源的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 唯美女网名161个
- 下一篇: linux远程安装文件,通过image文