一.网络yum的创建
0.挂载光盘
1.cd /mnt/cdrom/Server
2.rpm -ivh vsftpd-2.0.5-
3.service vsftpd start
4.cd /var/ftp
5.mkdir rhel
6.cd rhel/
7.cp -a -r /mnt/cdrom/* ./
10.cd /mnt/cdrom/Server/
11.rpm -ivh createrepo-0.4.11...rpm
12.cd /var/ftp/rhel/
13.cd Server/(如果仓库变化)
14.createrepo -g repodata/comps-rhe15-server-core.xml ./
15.cd ../VT
16.createrepo -g repodata/comps-rhe15-vt.xml ./
17.cd ../Cluster
18.createrepo -g repodata/comps-rhe15-cluster.xml ./
19.cd ../ClusterStorage/
20.createrepo -g repodata/comps-rhe15-cluster-st.xml ./
21.cd /etc/yum.repos.d/
22.cp rhel-debuginfo.repo server1.repo
23.vim server1.repo
[rhel-server]
name=Red Hat Enterprise Linux server
baseurl=ftp://192.168.101.1/rhel/Server
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.101.1/rhel/RPM-GPG-KEY-redhat-release
[rhel-vt]
name=Red Hat Enterprise Linux vt
baseurl=ftp://192.168.101.1/rhel/VT
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.101.1/rhel/RPM-GPG-KEY-redhat-release
[rhel-cluster]
name=Red Hat Enterprise Linux cluster
baseurl=ftp://192.168.101.1/rhel/Cluster
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.101.1/rhel/RPM-GPG-KEY-redhat-release
[rhel-clusterstorage]
name=Red Hat Enterprise Linux clusterstorage
baseurl=ftp://192.168.101.1/rhel/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=ftp://192.168.101.1/rhel/RPM-GPG-KEY-redhat-release
二. 本地yum的创建只需加上
24.sed -i 's&ftp://192.168.101.250/rhel&file:///mnt/cdrom&' server.repo
即只需二步
1.cd /etc/yum.repos.d/
2.vim server2.repo
[rhel-server]
name=Red Hat Enterprise Linux server
baseurl=file:///mnt/cdrom/Server
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[rhel-vt]
name=Red Hat Enterprise Linux vt
baseurl=file:///mnt/cdrom/VT
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[rhel-cluster]
name=Red Hat Enterprise Linux cluster
baseurl=file:///mnt/cdrom/Cluster
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
[rhel-clusterstorage]
name=Red Hat Enterprise Linux clusterstorage
baseurl=file:///mnt/cdrom/ClusterStorage
enabled=1
gpgcheck=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
本文出自 “碧云天” 博客,转载请与作者联系!