Home | 簡體中文 | 繁體中文 | 雜文 | 打賞(Donations) | ITEYE 博客 | OSChina 博客 | Facebook | Linkedin | 知乎專欄 | Search | Email

7.2. yum - Yellowdog Updater Modified

7.2.1. install

yum -y install package
			

reinstall

yum -y reinstall package
			

7.2.2. localinstall

yum localinstall 可以代替 rpm -ivh 並且會自己安裝依賴包

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

7.2.3. 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
			

7.2.4. search

yum search mysql
			

7.2.5. update / upgrade

check update

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

upgrade

# yum upgrade
			

7.2.6. remove

#yum remove httpd
			

7.2.7. installed

# yum list installed
			

7.2.8. group

7.2.8.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.8.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.8.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.8.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.9. 查看包的依賴關係

# yum deplist libcurl
			

7.2.10. provides / whatprovides

查詢pg_config命令在那一個包中

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

7.2.11. 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啟用