Linux-yum命令简介

来源:互联网 发布:淘宝店铺怎么贷款 编辑:程序博客网 时间:2024/06/03 16:08

yum命令大纲

  • 查询
  • 安装
  • 升级
  • 卸载
  • 软件组管理

查询命令:

yum list          查询服务器所有可用的软件包列表yum search 关键字        搜索服务器上所有和关键字相关的包注意:    yum命令是没有本机查询命令的,这里的查询都是针对服务器上软件包的查询    如果要查询本机安装了哪些软件包还得用到rpm命令,详情见rpm命令介绍.    eg: rpm -qa | grep  软件包名

安装命令:

yum -y install 包名    (yum安装包中,使用包名,不需要包全名,对比rpm命令安装,一定要是包全名)eg: yum -y install gcc    yum -y install wget选项:    -install 安装    -y       自动回答yes    

升级命令:

yum -y update 包名    升级指定包名的软件yum -y update    升级Linux中所有安装包程序,包括Linux内核    (千万主要不要轻易这样操作,很有可能使得Linux崩溃)选项:    update     升级    -y         自动回答yes

卸载命令:

yum -y remove 包名    卸载指定包名的软件说明:    卸载也是有依赖性,yum卸载回先卸载之前的依赖,与安装类似    不建议使用yum命令来卸载软件包,因为不会提示依赖会自动将该包所有的依赖卸载    极有可能会造成系统崩溃(建议使用rpm命令来卸载)选项:     remove       卸载     -y           自动回到yes

软件组管理命令:

这里是说的系统的软件支持组件,比如安装中文支持:yum grouplist        列所有可用的软件组列表yum groupinstall  软件组名(必须是英文)        安装指定软件组,组名可以由grouplist查询出来        eg: yum groupinstall "GNOME Desktop"             安装桌面支持,图形管理工具yum groupremove 软件组名        卸载指定软件组
[root@localhost dev]# yum grouplist已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configuration没有安装组信息文件Maybe run: yum groups mark convert (see man yum)Loading mirror speeds from cached hostfile可用的环境分组:   最小安装   基础设施服务器   计算节点   文件及打印服务器   基本网页服务器   虚拟化主机   带 GUI 的服务器   GNOME 桌面   KDE Plasma Workspaces   开发及生成工作站可用组:   传统 UNIX 兼容性   兼容性程序库   图形管理工具   安全性工具   开发工具   控制台互联网工具   智能卡支持   科学记数法支持   系统管理   系统管理工具完成

修改语言环境为英文后再执行yum grouplist:
export LANG=en_US.UTF-8
export LANG=zh_CN.UTF-8

[root@localhost dev]# export LANG=en_US.UTF-8[root@localhost dev]# yum grouplistLoaded plugins: fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationThere is no installed groups file.Maybe run: yum groups mark convert (see man yum)Loading mirror speeds from cached hostfileAvailable Environment Groups:   Minimal Install   Compute Node   Infrastructure Server   File and Print Server   Basic Web Server   Virtualization Host   Server with GUI   GNOME Desktop   KDE Plasma Workspaces   Development and Creative WorkstationAvailable Groups:   Compatibility Libraries   Console Internet Tools   Development Tools   Graphical Administration Tools   Legacy UNIX Compatibility   Scientific Support   Security Tools   Smart Card Support   System Administration Tools   System ManagementDone[root@localhost dev]#