Common usage of yum commands in linux

Source: Internet
Author: User

Yum (all called Yellow dog Updater, Modified) is a Shell front-end Package Manager in Fedora, RedHat, and SUSE. Based on RPM package management, You can automatically download and install the RPM package from the specified server, automatically handle dependencies, and install all dependent software packages at a time, you do not need to download and install it repeatedly. Yum provides commands for searching, installing, and deleting one or more software packages.

Yum-y install package name (* supported): automatically selects y, fully automated
Yum install package name (* supported): manually select y or n
Yum remove package name (not supported *)
Rpm-ivh package name (supported *): Install the rpm package
Rpm-e package name (not supported *): uninstall the rpm package

The following are some packages I have installed and sorted out at work:

When using SecureCRT, you can use rz and sz to upload and download files and install rz and sz
Yum-y install lrzsz

Download files
Sz xxx.tar.gz

Upload files
Rz

Upgrade common library files

The Code is as follows: Copy code
Yum-y install gcc-c ++ autoconf
Yum-y install libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel curl-devel ncurses-devel


Install the make command

The Code is as follows: Copy code
Yum-y install make

Install vi

The Code is as follows: Copy code
Yum-y install vim-enhanced

Run vim to add a link.

The Code is as follows: Copy code
Ln-s/usr/bin/vim/bin/vi

Install locate

The Code is as follows: Copy code
Yum-y install mlocate

Install patch

The Code is as follows: Copy code
Yum-y install patch

Synchronization time

The Code is as follows: Copy code
Yum install-y ntp
Ntpdate ntp. api. bz

Where is the yum file installed?
View/etc/yum. conf
There is a cachedir setting. The default value is/var/cache/yum.
By default, the downloaded files are not saved and will be automatically deleted after installation.
Modify keepcache and change 0 to 1.
That is:

The Code is as follows: Copy code
Cachedir =/var/cache/yum
Keepcache = 1

The command Format of yum is generally as follows: yum [options] [command] [package...]
[Options] are optional, including-h (HELP) and-y (when the installation prompt is "yes "), -q (the installation process is not displayed. [Command] is the operation object. [package...] is the operation object.

Some common Commands include:

The fastest image plugin for automatic search: yum install yum-fastestmirror
Install the yum graphic window plug-in: yum install yumex
View the list of possible batch installations: yum grouplist

1 Installation

The Code is as follows: Copy code
Install yum install all
Yum install package1 install the specified installation package1
Yum groupinsall group1 installer group group1

2. update and upgrade

The Code is as follows: Copy code
Yum update all updates
Yum update package1 update specified package1 package1
Yum check-update check updatable programs
Yum upgrade package1 upgrade specified package1 package1
Yum groupupdate group1 Upgrade Program Group group1

3 search and display

The Code is as follows: Copy code
Yum info package1: package1
Yum list displays all installed and installable packages
Yum list package1 displays package1 installation of the specified package
Yum groupinfo group1 display group1 information of the Program Group yum search string find the installation package based on the keyword string

4. delete a program

The Code is as follows: Copy code
Yum remove & #124; erase package1 Delete package1
Yum groupremove group1 Delete group1
Yum deplist package1 check package1 Dependencies

5. Clear Cache

The Code is as follows: Copy code
Yum clean packages clear 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
Yum clean, yum clean all (= yum clean packages; yum clean oldheaders) Clear the packages and old headers in the cache directory

I have summarized some usage methods of the yum function.

The Code is as follows: Copy code

Yum check-update // check all software packages that can be updated

 

Yum update // download all software packages installed in the update system

 

Yum upgrade // a large-scale version upgrade. Unlike yum update, the old obsolete package is also upgraded.

 

Yum install <packages> // install the new software package

 

Yum update <packages> // update the specified Software Package

 

Yum remove <packages> // uninstall the specified Software Package

 

Yum groupinstall <groupnames> // install the software package in the specified Software Group

 

Yum groupupdate <groupnames> // update the software package in the specified Software Group

 

Yum groupremove <groupnames> // uninstall the software package in the specified Software Group

 

Yum grouplist // view installed and available software GROUPS IN THE SYSTEM

 

Yum list // list all rpm packages that can be installed, updated, and installed in the resource library

 

Yum list <regex> // list the rpm packages that match the regular expression in the resource library that can be installed, updated, and installed.

 

Yum list available // list all the rpm packages that can be installed in the resource library

 

Yum list available <regex> // list all the rpm packages that can be installed that match the regular expression in the resource library

 

Yum list updates // list all the rpm packages that can be updated in the resource library

 

Yum list updates <regex> // lists all updatable rpm packages that match the regular expression in the resource library.

 

Yum list installed // list all installed rpm packages in the resource library

 

Yum list installed <regex> // lists all installed rpm packages that match the regular expression in the resource library.

 

Yum list extras // list rpm packages installed but not included in the resource library

 

Yum list extras <regex> // lists the installed rpm packages that match the regular expression but are not included in the resource library.

 

Yum list recent // list packages recently added to the resource library

 

Yum search <regex>/* checks the names, descriptions, summary, and listed maintainers of all available software and searches for and Regular Expressions

 

Value of expression matching */

 

Yum provides <regex> // checks the files contained in the software package and the functions provided by the software to find the values that match the regular expression.

 

Yum clean headers // clear the cache rpm header file

 

Yum clean packages // clear the rpm package files in the cache

 

Yum clean all // clear cache rpm header files and package files

 

Yum deplist <packages> // displays the dependency information of the software package.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.