YUM配置及自定义

本文详细介绍了如何配置YUM,包括查看RPM文件内容、使用YUM命令、理解YUM仓库配置文件。YUM通过配置文件指向互联网上的仓库来获取系统所需的软件包。同时,讲解了RPM的包标签、查询限制以及YUM缓存的位置。了解这些内容有助于更好地管理和更新Linux系统。
摘要由CSDN通过智能技术生成


配置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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值