[Linux] software installation and management-rpm, yum

Source: Internet
Author: User
We mentioned earlier that software on Linux can be installed by using the Tarball method, but it is too troublesome to download, compile, and install the software every time? Is there a class & amp; 20284; in windows, if the vendor compiles the software, we can directly install the software? The answer is yes.

We mentioned earlier that software on Linux can be installed by using the Tarball method, but it is too troublesome to download, compile, and install the software every time? Is there any vendor that compiles the software like windows? can we install the software directly? The answer is yes. this is what we will talk about today: rpm and yum.

On Linux, there are two mainstream software management methods:


Since Centos adopts the first one, only RPM and YUM are introduced here.

What is RPM and SRPMRPM? the full name is RedHat Package Manager. its biggest feature is to compile the software and record the dependent software in the RPM installation Package. when installing the RPM installation Package, if the dependency conditions are met, install the tool. Otherwise, the tool cannot be installed. Although RPM is convenient, it requires that your host environment be the same as the host environment where the installation package was originally created. Therefore, with SPRM, that is, Source RPM, the RPM installation package also contains the Source code. Usually, when a software is released, the RPM and SRPM of the software will be released at the same time. if there is no RPM suitable for our operating system and hardware, we can also modify the parameter settings file in SRPM and re-compile the file to generate an RPM file suitable for our Linux environment.

The software information installed on the RPM command is recorded in the database files in the/var/lib/rpm Directory. Therefore, this directory is very important and never be deleted. RPM installation:
Rpm-ivh package_name-i: install meaning-v: View more detailed installation information screen-h: Display the installation progress in the installation information bar Example 1: install a software: rpm-ivh rp-pppoe-3.5-32.1.i386.rpm Example 2: install multiple software: rpm-ivh. i386.rpm B. i386.rpm *. rpm Example 3: directly installed by the network: rpm-ivh http://website.name/path/pkgname.rpm
RPM upgrade and update:The upgrading and updating of RPM is very simple, similar to the installation command:
RPM query:To check whether mysql is installed, run the following command:
# rpm -qa mysqlmysql-5.0.95-5.el5_9
It actually queries the database files under the/var/lib/rpm directory. RPM uninstall:
rpm -e pam
Note that the RPM uninstall process must be detached from the top layer. if you delete python, all the software dependent on python will be unavailable, this is disastrous, and I have made such mistakes. Fortunately, the above rpm-e command will not be uninstalled if the software to be uninstalled is also dependent on other software.
YUM-online installation and upgrade: when you use RPM to install the software, the software you want to install depends on another software, and the software depends on other software, and so on, it will be annoying to go down such a layer. YUM is used to solve this problem. it installs all the dependent software in one breath and is online. YUM query:
Example 1: search for mysql-related software yum search mysql on The yum server Example 2: list the functions of the mysql software yum info mysql Example 3: list all the software yum list on the yum server Example 4: list the software yum list updates available for local upgrade
YUM installation/upgradeThe yum installation and upgrade are very simple. the command is as follows. it automatically solves the dependency between the software and is very convenient.
Yum [install | updates] Software
YUM deletion
Yum [remove] Software
Be sure to note that yum will delete all dependent software together. never delete basic software. remember to remember!

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.