CentOS software package management-YUM

Source: Internet
Author: User
Tags yum repolist

YUM (all called Yellow dog Updater, Modified) is a Shell front-end Software Package Manager in the RHEL operating system. Based on the RPM package management, You can automatically download and install the RPM package from the specified server. The dependency relationship can be automatically handled and all dependent software packages can be installed at one time without frequent downloading and installation.

-------------------------------------------------------------------------------
Configure the YUM Software Package Repository:

The YUM Package Manager depends on the yum repository to perform operations on software packages. The yum repository configuration can be implemented by editing the yum configuration file (/etc/yum. conf,/etc/yum. repos. d/* repo. In general, the main configuration file of yum is in/etc/yum. conf, and/etc/yum. repos. d/*. repo is the configuration file of each software warehouse.

/Etc/yum. conf:

/Etc/yum. repos. d/media. repo:


--------------------------------------------------------------------------------

Install, upgrade, and delete software packages in YUM:
# Yum {install | update | remove} PACKAGE_NAME...

Example 1:
Install the software package:

Example 2:
Software Package upgrade:

Note: yum update follows the software package name, which is used to detect only updates of specified software.

Note: The yum update command checks for updates to all installed software on the system.


Example 3:
Delete a software package:

--------------------------------------------------------------------------------
Install, upgrade, and delete Software Package groups in YUM:

# Yum {groupinstall | groupupdate | groupremove} PACKAGEGROUP_NAME...
// Install and print the service package Group
// If there is a space between the group names, it must be enclosed by quotation marks.
[Root @ localhost ~] # Yum groupinstall "Print Server"
// Upgrade and print the service package Group
[Root @ localhost ~] # Yum groupupdate "Print Server"
// Delete the Print Service Group
[Root @ localhost ~] # Yum groupremove "Print Server"


--------------------------------------------------------------------------------
Other YUM options:
# Yum list [all | installed | updates | available]
# Yum grouplist


// List all software packages
// All can be omitted
[Root @ localhost ~] # Yum list all
[Root @ localhost ~] # Yum list
// List all installed software packages
[Root @ localhost ~] # Yum list installed
// List all software packages to be updated
[Root @ localhost ~] # Yum list updates
// List all available software packages
[Root @ localhost ~] # Yum list available
// List all Groups
[Root @ localhost ~] # Yum grouplist

 

# Yum repolist [all | enabled | disabled]
// Yum repolist all enabled software repositories are displayed by default.
[Root @ localhost ~] # Yum repolist
// You can also manually specify the enabled Option
[Root @ localhost ~] # Yum repolist enabled
// List all disabled software Repositories
[Root @ localhost ~] # Yum repolist disabled
// List all software Repositories
[Root @ localhost ~] # Yum repolist all

 

# Yum info [all | installed | updates | available | PACKAGE_NAME]
// Display the lftp package information
[Root @ localhost ~] # Yum info lftp
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* Base: mirrors.hustunique.com
* Extras: mirrors.hustunique.com
* Updates: mirrors.hustunique.com
Installed Packages
Name: lftp
Arch: x86_64
Version: 4.0.9
Release: 1. el6_5.1
Size: 2.5 M
Repo: installed
From repo: updates
Summary: A sophisticated file transfer program
URL: http://lftp.yar.ru/
License: GPLv3 +
Description: LFTP is a sophisticated ftp/http file transfer program. Like bash, it has job
: Control and uses the readline library for input. It has bookmarks, built-in
: Grouping, and can transfer several files in parallel. It is designed
: Reliability in mind.
Available Packages
Name: lftp
Arch: i686
Version: 4.0.9
Release: 1. el6_5.1
Size: 735 k
Repo: updates
Summary: A sophisticated file transfer program
URL: http://lftp.yar.ru/
License: GPLv3 +
Description: LFTP is a sophisticated ftp/http file transfer program. Like bash, it has job
: Control and uses the readline library for input. It has bookmarks, built-in
: Grouping, and can transfer several files in parallel. It is designed
: Reliability in mind.
// Other options can display information of all installed, updates, available, and all software packages

 

# Yum groupinfo "PACKAGE_GROUP_NAME"

// Display the "Print Server" package group information
[Root @ localhost ~] # Yum groupinfo "Print Server"
Loaded plugins: fastestmirror, security
Setting up Group Process
Loading mirror speeds from cached hostfile
* Base: ftp.stu.edu.tw
* Extras: mirrors.hustunique.com
* Updates: mirrors.hustunique.com
Group: Print Server
Description: Allows the system to act as a print server. // Description
Mandatory Packages: // required package
Cups
Printer-filters
Default Packages: // The Default package
Foomatic-db-PPPs
Gutenprint
Gutenprint-cups
Hpijs
Paps

 

# Yum clean [packages | metadata | expire-cache | rpmdb | plugins | all]
# Yum makecache

 

// Clear the Package Buffer
[Root @ localhost ~] # Yum clean packages
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
0 package files removed
// Clear the metadata buffer of the software package
[Root @ localhost ~] # Yum clean metadata
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
13 metadata files removed
9 sqlite files removed
0 metadata files removed
// Clear the expiration Buffer
[Root @ localhost ~] # Yum clean expire-cache
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
0 metadata files removed
// Clear the rpmdb Database
[Root @ localhost ~] # Yum clean rpmdb
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
4 rpmdb files removed
// Clear the patch Buffer
[Root @ localhost ~] # Yum clean plugins
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
// Clear all Buffers
[Root @ localhost ~] # Yum clean all
Loaded plugins: fastestmirror, security
Cleaning repos: base extras updates
Cleaning up Everything
// Rebuild Buffer
[Root @ localhost ~] # Yum makecache
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* Base: mirrors.163.com
* Extras: mirrors.163.com
* Updates: mirrors.163.com
Base | 3.7 kB
Base/group_gz | 220 kB
Base/filelists_db | 5.9 MB
Base/primary_db | 4.4 MB
Base/other_db | 2.8 MB
Extras | 3.4 kB: 00
Extras/filelists_db | 11 kB: 00
Extras/prestodelta | 907 B 00: 00
Extras/primary_db | 19 kB: 00
Extras/other_db | 5.8 kB: 00
Updates | 3.4 kB: 00
Updates/filelists_db | 1.5 MB
Updates/prestodelta | 156 kB: 01
Updates/primary_db | 2.1 MB
Updates/other_db | 244 kB
Metadata Cache Created

 

# Yum check-update
# Yum update [PACKAGE_NAME]...
// Check whether the software package installed in the system is updated.
[Root @ localhost ~] # Yum check-update
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
* Base: mirrors.163.com
* Extras: mirrors.163.com
* Updates: mirrors.163.com
Initscripts. x86_64 9.03.40-2. el6.CentOS. 1 updates
Libtiff. x86_64 3.9.4-10. el6_5 updates
Phonon-backend-gstreamer.x86_64. 6.2-28. el6_5 updates
Postfix. x86_64. 6.6-6. el6_5 updates
Psmisc. x86_64 22.6-19. el6_5 updates
Upstart. x86_64 0.6.5-13. el6_5.2 updates
// Update the software package "postfix"
[Root @ localhost ~] # Yum update postfix
// Update all updatable software packages
[Root @ localhost ~] # Yum update

 

# Yum reinstall PACKAGE_NAME...

// Reinstall the Software Package
[Root @ localhost ~] # Yum reinstall lftp
Loaded plugins: fastestmirror, security
Setting up Reinstall Process
Loading mirror speeds from cached hostfile
* Base: mirrors.163.com
* Extras: mirrors.163.com
* Updates: mirrors.163.com
Resolving Dependencies
--> Running transaction check
---> Package lftp. x86_64. 0.9-1. el6_5.1 will be reinstalled
--> Finished Dependency Resolution

 

# Yum history
// View previous yum operation history
[Root @ localhost ~] # Yum history
Loaded plugins: fastestmirror, security
ID | Login user | Date and time | Action (s) | Altered
-------------------------------------------------------------------------------
11 | root <root> | Install | 30
10 | root <root> | Install | 1
9 | root <root> | Erase | 1
8 | root <root> | Install | 1
7 | root <root> | Erase | 1 EE
6 | root <root> | Update | 1 <
5 | root <root> | Install | 1> <
4 | root <root> | Install | 8>
3 | root <root> | I, U | 115
2 | root <root> | I, U | 54
1 | System <unset> | Install | 621
History list

Recommended reading:

RedHat Linux local yum source configuration

RedHat 6.2 modify yum source in Linux use CentOS source for free

Configure the epel yum Source

Redhat local yum source configuration

Description of yum configuration file

Install yum in RedHat 6.1)

YUM installation and cleaning

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.