关于yum

一. yum是什么

  yum = Yellow dog Updater, Modified主要功能是更方便的添加/删除/更新RPM包.它能自动解决包的倚赖性问题.

  它能便于管理大量系统的更新问题

  注:为什么要使用yum而不用apt,最简单的原因,Fedora自带

  二. yum特点

  *可以同时配置多个资源库(Repository)

  *简洁的配置文件(/etc/yum.conf)

  *自动解决增加或删除rpm包时遇到的倚赖性问题

  *使用方便

  *保持与RPM数据库的一致性

 

三 yum的配置文件:

[root@rcc-pok-idg-1998 test]# cat /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1

# Note: yum-RHN-plugin doesn't honor this.
metadata_expire=1h

# Default.
# installonly_limit = 3

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

四:yum的一些命令:

 *rpm包的更新

  检查可更新的rpm包

  #yum check-update

  更新所有的rpm包

 

  #yum update

  更新指定的rpm包,如更新kernel和kernel source

  #yum update kernel kernel-source

  大规模的版本升级,与yum update不同的是,连旧的淘汰的包也升级

 

  #yum upgrade

  *rpm包的安装和删除

  安装rpm包,如xmms-mp3

 

  #yum install xmms-mp3

  删除rpm包,包括与该包有倚赖性的包

  #yum remove licq

  注:同时会提示删除licq-gnome,licq-qt,licq-text

 

  *yum暂存(/var/cache/yum/)的相关参数

  清除暂存中rpm包文件

  #yum clean packages

 

  清除暂存中rpm头文件

  #yum clean headers

  清除暂存中旧的rpm头文件

  #yum clean oldheaders

 

  清除暂存中旧的rpm头文件和包文件

  #yum clean或#yum clean all

  注:相当于yum clean packages + yum clean oldheaders

 

  *rpm包列表

  列出资源库中所有可以安装或更新的rpm包

  #yum list

  列出资源库中特定的可以安装或更新以及已经安装的rpm包

[root@netxc185 redhat]# yum list | more
Loaded plugins: rhnplugin, security
This system is not registered with RHN.
RHN support will be disabled.
Installed Packages
Cluster_Administration-en-US.noarch       5.2-1                   installed
Deployment_Guide-en-US.noarch             5.2-11                  installed
ElectricFence.x86_64                      2.2.2-20.2.2            installed
GConf2.i386                               2.14.0-9.el5            installed
GConf2.x86_64                             2.14.0-9.el5            installed
Global_File_System-en-US.noarch           5.2-1                   installed

 

yum与rpm的区别:

YUM是从软件仓库自动下载,自动安装,自动配置的。
RPM是要你自己下载软件包以及相关的包,之后再依次用rpm命令装完各个包。

 

 

[root@netxc185 redhat]# yum --help
Loaded plugins: rhnplugin, security
usage: yum [options] COMMAND

List of Commands:

check-update   Check for available package updates
clean          Remove cached data
deplist        List a package's dependencies
downgrade      downgrade a package
erase          Remove a package or packages from your system
groupinfo      Display details about a package group
groupinstall   Install the packages in a group on your system
grouplist      List available package groups
groupremove    Remove the packages in a group from your system
help           Display a helpful usage message
info           Display details about a package or group of packages
install        Install a package or packages on your system
list           List a package or groups of packages
localinstall   Install a local RPM
makecache      Generate the metadata cache
provides       Find what package provides the given value
reinstall      reinstall a package
repolist       Display the configured software repositories
resolvedep     Determine which package provides the given dependency
search         Search package details for the given string
shell          Run an interactive yum shell
update         Update a package or packages on your system
upgrade        Update packages taking obsoletes into account


options:
  -h, --help            show this help message and exit
  -t, --tolerant        be tolerant of errors
  -C                    run entirely from cache, don't update cache
  -c  [config file]     config file location
  -R  [minutes]         maximum command wait time
  -d  [debug level]     debugging output level
  --showduplicates      show duplicates, in repos, in list/search commands
  -e  [error level]     error output level
  -q, --quiet           quiet operation
  -v, --verbose         verbose operation
  -y                    answer yes for all questions
  --version             show Yum version and exit
  --installroot=[path]  set install root
  --enablerepo=[repo]   enable one or more repositories (wildcards allowed)
  --disablerepo=[repo]  disable one or more repositories (wildcards allowed)
  -x [package], --exclude=[package]
                        exclude package(s) by name or glob
  --disableexcludes=[repo]
                        disable exclude from main, for a repo or for
                        everything
  --obsoletes           enable obsoletes processing during updates
  --noplugins           disable Yum plugins
  --nogpgcheck          disable gpg signature checking
  --disableplugin=[plugin]
                        disable plugins by name
  --enableplugin=[plugin]
                        enable plugins by name
  --skip-broken         skip packages with depsolving problems
  --color=COLOR         control whether color is used
  --security            Include security relevant packages
  --cve=CVE             Include packages needed to fix the given CVE
  --bz=BZ               Include packages needed to fix the given BZ
  --advisory=ADVISORY   Include packages needed to fix the given advisory

  Plugin Options:

 

附:

Linux add user:

 

useradd zhyingsh

 

 语  法:whoami [--help][--version]
  补充说明:显示自身的用户名称,本指令相当于执行"id -un"指令。

 

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

惹不起的程咬金

来都来了,不赏点银子么

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值