linux软件的安装与升级(yum)

yum的基础安装组件
yum
yum-fastestmirror(插件)
yum的配置文件
/etc/yum.conf
/etc/yum.repos.d
/etc/yum/pluginconf.d
/usr/lib/yum-plugins
/var/lib/yum(yum数据库)
/var/cache/yum(yum缓冲,rpm清单,rpm包等)
yum的工作原理
1 yum实际上包括2部分,yum服务器和yum客户端

2 yum服务器:
    yum服务器提供rpm包的下载(rpm包是根据kernel的版本号,cpu的版本号分别编译发布)
    yum服务器提供repodata文件(包含所有rpm包信息的清单文件)

3 yum客户端:
    yum客户端从yum服务器下载rpm清单(即rpm头文件,存储在/var/cache/yum中)
    yum对比rpm,增加了对rpm包依赖关系的处理
    yum的所有命令都是针对yum数据库的操作,和yum服务器无关
yum常用命令
yum makecache(更新清单)
yum repolist all(查看所有软件仓库)
yum deplist xxx(查看rpm包的依赖关系)

yum search 关键字(从rpm清单中查找含有该关键字信息的软件包)
yum provides 文件名字(从rpm清单中查询哪一个软件包提供了该文件)

yum clean all(清除cache)
yum clean packages(清除cache中的rpm包)
yum clean headers(清除cache中的rpm清单)
yum clean oldheaders(清除cache中老的rpm清单)

yum list(列出所有的rpm包)
yum list updates(列出所有可更新的rpm包)
yum list installed(列出所有已安装的rpm包)
yum list extras(列出所有已安装的,但不包含在yum源中的rpm包)

yum info(列出所有的rpm包)
yum info updates(列出所有可更新的rpm包)
yum info installed(列出所有已安装的rpm包)
yum info extras(列出所有已安装的,但不包含在yum源中的rpm包)

yum install xxx(安装软件)
yum remove xxx(卸载软件)

yum check-update(检查更新)
yum update xxx(更新指定的rpm包)
说明1
bash.x86_64 4.2.46-31.el7
程序名.arch 程序版本号-rpm包发行号.操作系统
epel-release(为红帽子提供扩展的rpm包,目前由Fedora维护)
Anaconda是RedHat、CentOS、Fedora等Linux的安装管理程序
说明2

yum先是下载每个仓库的清单文件(即repolist,不是每次都下载新的,而是有一个全局版本号,拿本地的版本号和远程的对比,不一样才更新),然后操作/var/cache/yum(repolist)和/var/lib/yum的内容来进行软件管理

说明3

yum update originally just did upgrades of packages to new versions.
If, for example, foo-awesome obsoleted foo, yum update wouldn't offer
to upgrade from foo to foo-awesome. Adding the --obsoletes flag to yum
update made it do the extra checks to also offer that upgrade path.
yum upgrade was added as (essentially) an alias for yum --obsoletes
update. Since this is the behavior that almost everyone wants all of
the time, the configuration option obsoletes=1 was added to the
default /etc/yum.conf, making yum update and yum upgrade equivalent on
any recent, stock, Fedora/RHEL/CentOS/etc.

If you want to avoid kernel updates when you're running yum update,
you can just do yum --exclude=kernel* update. If you want automatic
updates on, but you want to avoid automatic kernel upgrades, then
adding the exclude to yum.conf is probably the right answer.

There probably isn't a Right Answer for your question. RHEL and
RHEL-based distributions don't have the same philosophy as the Debian
developers when it comes to updates, so the tools don't encourage the
same sorts of behavior.

你可能感兴趣的:(linux软件的安装与升级(yum))