搭建本地YUM源

1.把 /mnt/cdrom 下全部内容拷贝到指定目录中!


2.安装索引创建程序:
rpm  -ivh  /mnt/cdrom/Server/createrepo-*.noarch.rpm   (*代表版本差异)


3.创建索引:
createrepo -v  -g  /mnt/cdrom/Server/repodata/comps-rhel5-Server-core.xml   /var/ftp/pub/Server

createrepo -v  -g  /mnt/cdrom/VT/repodata/comps-rhel5-Server-core.xml   /var/ftp/pub/VT

createrepo -v  -g  /mnt/cdrom/Cluster/repodata/comps-rhel5-Server-core.xml   /var/ftp/pub/Cluster

createrepo -v  -g  /mnt/cdrom/ClusterStorage/repodata/comps-rhel5-Server-core.xml       /var/ftp/pub/ClusterStorage                       


4.编辑Yum配置文件
#vim /etc//yum.repos.d/rhel-debuginfo.repo
添加如下
[Cluster]
name=Cluster
baseurl=file:///var/ftp/pub/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[ClusterStorage]
name=ClusterStorage
baseurl=file:///var/ftp/pub/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[Server]
name=Server
baseurl=file:///var/ftp/pub/Server
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[VT]
name=VT
baseurl=file:///var/ftp/pub/VT
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


5.删除olddata文件
rm  -rf  /var/ftp/pub/Server/.olddata/
rm  -rf  /var/ftp/pub/VT/.olddata/
rm  -rf  /var/ftp/pub/Cluster/.olddata/
rm  -rf  /var/ftp/pub/ClusterStorage/.olddata/

完成


6.开始检测
#yum clean all
........................................................
Loaded plugins: rhnplugin, security
Cleaning up Everything

#yum list

#yum update
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Skipping security plugin, no data

Setting up Update Process
No Packages marked for Update

So that's all!
Good  luck!

本文出自 “Linux” 博客,谢绝转载!

你可能感兴趣的:(职场,yum,休闲)