Linux Yum Software Management

Source: Internet
Author: User

Yum (full name Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and Redhat and SuSE. Based on RPM package management, the ability to automatically download the RPM package from the specified server and install, can automatically handle dependency relationships, and install all dependent software packages at once, without the tedious download and installation. Yum provides commands to find, install, and delete one, a group, or even all of the packages, and the commands are concise and well-remembered.

Yum's command form is generally as follows: Yum [options] [command] [package ...]
The options are optional, including-H (Help),-y (when the installation process prompts you to select all "Yes"),-Q (does not show the installation process), and so on. [command] for the action you want to take, [package ...] Is the object of the operation.

Summarizes some of the commonly used commands include:

Automatically search for the fastest image plugin: Yum install Yum-fastestmirror
Installing the Yum graphics window plugin: Yum install Yumex
View a list of possible bulk installations: Yum Grouplist

1 installation
Yum Install all installed
Yum Install Package1 installs the specified installation package Package1
Yum groupinsall group1 Installer group group1

2 Updates and Upgrades
Yum Update all Updates
Yum Update Package1 updates the specified package Package1
Yum check-update Check for updatable programs
Yum Upgrade Package1 upgrade specified package Package1
Yum groupupdate group1 upgrade program group Group1

3 Finding and displaying
Yum Info package1 Displays installation package information Package1
Yum list shows all packages that are installed and can be installed
Yum List Package1 shows the installation of the specified package Package1
Yum groupinfo group1 Display program group group1 info Yum Search string finds the installation package based on the keyword string

4 Removing programs
Yum Remove & #124; Erase Package1 Remove Package Package1
Yum groupremove group1 Remove a program group group1
Yum deplist package1 Viewing program package1 dependencies

5 Clearing the Cache
Yum Clean packages clears the package from the cache directory
Yum clean headers clears the headers in the cache directory
Yum clean oldheaders Clear Cache directory for old headers
Yum Clean, yum clear all (= Yum packages; Yum oldheaders) clears the cache directory of packages and the old headers

Sometimes we have a package installed, but we do not know its purpose, we can use Yum Info packagename This command to get information.
1. Find Packages using Yum
Command: Yum Search
2. List all packages that can be installed
Command: Yum list
3. List all the packages that can be updated
Command: Yum list updates
4. List all installed packages
Command: Yum List installed
5. List all packages installed but not in Yum Repository
Command: Yum list extras
6. List the specified packages
Command: Yum list 7. Using Yum to obtain package information
Command: Yum info 8. Listing information for all packages
Command: Yum Info
9. List all updatable package information
Command: Yum info updates
10. List all installed package information
Command: Yum info installed
11. List all packages installed but not in Yum Repository
Command: Yum info extras
12. List which files the package provides
Command: Yum provides

5. Clear Yum Cache
Yum stores the downloaded packages and headers in the cache without deleting them automatically. If we feel that they are taking up disk space, you can use the Yum Clean command to clear it, and more precisely use Yum clean headers to clear Header,yum clean packages clear the downloaded RPM package, yum clean all clears all
1. Clear the packages under the cache directory (/var/cache/yum)
Order: Yum Clean Packages

2. Clear the headers in the cache directory (/var/cache/yum)

Order: Yum Clean headers

3. Clear the old headers from the cache directory (/var/cache/yum)

Order: Yum Clean oldheaders

4. Clear the Cache directory (/var/cache/yum) package and the old headers

Command: Yum clean, yum clean all (= Yum clean packages; yum clean oldheaders)

System Update (update all RPM packages that can be upgraded, including kernel)
#yum-y Update

Perform periodic system updates daily
#chkconfig Yum on
#service Yum Start

*RPM package updates, check for updatable RPM packages
#yum Check-updat

Add Yum Source

1, Mkdir/mnt/cdrom

2 Mount/dev/cdrom/mnt/cdrom #挂着镜像, CD

3 Mkdir/home/redhat-iso

4 cp-rf/mnt/cdrom/*/home/redhat-iso #将光盘内的内容copy到某个路径下

5 Vi/etc/yum.repos.d/rhel-debuginfo.repo #编辑repo文件

Add a little bit of content:

[Rhel_6_iso]
Name=local ISO
baseurl=file:///home/redhat-iso/
Gpgcheck=1
Gpgkey=file:///home/redhat-iso/rpm-gpg-key-centos-6 #该处的gpgkey文件应该改成iso镜像中的文件名

[Base]
Name=rhel5 Server
Baseurl=ftp://172.16.0.1/pub/server
Enabled=1
Gpgcheck=0

[Base]
Name=rhel5 Server
Baseurl=file:///home/redhat-iso
Enabled=1
Gpgcheck=0

/etc/yum.repos.d

/etc/yum.conf

How to define a repo file for Yum
[REPO_ID]
Name=description
Baseurl=
ftp://
/HTTP
file:///
Enabled={1|0}
Gpgcheck={1|0}
gpgkey=

Related Article

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.