TrumanWong

yum

RPM-based package manager

Supplementary instructions

yum command is an rpm-based software package manager in Fedora, RedHat and SUSE. It allows system administrators to interactively and automatically update and manage RPM packages. It can automatically download and install RPM packages from a designated server. , can automatically handle dependencies and install all dependent software packages at once, without the need to download and install them again and again.

yum provides commands to find, install, and delete a certain, a group, or even all software packages, and the commands are concise and easy to remember.

grammar

yum(options)(parameters)

Options

-h: Display help information;
-y: Answer "yes" to all questions;
-c: Specify the configuration file;
-q: Quiet mode;
-v: verbose mode;
-d: Set debugging level (0-10);
-e: Set error level (0-10);
-R: Set the maximum waiting time for yum to process a command;
-C: Run entirely from cache without downloading or updating any header files.

Parameters

install: install rpm software package;
update: update rpm package;
check-update: Check whether there is an updated rpm package available;
remove: delete the specified rpm package;
list: displays software package information;
search: Check the information of the software package;
info: displays the description information and summary information of the specified rpm package;
clean: clean yum’s expired cache;
shell: enter the yum shell prompt;
resolvedep: displays dependencies of rpm packages;
localinstall: install local rpm software package;
localupdate: Display local rpm packages for updates;
deplist: displays all dependencies of rpm packages;
provides: Query the installation package of a certain program.

Example

Some commonly used commands include:

  • Automatically search for the fastest mirror plug-in: yum install yum-fastestmirror
  • Install yum graphics window plug-in: yum install yumex
  • View the list of possible batch installations: yum grouplist

Install

yum install #All installation
yum install package1 #Install the specified installation package package1
yum groupinsall group1 #Installer group group1

Updates and Upgrades

yum update #All update
yum update package1 #Update the specified package package1
yum check-update #Check updateable programs
yum upgrade package1 #Upgrade the specified package package1
yum groupupdate group1 #Upgrade program group group1

Find and Show

# Check if MySQL is installed
yum list installed | grep mysql
yum list installed mysql*

yum info package1 #Display installation package information package1
yum list #Display all installed and installable packages
yum list package1 #Display the installation status of the specified package package1
yum groupinfo group1 #Display program group group1 information yum search string Find the installation package based on the keyword string

Remove Program

yum remove | erase package1 #Delete package package1
yum groupremove group1 #Delete program group group1
yum deplist package1 #View the dependencies of program package1

clear cache

yum clean packages # Clear the software packages in the cache directory
yum clean headers # Clear headers in the cache directory
yum clean oldheaders # Clear old headers in the cache directory

More Examples

#yum
/etc/yum.repos.d/ # yum source configuration file
vi /etc/yum.repos.d/nginx.repo # For example: nginx yum source
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/6/$basearch/
gpgcheck=0
enabled=1

# yum mirror
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
wget https://mirror.tuna.tsinghua.edu.cn/help/centos/
yum makecache

# Add Chinese language support
LANG=C # Original language
LANG=zh_CN.utf8 # Switch to Chinese
yum groupinstall "Chinese Support" # Add Chinese language support