配置YUM
Yum needs to know what software should be installed on your system. For instance, if you are using Fedora Core 2, then it needs to know what packages make up a standard install of Fedora Core 2. The packages needed for a particular Linux distribution are stored in repositories on the Internet. To properly configure yum, you need to open a file called /etc/yum.conf
, and make sure it contains the proper information. In other words, you use yum.conf to point yum at the repositories on the Internet that define the files needed for your distribution of Linux.
一个/etc/yum.conf文件实例
关于RPM格式文件
package in yum is an rpm file. Each rpm file has a header, that defines the contents of the file and any dependencies it might have. In particular, it defines the versions of the programs upon which the code in the rpm file depends.
查看RPM文件的内容
用命令 rpm -qpl *.rpm
解压RPM包的内容
用命令 rpm2cpio *.rpm | cpio -div
yum命令
yum list
When you first start yum by becoming root and typing yum list
, it usually spends a long time (15 to 60 minutes) downloading not entire rpm files, but instead the headers for all the rpm files that define your distribution.
yum update
After it has downloaded all these headers, then you can issue a command like yum update
, and yum will compare the current contents of your system to the records found in the rpm headers it has downloaded. If some of the headers reference files that are more recent than the files currently installed on your system, then yum will automatically download the needed complete rpm files and use them to update your system.
yum info <name>
查询某个软件
[root@cent