美文网首页
Yum命令解析

Yum命令解析

作者: 我只是一个小白木木 | 来源:发表于2018-07-10 10:52 被阅读0次

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 system

update:Update a package or packages on your system

remove:移出某个软件,后跟软件名称

search:Search package details for the given string 搜索某个软件或重要关键字

list:List a package or groups of packages列出yum所管理的软件名称与版本,类似于rpm –qa

info:Display details about a package or group of packages,类似于rpm –qai

clean:Remove cached data 下载文件被放置在/var/cache/yum中,可以使用clean清除。

check-update:Check for available package updates

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

groupupdate:升级整个软件群组

help:Display a helpful usage message

Deplist:List a package's dependencies 列出软件包的依赖关系,在使用本地源软件包进行安装时,可以查看依赖关系

Downgrade:downgrade a package

Erase:Remove a package or packages from your system

localinstall: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 repositories

resolvedep:Determine which package provides the given dependency

shell:Run an interactive yum shell

upgrade:Update packages taking obsoletes into account

-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:gcc
Arch:i386
Version: 4.1.2
Release: 48.el5
Size:9.6 M
Repo:installed
Summary:各类编译器(C、C++、Objective-C、Java, ...)
URL:http://gcc.gnu.org
License:GPL

Description: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 #手动系统更新

相关文章

  • Yum命令解析

    Yum配置文件位于/etc/yum.conf和/etc/yum.repos.d/CentOS-Base.repo目...

  • 07 yum的使用

    yum:查找、安装、删除一个/组/全部软件包的命令 1、yum 报错:如下图 原因解析:使用了python2的语法...

  • Centos 7 安装 vim 命令

    安装命令 命令: yum install vim 如果没有yum,安装便好命令: # sudo yum insta...

  • yum常用命令

    yum常用命令: 1.使用YUM查找软件包 命令:yum search 2.列出所有可安装的软件包 命令:yum ...

  • Centos7安装nmcli和nmtui

    nmcli安装命令:yum install NetworkManager nmtui安装命令:yum instal...

  • tree命令的安装及使用

    yum安装命令:yum install -y tree*(前提是要有安装yum包,可以连接外网) 命令的使用:1)...

  • Linux安装svn

    1.使用yum命令安装svn yum命令:yum -y install subversion 2.新建仓库目录 在...

  • 阿里云服务器命令

    命令介绍命令升级yum yum是用来安装包的yum update -y安装nodejsyum install -y...

  • 1

    1、切换到root权限 命令:su (2、更新yum地址 命令:yum –y update ) 3、安装软件 命令...

  • 安装 Docker

    如果当前没有 yum-config-manager 命令,则安装 yum-config-manager 命令 安装...

网友评论

      本文标题:Yum命令解析

      本文链接:https://www.haomeiwen.com/subject/kgkfpftx.html