YUM库配置

服务器
1.   [root@all ~]# mkdir /rhce       制作安装文件目录
     [root@all ~]# mount /dev/hdc /media/
     mount: block device /dev/hdc is write-protected, mounting read-only
     [root@all ~]# cp -r /media/*  /rhce/
2.   [root@all ~]# cd Desktop/
     [root@all Desktop]# vim yumserver.sh
     #!/bin/bash
echo "install createrepo.rpm"
rpm -ivh --force "/rhce/Server/createrepo-0.4.4-2.fc6.noarch.rpm"
echo "cd /rhce"
cd /rhce
rm -rf Server/.olddata/
rm -rf VT/.olddata/
rm -rf Cluster/.olddata/
rm -rf ClusterStorage/.olddata/
for i in `find | grep "xml$" | grep "comps"`;do createrepo -g ${i#./*/} ${i%/*/*.xml}; done
exit 0
[root@all Desktop]# chmod +x yumserver.sh
[root@all Desktop]# ./yumserver.sh
install createrepo.rpm
warning: /rhce/Server/createrepo-0.4.4-2.fc6.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
cd /rhce
2015/2159 - jakarta-commons-collections-testframework-javadoc-3.1-6jpp.1.i386.rp2159/2159 - Deployment_Guide-hi-IN-5.1.0-11.noarch.rpm                         
Saving Primary metadata 
.......
3.  [root@all Server]# rpm -ivh vsftpd-2.0.5-10.el5.i386.rpm
warning: vsftpd-2.0.5-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
        package vsftpd-2.0.5-10.el5 is already installed
[root@all Server]# vim /etc/vsftpd/vsftpd.conf
[root@all Server]# vipw
ftp:x:14:50:FTP User:/rhce:/sbin/nologin   修改匿名用户主目录为/rhce
     [root@all Server]# service vsftpd restart
Shutting down vsftpd:                                      [FAILED]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@all Server]# chkconfig vsftpd on
客户端
1.  [root@all Desktop]# chmod +x yumclient.sh
    [root@all Desktop]# ./yumclient.sh
    内容:
    #!/bin/bash
sed -i  's/gpgcheck=1/gpgcheck=0/' /etc/yum.conf
cd /etc/yum.repos.d/
rm -rf *repo
cat  > server1.repo <<EOF
[rhel-rpms]
name=Red Hat Enterprise Linux $releasever - $basearch - rpms
baseurl=ftp://192.168.0.239/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-VT]
name=Red Hat Enterprise Linux $releasever - $basearch - VT
baseurl=ftp://192.168.0.239/VT
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-Cluster]
name=Red Hat Enterprise Linux $releasever - $basearch - Cluster
baseurl=ftp://192.168.0.239/Cluster
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[rhel-ClusterStorage]
name=Red Hat Enterprise Linux $releasever - $basearch - ClusterStorage
baseurl=ftp://192.168.0.239/ClusterStorage
enabled=1
gpgcheck=0
EOF

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