7.2. yum - Yellowdog Updater Modified

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
简介:

7.2.1. YUM 源管理

列出所有yum源

# yum repolist all
			

查看启用YUM源

# yum repolist enabled
			

查看禁用YUM源

# yum repolist disabled
			

禁用YUM源

# yum-config-manager --disable mysql-connectors-community
			

启用YUM源

sudo yum-config-manager --enable mysql57-community-dmr
			

或者修改/etc/yum.repos.d/文件也能实现相同的作用 enabled=0 为禁用 enabled=1启用

7.2.2. install

有效的包名称

name
name.arch
name-ver
name-ver-rel
name-ver-rel.arch
name-epoch:ver-rel.arch
epoch:name-ver-rel.arch			
			
yum -y install package
			

指定yum源

yum -y install epel:nginx.x86_64			
			

reinstall

yum -y reinstall package
			

7.2.3. localinstall

yum localinstall 可以代替 rpm -ivh 并且会自己安装依赖包

# yum localinstall asymptote-2.08-1.fc12.i686.rpm
			

7.2.4. list

			
yum list
			
			

列出已经安装的包

			
yum list installed

yum list installed | wc -l

yum list installed ntp

yum list installed mysql\*
			
			
yum list updates
yum list extras
			

默认yum只显示最新版本的包,使用 --showduplicates 可以显示历史包

root@netkiller /var/log % yum --showduplicates list nginx | expand
Repository epel is listed more than once in the configuration
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Installed Packages
nginx.x86_64                      1:1.12.1-1.el7.ngx                      @nginx
Available Packages
nginx.x86_64                      1:1.8.0-1.el7.ngx                       nginx 
nginx.x86_64                      1:1.8.1-1.el7.ngx                       nginx 
nginx.x86_64                      1:1.10.0-1.el7.ngx                      nginx 
nginx.x86_64                      1:1.10.1-1.el7.ngx                      nginx 
nginx.x86_64                      1:1.10.2-1.el7                          epel  
nginx.x86_64                      1:1.10.2-1.el7.ngx                      nginx 
nginx.x86_64                      1:1.10.3-1.el7.ngx                      nginx 
nginx.x86_64                      1:1.12.0-1.el7.ngx                      nginx 
nginx.x86_64                      1:1.12.1-1.el7.ngx                      nginx 
			
			

7.2.5. search

yum search mysql
			

7.2.6. update / upgrade

check update

			
[root@development ~]# yum check-update
[root@development ~]# yum -y update
			
			

upgrade

# yum upgrade
			

7.2.7. remove

#yum remove httpd
			

7.2.8. installed

# yum list installed
			

7.2.9. group

7.2.9.1. grouplist

[root@localhost ~]#  yum grouplist
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * addons: mirrors.163.com
 * base: mirrors.163.com
 * extras: mirrors.163.com
 * updates: mirrors.163.com
Installed Groups:
   Administration Tools
   Development Libraries
   Dialup Networking Support
   Editors
   Mail Server
   Network Servers
   Office/Productivity
   Server Configuration Tools
   System Tools
   Text-based Internet
   Web Server
   Yum Utilities
Available Groups:
   Authoring and Publishing
   Base
   Beagle
   Cluster Storage
   Clustering
   DNS Name Server
   Development Tools
   Emacs
   Engineering and Scientific
   FTP Server
   FreeNX and NX
   GNOME Desktop Environment
   GNOME Software Development
   Games and Entertainment
   Graphical Internet
   Graphics
   Horde
   Java
   Java Development
   KDE (K Desktop Environment)
   KDE Software Development
   KVM
   Legacy Network Server
   Legacy Software Development
   Legacy Software Support
   Mono
   MySQL Database
   News Server
   OpenFabrics Enterprise Distribution
   PostgreSQL Database
   Printing Support
   Ruby
   Sound and Video
   Tomboy
   Virtualization
   Windows File Server
   X Software Development
   X Window System
   XFCE-4.4
Done

				

7.2.9.2. groupinfo

# yum groupinfo "Server Configuration Tools"
Loaded plugins: fastestmirror
Setting up Group Process
Loading mirror speeds from cached hostfile
 * addons: centos.ustc.edu.cn
 * base: centos.ustc.edu.cn
 * extras: centos.ustc.edu.cn
 * updates: centos.ustc.edu.cn

Group: Server Configuration Tools
 Description: This group contains all of CentOS's custom server configuration tools.
 Default Packages:
   system-config-httpd
   system-config-nfs
   system-config-printer-gui
   system-config-samba
   system-config-securitylevel
   system-config-services
 Optional Packages:
   system-config-bind
   system-config-boot
   system-switch-mail-gnome
				

7.2.9.3. groupinstall

#yum groupinstall 'X Window System'  -y

安装GNOME桌面环境
#yum groupinstall  'GNOME Desktop Environment' -y

安装KDE桌面环境
#yum groupinstall 'KDE (K Desktop Environment)' -y
				

7.2.9.4. groupremove

卸载GNOME桌面环境
#yum groupremove "GNOME Desktop Environment"

卸载KDE桌面环境
#yum groupremove "KDE (K Desktop Environment)"
				
yum groupremove "GNOME Desktop Environment" "Games and Entertainment" "Graphical Internet" "Graphics" "Office/Productivity" "Printing Support" "Sound and Video" "Web Server" "X Window System"
				

7.2.10. 查看包的依赖关系

# yum deplist libcurl
			

7.2.11. provides / whatprovides

查询pg_config命令在那一个包中

# yum provides "*/pg_config"
			
# yum provides "*/libpq-fe.h"
			
# yum whatprovides mysql_config			
		





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
关系型数据库 MySQL Linux
|
14天前
|
Linux C语言
linux yum安装ffmpeg 图文详解
linux yum安装ffmpeg 图文详解
34 0
|
14天前
|
Linux
linux yum 安装rar和unrar
linux yum 安装rar和unrar
47 0
|
5月前
|
Linux
解决CentOS yum安装Mysql8提示“公钥尚未安装”或“密钥已安装,但是不适用于此软件包”的问题
解决CentOS yum安装Mysql8提示“公钥尚未安装”或“密钥已安装,但是不适用于此软件包”的问题
1385 0
|
18小时前
|
Linux
centos 6.5安装yum
centos 6.5安装yum
5 0
|
2天前
|
存储 Linux 网络安全
centos7使用yum网络安装
这些是使用Yum进行网络安装的基本步骤。根据你的需求,你可以重复步骤3和4来安装其他软件包。请注意,执行Yum操作需要root或具有sudo权限的用户。
12 1
|
5天前
|
应用服务中间件 nginx
yum 安装报错 No package nginx available Error:Nothing to do
yum 安装报错 No package nginx available Error:Nothing to do
16 1
|
14天前
|
关系型数据库 MySQL Linux
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
CentOS 7 下使用yum安装MySQL5.7.20 最简单 图文详解
68 0
|
26天前
|
Linux
Linux: yum查看、安装、删除软件包
Linux: yum查看、安装、删除软件包
30 0