Personal Original, welcome to reprint QQ783723720 email: anmyyang@gmail.com
What is YUM
Yum (all called Yellow dog Updater, Modified) is a Shell front-end Package Manager in Fedora. Based on RPM package management, You can automatically download and install the RPM package from the specified server, and automatically handle dependencies. you can install all dependent software packages at a time without the need to download and install them repeatedly.
The YUM service involves the client and server, where:
1 YUM Client: Make sure the following software packages are installed:
Yum-3.0.1-5.el5
Yum-metadata-parser-1.0-8.fc6
2 YUM Server: ensure that the following software packages are installed:
Yum-3.0.1-5.el5
Yum-metadata-parser-1.0-8.fc6
Yum-rhn-plugin-0.4.3-1.el5
Yum-updatesd-3.0.1-5.el5
Createrepo-0.4.4-2.fc6.noarch.rpm
Yum-arch-2.2.2-2.fc7.noarch.rpm
Yum Server Installation
1. Store software packages on the YUM Server
Mount the redhatES5 system disk to/mnt.
Regenerate the/rhel5 directory to store the software package:
[Root @ ns100 vmware] # mkdir/rhel5
Mount all the software packages under the Server Directory (which stores some Server software packages) on the CD to/rhel5. Because there are many software packages in the Server directory, rhel5 may not be available, you can format a 5g partition and mount it to the/rhel5 directory.
[Root @ ns100 vmware] # cp-R/mnt/Server/rhel5
Upload the key file (used for client and server authentication) to the specified directory.
[Root @ ns100 vmware] # cp/mnt/RPM-GPG-KEY-redhat-release/rhel5/Server
Note: If you have an iso file (an image file on the optical disk) of a system disk, you can use this file to perform a virtual optical drive and then attach the virtual optical drive to/mnt. The method is as follows:
Mount-o loop redhat. iso/mnt
Enter/mnt to use it;
2. The server sets the software repository and report files.
First, generate the YUM software Repository:
[Root @ ns100 vmware] # yum-arch/rhel5/Server Note: errors can be reported or ignored.
Set the report file to be obtained from the client:
[Root @ ns100 vmware] # createrepo/rhel5/Server
3. Configure the www Service to publish these software packages.
Perform the following configuration in/etc/httpd/conf/httpd. conf (Note: If httpd cannot be started, disable SELinux with setenforce 0)
Change DocumentRoot "/var/www/html" to DocumentRoot "/rhel5"
<Directory "/var/www/html"> changed to <Directory "/rhel5">
Restart the http service:
[Root @ localhost ~] # Service httpd restart
Stopping httpd: [OK]
Starting httpd: [OK]
4. Client Configuration:
Method 1
Generate the Server. repo file under/etc/yum. repos. d/. Note: If/etc/yum. conf is set, search for the file from yum. conf first;
Client:
Back up the original. repo file:
[Root @ network yum. repos. d] # mkdir-p/etc/yum. repos. d/backup
[Root @ network yum. repos. d] # mv/etc/yum. repos. d/*. repo/etc/yum. repos. d/backup
[Root @ network yum. repos. d] # touch/etc/yum. repos. d/Server. repo
[Root @ network yum. repos. d] # cat/etc/yum. repos. d/Server. repo (Note: If yum. the following content is added at the end of the conf file, and the rest remains unchanged ;)
[Server]
Name = Red Hat
Baseurl = http: // 10.0.0.1/Server/
Gpgcheck = 1
Gpgkey = http: // 10.0.0.1/Server/RPM-GPG-KEY-redhat-release
Method 2
Modify the default/etc/rhel-debuginfo.repo to change two places
Baseurl = http: // 10.0.0.1/Server/
Enabled = 1
5 Test
Run the following command on the client:
Yum install dasher
Yum-y install firefox automatically responds to yes
Yum remove httpd Delete Software Package
Yum clean all clears the cache of the downloaded software package
The yum list lists all software packages (including those installed and existing on the YUM server)
Yum upgrade or yum update package
Yum list installed list all installed software packages
Yum list available list all available software packages
Yum list updates lists all the software packages that can be upgraded
Attachment: FTP-based YUM server Construction
1. Mount the redhatES5 system disk to/mnt.
[Root @ ns100 vmware] # cp-R/mnt/Server/var/ftp/Server
[Root @ ns100 vmware] # cp/mnt/RPM-GPG-KEY-redhat-release/var/ftp/Server
2
[Root @ ns100 vmware] # yum-arch/var/ftp/Server Note: errors can be reported or ignored.
[Root @ ns100 vmware] # createrepo/var/ftp/Server
3. Configure yum. conf
[Root @ ns100 vmware] # cat/etc/yum. conf
[Main]
Cachedir =/var/cache/yum
Keepcache = 0
Debuglevel = 2
Logfile =/var/log/yum. log
Pkgpolicy = newest
Distroverpkg = redhat-release
Tolerant = 1
Exactarch = 1
Obsoletes = 1
Gpgcheck = 1
Plugins = 1
Metadata_expire = 1800
4. Run the vsftp Service
Service vsftpd restart
5. Client Configuration:
Method 1
Generate the Server. repo file under/etc/yum. repos. d/. Note: If/etc/yum. conf is set, search for the file from yum. conf first;
Client:
[Root @ network yum. repos. d] # mkdir-p/etc/yum. repos. d/backup
[Root @ network yum. repos. d] # mv/etc/yum. repos. d/*. repo/etc/yum. repos. d/backup
[Root @ network yum. repos. d] # touch/etc/yum. repos. d/Server. repo
[Root @ network yum. repos. d] # cat/etc/yum. repos. d/Server. repo note: the following content is added at the end of yum. conf, And the rest remain unchanged;
[Server]
Name = Red Hat
Baseurl = ftp: // 10.0.0.1/Server/
Gpgcheck = 1
Gpgkey = ftp: // 10.0.0.1/Server/RPM-GPG-KEY-redhat-release
Method 2
Modify the default/etc/rhel-debuginfo.repo to change two places
Baseurl = ftp: // 10.0.0.1/Server/
Enabled = 1