First, the definition
Yum (Yellowdog Updater Modified) is a shell front-end package manager in Fedora and Redhat as well as in CentOS. Based on RPM package management, can automatically download RPM package from the specified server and install, can automatically handle dependency relationship, and install all dependent soft packages at once, without tedious downloading, installing
Second, the Yum component:
(1), File Server (shared RPM package):
Principle: Share each RPM package via file service through the file sharing mechanism supported by Yum
Repository: Warehouse
1, Data: package;
2, metadata: Package properties, including size, version, dependencies, etc., generated through the Createrepo command, saved in Repodata
(2), yum client:
1. Configuration file: Specify the available yum repositories;
2. Cache metadata: Yum will fetch meta data from each available Yum repository and cache it locally;
3, analysis metadata: According to the specific operation request to complete meta-data analysis, may include checking dependencies, file lists and other information;
4, carry out the specific operation:
The client configuration file specifies how the corresponding server is accessed:
FTP Ftp://server/path/to/repo
HTTP Http://server/path/to/repo
NFS Nfs://server/nfs_path
File File:///path/to/repository
Third, the configuration file:
(1), configuration file contents
To use the Yum Management application, first configure its available Yum repositories, which are saved in the configuration file:
Master configuration file: saved in/etc/yum.conf
Warehouse configuration file: saved in/etc/yum.repos.d/*.repo
Configuration repo:
[repo_id] repoid must be unique
Name=string Warehouse Description Information
Access path to the Baseurl= warehouse
ENABLED={1|0} whether the warehouse can be used
GPGCHECK={1|0} Whether to validate the program
gpgkey= Public key file (can be local, but server-side path)
Cost= defines this warehouse overhead, which defaults to 1000
Ex:
650) this.width=650; "title=" 2015-04-11 48.png "alt=" wkiom1upgcfc3wpraad-qq3s5im708.jpg "src="/http S3.51cto.com/wyfs02/m00/5e/0b/wkiom1upgcfc3wpraad-qq3s5im708.jpg "/> Description: This configuration BaseURL address is the LAN file server address.
(2), configuration file variables
Yum has built-in variables for storing the current platform's phase information;
1, $releasever: The current OS release version of the major version number;
For example, for CentOS 6.6 x86_64, the major version number is 6;
2. $arch: Platform
3, $basearch: The basic platform, such as i686, i586, i486 and I386 Foundation platform is the same as i386;
4, $YUM 0-$YUM 9: variable can be defined
If:
baseurl=http://repo.magedu.com/centos/$releasever/$basearch
If the current system is: CentOS 6.6 x86_64
Actual path: http://repo.magedu.com/centos/6/x86_64
Iv. Yum Command
1, Warehouse Management:
Yum Repolist [all|enabled|disabled]
All: List all Yum warehouses
Enabled: Lists the open yum repositories
Disabled: List the closed Yum repositories
2. Cache Management:
1), clean up the cache:
Yum Clean [Packages | metadata | expire-cache | rpmdb | plugins | all]
Packages: Clean up the packet cache
Metadata: Cleaning up the metadata cache
Expire: Cleanup Expired cache
RPMDB:I Clean RPM Database Cache
Plugins: Cleanup Plugin cache
All: Clean up all caches
2), create cache
Yum Makecache
Description: Download only the online Yum repository metadata and create it as a cache;
3. Package Management
1), Package view
Yum List {avaiable|updates|installed}
Avaiable: View not installed packages
Updates: View update packages
Installed: Viewing installed packages
Yum check-update: Viewing packages that need to be upgraded
2) Management of packages
(1), installation
Yum Install package ...
(2), upgrade
Yum Update package ...
(3), uninstall
Yum Remove|erase Package ...
Description: All dependent packages are uninstalled
(4), reinstall
Yum Reinstall package ...
(5), downgrade
Yum Downgrade package ...
3) Management of package groups
(1), installation
Yum Groupinstall Group ...
(2), upgrade
Yum groupupdate Group ...
(3), uninstall
Yum Groupremove Group ...
(4), display the specified package group details
Yum GroupInfo Group ...
4. Available options
-Y: Auto Answer "yes"
--disablerepo= temporarily disables the specified repo
--enablerepo= temporarily enable the specified repo
--nogpgcheck: Prohibit package check
V. Production of Yum Repository
1, using the distribution CD-ROM to do yum repository
(1) Mount the disc to a specified mount point, such as/media/cdrom
#mkdir/media/cdrom
#mount-R-T Iso9660/dev/cdrom/media/cdrom
(2) Create a new yum repo configuration file similar to the following:
#cd/ETC/YUM.REPOS.D
#vim Local.repo
Enter the following:
650) this.width=650; "title=" 2015-04-11 16.png "alt=" wkiol1upg0xbihuraabrovuwsya498.jpg "src="/http S3.51cto.com/wyfs02/m00/5e/06/wkiol1upg0xbihuraabrovuwsya498.jpg "/>
#yum repolist View online repo
650) this.width=650; "style=" float:left; "title=" 2015-04-11 15.png "alt=" wkiol1uphoode6gvaad7jd6zahi453.jpg "src = "Http://s3.51cto.com/wyfs02/M00/5E/0D/wKioL1UpHoODE6gVAAD7jD6zAhI453.jpg"/>
#yum Install PHP test with CD installer
650) this.width=650; "style=" float:left; "title=" 2015-04-11 53.png "alt=" wkiom1uphdhhyu6raak2g8g3ymu161.jpg "src = "Http://s3.51cto.com/wyfs02/M01/5E/12/wKiom1UpHdHhyu6RAAK2G8g3yMU161.jpg"/>
2. Create local yum repository
#yum install createrepo Install create metadata command (to complete the disc first to do yum repository)
#mkdir-pv/var/test/yum/xen4 to create Yum recursively Repository directory
#yum install lftp installation lftp
#cd /var/test/yum/xen4
#lftp 172.16.0.1/pub/soureces/6.x86_64/xen-4.1 go to File server
>mget *.rpm Download RPM Package to local
>bye exit
#createrepo/var/test/yum /xen4 Creating packet metadata
#cd/etc/yum.repos.d
#vim Local.repo
Add the following content below the contents
650) this.width=650; "title=" 2015-04-11 48.png "alt=" wkiol1upg6xx6vqiaabupo_liac164.jpg "src="/http S3.51cto.com/wyfs02/m02/5e/07/wkiol1upg6xx6vqiaabupo_liac164.jpg "/>
#yum repolist View all online repo
650) this.width=650, "title=" 2015-04-11 23.png "src=" http://s3.51cto.com/wyfs02/M00/5E/0F/wKioL1UpI_ Mgcjv7aaersboohno061.jpg "alt=" Wkiol1upi_mgcjv7aaersboohno061.jpg "/>
#yum List all xen* See all packages beginning with Xen
Install the Xen package #yum the install Xen test
3. Create FTP Yum Repository
Installing the VSFTPD Service Pack #yum install VSFTPD
#cd/var/ftp/pub
#cp-R/var/test/yum/xen4/./copy Xen4 and content into the pub directory
#service vsftpd start vsftpd Service
#service iptables stop to shut down the firewall
#cd/ETC/YUM.REPOS.D
#vim Localtest.repo
Enter the following content
650) this.width=650; "title=" 2015-04-11 14.png "alt=" wkiom1upgqch7bapaabve4hor4q580.jpg "src="/http S3.51cto.com/wyfs02/m00/5e/0c/wkiom1upgqch7bapaabve4hor4q580.jpg "/>
In the browser, enter:
ftp://172.16.21.67 can see the contents of the folder properly OK
4. Content Supplement
After you create the FTP, you can display the self-built folder without displaying the content
1. Turn off the firewall
Setup-->firewall Configuration
2. Turn off SELinux
#vim/etc/selinux/config
Modify Selinux=disable
How to get vsftpd to boot with boot
#chkconfig--list vsftpd View vsftpd status
#chkconfig vsftpd on modify vsftpd boot up
This article is from the "Linux class notes" blog, so be sure to keep this source http://wangxinjian.blog.51cto.com/6334977/1631351
Detailed Package Management Yum