Software installation and uninstallation under Linux: RPM and Yum Tools

Source: Internet
Author: User

First, RPM tools

The RPM command is a management tool for RPM packages. RPM was originally a red Hat Linux distribution program designed to manage Linux packages and is popular because it follows GPL rules and is powerful and convenient. is gradually being adopted by other distributions. The advent of RPM suite management means that Linux is easy to install and upgrade, which indirectly increases the applicability of Linux.

RPM Command Syntax:
# rpm [选项] [参数]

Options include:

-A: query all packages;
-b< Completion Phase >< Kit file >+ or-t < finish phase >< Kit file >+: Set the completion phase of the packaging kit and specify the file name of the kit file;
-C: Only configure configuration files are listed, this parameter should be used with "-l" parameter;
-D: Only text files are listed, this parameter should be used with "-l" parameter;
-e< Kit File > or--erase< kit;: delete the specified package;
-f< file >+: Query The suite that owns the specified file;
-H or--hash: The tag is listed when the kit is installed;
-I: Displays information about the kit;
-i< Kit File > or--install< kit;: Install the specified kit file;
-L: Displays a list of files for the suite;
-p< Kit File >+: Query the specified RPM kit file;
-Q: Using the inquiry mode, the rpm instruction will ask the user first when any problems are encountered;
-r: Displays the correlation information of the kit;
-S: Display the file status, this parameter should be used with "-l" parameter;
-u< Kit File > or--upgrade< kit;: Upgrade the specified package file;
-V: Displays the instruction execution process;
-VV: Shows the instruction execution process in detail, which is convenient for troubleshooting.

Parameters:

Package: Specifies the RPM package to manipulate.

Before doing a small experiment, mount the next CD-ROM, the suffix name under packages. RPM is the RPM installation package

Mount/dev/cdrom/mnt

And then execute

Ls/mnt/packages

List RPM installation packages, which are part of the interception

The general format of the RPM package is:

name-version-arch.rpm
name-version-arch.src.rpm

1.name, such as: Xvattr, is the name of the software.
2.version, such as: 1.3, is the version number of the software. The format of the version number is typically "major version number. minor version number.". 27, is the release version number, indicating that this RPM package is generated by the first several times.
3.arch, such as: i386, represents the applicable hardware platform for the package, the current RPM supported platforms are: i386, i586, i686, SPARC, and Alpha.
4.rpm or. src.rpm, is the suffix of the RPM package type,. RPM is a compiled binary package that can be installed directly with the RPM command ;. src.rpm is the source code package, you need to install the source package to generate the source, and build the. RPM package to the source, you can install the RPM package.
Note:
El*: Represents the Publisher version of this package, EL7 indicates that the package is used under Rhel 7.x/centos 7.x.
Devel: Indicates that this RPM package is the software development package.
Noarch: Such packages can be installed on any platform, without the need for a specific hardware platform. Can be run on any hardware platform.

Instance

1. Install RPM Package:RPM-IVH Package Name

2. Upgrade RPM Package:RPM-UVH Package Name

3. Unload RPM Package:RPM-E Package Name

There is a difference between the filename and the installation at the time of uninstallation, the installation is to use an existing file as a parameter, and only the package name when uninstalling.
4, query whether a package has been installed:RPM-Q package Name

Query the system for installed RPM packages:Rpm-qa. To list the first 10 installed RPM packages

5. Get information about an installed RPM package:RPM-QI Package Name

6. List A RPM package installation file:RPM-QL package Name

7. List which rpm package a file belongsto: the absolute path to the Rpm-qf file

Here's another special use:



Second, yum Tools

Yum (Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and Redhat as well as in SuSE. Based on RPM package management, the ability to automatically download RPM packages from specified servers and install them, automatically handle dependency relationships, and install all dependent software packages at once, without the hassle of downloading and installing them over and over again. 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.
This tool is much more useful than the RPM tool, if you are using a Linux system that supports Yum. Yum's biggest advantage is that it can be networked to download the required RPM packages, and then install them automatically, and in this project, if the RPM package to be installed is dependent, Yum will help you to fix the dependencies and install all RPM packages in turn.
Yum command syntax:

Yum [options] [parameters] [RPM package name]

Options (optional):

-H: Displays help information;
-Y: Answer "yes" to all questions;
-C: Specify the configuration file;
-Q: Quiet mode;
-V: Verbose mode;
-D: Set debug Level (0-10);
-E: Set error level (0-10);
-R: Sets the maximum wait time for Yum to process a command;
-C: Run completely from the cache without downloading or updating any header files.

Parameters:

Install: Installing the RPM software package;
Update: Updated RPM software package;
Check-update: Check if there is an updated RPM package available;
Remove: Deletes the specified RPM software package;
List: Displays information about the package;
Search: Check the software package for information;
Info: Displays descriptive information and summary information for the specified RPM package;
Clean: Cleans up the stale cache of Yum;
Shell: Enter the Yum shell prompt;
RESOLVEDEP: Shows the dependencies of RPM packages;
Localinstall: Install the local RPM software package;
Localupdate: Display local RPM package for update;
Deplist: Displays all dependencies of the RPM package.

Instance:

1. List all available RPM packages:Yum list

2, search RPM package:Yum Search [package keyword], in order to more accurate search can use grep to filter

3, installation RPM package:yum install [-y] [RPM package name], if the no-y option, will be in the manner of interaction with the user installation, the first is to list the RPM package needs to install information, and then asked whether the user needs to install, enter y installation, input n is not installed. This is too cumbersome, so add the-y option directly. If a package already exists, it is checked and updated.

4. Uninstall RPM Package:yum Remove [-y] [RPM package name], uninstall and install, you can also directly add the "-y" option to omit the user interaction steps. Here to remind, uninstall a RPM package must see clearly, do not even other important RPM package to uninstall, so as not to affect the normal business.

5. Upgrade RPM Package: Yum Update [-y] [RPM package]



Third, use the local CD to make a Yum source
Sometimes your Linux system can not be networked, of course, it is not easy to use the network of Yum source, this time you will need to use the Linux system CD to create a Yum source. The steps are as follows:
1. Mount the disc:

Mount/dev/cdrom/mnt

2. Remove all repo files from the/ETC/YUM.REPOS.D directory (before deleting):

Cp-r/etc/yum.repos.d/etc/yum.repos.d_bak//Backup
# rm -rf /etc/yum.repos.d/*                 //删除yum.repos.d目录下的所有文件

3. Create Dvd.repo file:

Vi/etc/yum.repos.d/dvd.repo//Add the following content
[dvd]name=install dvdbaseurl=file:///mntenabled=1gpgcheck=0

4. Save and exit, refresh repos, generate cache:

Yum Makecache

After that, you can install the RPM package.

Software installation and uninstallation under Linux: RPM and Yum Tools

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.