首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 操作系统 >

yum下令解析

2014-06-03 
yum命令解析Yum配置文件位于/etc/yum.conf和/etc/yum.repos.d/CentOS-Base.repo目录下使用yum时注意:必须

yum命令解析

Yum配置文件位于/etc/yum.conf和/etc/yum.repos.d/CentOS-Base.repo目录下使用yum时注意:必须使用root身份来执行yum;yum配置文件内的镜像站点必须能与自己进行网络连接;镜像站点越近,带宽越大越好,方便下载。[root@localhost ~]# yum [options] COMMAND 软件List of Commands:install:Install a package or packages on your systemupdate:Update a package or packages on your systemremove:移出某个软件,后跟软件名称search:Search package details for the given string 搜索某个软件或重要关键字list:List a package or groups of packages列出yum所管理的软件名称与版本,类似于rpm –qainfo:Display details about a package or group of packages,类似于rpm –qaiclean:Remove cached data 下载文件被放置在/var/cache/yum中,可以使用clean清除。check-update:Check for available package updatesGroupinfo:Display details about a package groupgroupinstall   Install the packages in a group on your systemgrouplist:List available package groupsgroupremove:Remove the packages in a group from your systemgroupupdate:升级整个软件群组help:Display a helpful usage messageDeplist:List a package's dependencies    列出软件包的依赖关系,在使用本地源软件包进行安装时,可以查看依赖关系Downgrade:downgrade a packageErase:Remove a package or packages from your systemlocalinstall:Install a local RPM安装本地的rpm软件包makecache:Generate the metadata cache 生成数据缓存provides:Find what package provides the given value 找到包提供的给定值reinstall:reinstall a package 重装软件包repolist:Display the configured software repositoriesresolvedep:Determine which package provides the given dependencyshell:Run an interactive yum shellupgrade:Update packages taking obsoletes into accountoptions -y:answer yes for all questions当yum询问用户意见时,主动回答yes不需由键盘输入-installroot=[path]:set install root安装在其他的路径,而不再当前目录树的架构中-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-version             show Yum version and exit-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[root@localhost ~]# yum search gcc 查找主机上是否有gcc的相关软件,如果有,就会陈列出来。[root@localhost ~]# yum info gcc 列出已安装的yum所管理的软件名称与版本……………………………………………………………………Name:gccArch:i386Version: 4.1.2Release: 48.el5Size:9.6 MRepo:installedSummary:各类编译器(C、C++、Objective-C、Java, ...)URL:http://gcc.gnu.orgLicense:GPLDescription:The gcc package contains the GNU Compiler Collection version 4.1.You'll need this package in order to compile c code……………………………………………………………………显示该软件版本名称,数据大小,软件出处等信息。需要注意summary和description的信息可以依据yum search 软件名查找此软件的信息,yum list软件名 列出此软件的版本和名称,决定是否安装此软件。安装之前使用rpm –q 软件名,查看此软件是否安装,如没有安装,使用yum install 软件名 进行安装使用yum可以主动处理好依赖关系,下载好的软件一般都放置在/var/cache/yum中,可以清除以节省磁盘空间。[root@localhost ~]# yum clean packages        #清除下载的软件包[root@localhost ~]# yum -y update            #手动系统更新

热点排行