Package management: RPM Yum Summary

Source: Internet
Author: User

Package management: RPM Yum Summary

I. Introduction to RPM

RPM is an abbreviation for RPM Package Manager, which has a Redhat logo, but its original design concept is open and now includes OpenLinux, S.U.S.E and Turbo Linux distributions such as Linux are used and are recognized as industry standards.


Second, the use of RPM package management

1, can install, delete, upgrade and management software, of course, also support online installation and upgrade software;

2, through the RPM package management can know what the package contains files, you can also know the system of a file belonging to which package;

3, can be in the query system of the package is installed and its version;

4, as a developer can package their own program for the RPM package release;

5, Package signing GPG and MD5 import, verification and signature release

6. Check the dependencies to see if there are any packages that disrupt the system due to incompatibility;


Third, the use of RPM rights

RPM Software Installation, deletion, update only the root permission to use, for the query function of any user can operate, if the normal user has the installation directory permissions, can also be installed.


Four, RPM Package management query function

Command format

RPM {-q|--query} [select-options] [query-options]

The RPM query function is extremely powerful and is one of the most important functions; For a few common examples, more specific, please refer to #man rpm

1, the system has installed the software query;

1) Query the system has installed software;

Syntax: RPM-Q software name

Example: [[email protected] beinan]# rpm-q Gaim gaim-1.3.0-1.fc4

-Q is--query, this command indicates whether the system has Gaim installed, and if there is information output. If there is no installation will output Gaim will not install the information;

To view all installed packages in the system, add the-a parameter;

[[email protected] rpms]# RPM-QA if Page view, plus a pipeline | and more command;

[Email protected] rpms]# Rpm-qa |more

Look for a software in all installed packages, such as Gaim, which can be extracted with grep;

[[email protected] rpms]# RPM-QA |grep gaim results are the same as rpm-q gaim output;

2) query which package a file is already installed in;

Syntax RPM-QF filename NOTE: The absolute path where the file name is located to indicate

Example: [[email protected] rpms]# RPM-QF/USR/ETC/TEXT1

3) query where the installed packages are installed

Syntax: RPM-QL [software name] or rpm RPMQUERY-QL [software name]

Example: [[email protected] rpms]# RPM-QL Lynx

[Email protected] rpms]# RPMQUERY-QL Lynx

4) query information for an installed package

Syntax format: RPM-QI software name

Example: [[email protected] rpms]# Rpm-qi Lynx

5) Check the configuration file of the installed software;

Syntax format: RPM-QC software name

Example: [[email protected] rpms]# RPM-QC Lynx

6) View a document where the software has been installed:

Syntax format: RPM-QD software name

Example: [[email protected] rpms]# RPM-QD Lynx

7) Check the packages and files on which the software is installed;

Syntax format: RPM-QR software name

Example: [[email protected] beinan]# RPM-QR Rpm-python

Query the summary of installed software: For a package has been installed, we can combine a series of parameters together;

e.g. Rpm-qil;

[Email protected] rpms]# Rpm-qil Lynx

2. For non-installed packages, view:

The prerequisite for viewing is that you have a. rpm file, which means a view of the existing software file.rpm;

1) To view the use of a software package, version and other information;

Syntax: Rpm-qpi file.rpm

Example: [[email protected] rpms]# Rpm-qpi lynx-2.8.5-23.i386.rpm

2) View the files contained in a package;

Syntax: RPM-QPL file.rpm

Example: [[email protected] rpms]# RPM-QPL lynx-2.8.5-23.i386.rpm

3) View the location of the package's documentation;

Syntax: RPM-QPD file.rpm

Example: [[email protected] rpms]# RPM-QPD lynx-2.8.5-23.i386.rpm

4) View the configuration file of a package;

Syntax: RPM-QPC file.rpm

Example: [[email protected] rpms]# RPM-QPC lynx-2.8.5-23.i386.rpm


v. Introduction to Yum

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 RPM packages from specified servers and install them automatically handles dependency relationships and installs all dependent packages at once, without the hassle of downloading and installing them over and over again. Yum provides commands for finding, installing, and deleting one, a group, or even all of the packages.


Vi. Configuration of Yum

1. Establishing a Yum source

(1) put the RPM package you want to provide unified into a directory, the directory as the source address.

(2) To establish the download source data of Yum in this directory, it can be established by Createrepo this software (need to install this soft piece)

Command: createrepo/var/ftp/pub/

This folder is the home folder of the file after the FTP server has been established, of course, only after the FTP service is turned on to access it from the network.

2. Set Yum (set Yum to include setting two parts)

(1) Setting the content of the Yum software itself

Set the yum.conf file to be stored in the/etc/directory

The specific setting method can be queried by man yum.conf

(2) Yum Source Definition file

This file is more important and is stored in the/etc/yum.repos.d/directory. The file name can be created by itself, but the suffix must be repo

The editing syntax for this file is:

[TESTRHCE]

Name=study Linux for Rhce

baseurl=ftp://192.168.1.1/pub/

Enable=1

Gpgcheck=1

Two sources can be defined in the same file

After editing this file, you can use Yum to download the RPM packages that are included in the update source.

3. How to use Yum

(1) Yum cache cleanup Yum Clean all this command clears all content in the/var/cache/yum/directory if Yum runs abnormally with this command.

(2) List of installed packages Yum List installed

(3) List Yum package Group Yum Grouplist

(4) Get information on RPM package Yum info Tigervnc with Rpm-qi

(5) Search RPM package Yum search Tigervnc

(6) Install RPM package Yum install Tigervnc

(7) Unload RPM package Yum Remove Tigervnc


VII. command format

The order form of Yum is generally as follows:

Yum [options] [command] [package ...]

Where [options] is optional, [command] is the action to be taken, [package ...] Is the object of the operation.

Common options:

H (Help),

-Y (when the installation process prompts you to select all "Yes")

-Q (does not display the installation process)


Eight, 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 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 information Yum Search string

Find 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 clean all (= Yum clean packages; yum clean oldheaders)

Clear the cache directory of the package and the old headers


This article is from the "11253644" blog, please be sure to keep this source http://11263644.blog.51cto.com/11253644/1757232

Package management: RPM Yum Summary

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.