Basic concepts
Yum is a front- End management tool for software packages based on the C/S architecture. It is a package based on rpm package management, which solves the problem of dependencies during rpm package installation.
server side of Yum:
Its essence is a file server, the main function:
1 . Using yum 's file sharing mechanism, each rpm package is shared to the client.
2. Share file dependencies, the metadata of file list information generated after installation.
Sharing protocol:
FTP, HTTP, NFS, file ( for local Yum-repo)
the client side of Yum:
Main functions:
1.edit the configuration file to specify the available repo.
2, the cache metadata, including the dependencies of the package, package installation after the creation of file list information.
3, analysis metadata, according to the specific operation analysis of the above meta-data information.
4, theimplementation of specific operations, such as installation, uninstallation, inquiry and so on.
How to access the server-side repo :
1,Http://server-ip/path/to/repo
2,Ftp://server-ip/path/to/repo
3,nfs://server-ip/path/to/nfs
4,File:///path/to/repo
Yum configuration file
1./etc/yum.conf : Core configuration file
2./etc/yum.repos.d/*.repo: Each repo configuration file that makes up the core configuration file, which is often edited to specify what the client depends on repository.
configuration actions for Yum profile *.repo
Required Fields:
[Repo-id]
Name=repo-string (there can be spaces)
Baseusrl= Access Path to the repo server
ENABLED={0|1} whether the repo is enabled
GPGCHECK={0|1} whether to conduct source legality and file integrity verification
gpgkey= The public key detection file in the repo of the server, if gpgcheck=0, it isnot necessary to configure the item.
The following is a Yum source that I have written on this host using this repo:
[[email protected] ~]# dffilesystem 1k-blocks used available Use% Mounted on/dev/mapper/VolGroup-lv_root 6926264 1744892 4829528 27% /tmpfs 243140 0 243140 0% /dev/shm/dev/sda1 495844 33472 436772 8% /boot/dev/sr0 3762278 3762278 0 100% /media/rhel6.5[[email protected] ~]# cat /etc/yum.repos.d/centos.repo [ rhel-source]name=red hat enterprise linux $releasever - $basearch - Sourcebaseurl=file:///media/rhel6.5enabled=1gpgcheck=0
What the macros in the Yum configuration file mean
The benefits of using macros make it easy for the Yum to be used between different platforms.
$releaserver: refers to the release version, such as redhat6.5, $releasever =6.
$arch: system architecture.
$basharch: The basic architecture of the system, such as i586,i686 , is i386.
specific use of yum
Command : Yum [option] command Pkgname
COMMAND:
Install: installs the package, which can be either repo or a local package.
Erase/remove: Uninstalls the package and uninstalls the package that has dependencies.
repolist [all|enabled|disabled]: List all | available | Unavailable "available Repo .
Clean [all|pkgs|metdate ...] : Clears the all | Package | meta-data ... "Cache.
list [all|installed|available]: List all | installation | The package is not installed.
Reinstall: Reinstall the package.
Update: Upgrade package,update pkg-version: Upgrade to the specified version.
Updateinfo: View upgrade information for repo.
Check-update: View the packages that can be upgraded.
Downgrade Pkg-version: Downgrade package.
Whatprovides/provide/path/to/somefile: See which package a file belongs to.
Deplist: View the dependencies of the package.
Grouplist: Lists package group information.
Groupinstall: Installs the package group.
History: See what yum has done before.
[option]:
-Y: Answer question automatically yes.
Self-built Yum repository (take Web server as an example)
1, download the software package refers to/var/www/html.
2, Createrepo/var/www/html/pkg-dir
By creating the repo in these two steps, you can use the repo locally or through a Web server share.
This article is from the "11219885" blog, please be sure to keep this source http://11229885.blog.51cto.com/11219885/1750678
Package Management-yum