Linux Package Management: RPM, yum, compile and install

Source: Internet
Author: User

Rpm:

RPM Package Manager is a package manager that is used on various versions of LIUNX.


There are 10 basic modes in RPM:

They are installed, queried, verified, deleted, and so on.

Installation mode: rpm–i [installation options]

Query mode: rpm–q [query Options]

Validation mode: Rpm–v or –verify [authentication options]

Delete mode: Rpm–e

RPM Common parameters:

-Q Query

-P < package file name > Query package files

-A query all packages

-F < file list > which package the query file belongs to

-G < Group list > which packages are in the query group

--whatrequires < Feature List > query the package that requires the specified feature

--whatprovides < Feature list > querying packages that provide the specified functionality

--requires/-r what features are required to query packages

What features are provided by the--provides query package

-I display package information

-L displays a list of files that are included in the package

-D Displays a list of the description documents included in the package

-C Displays a list of configuration documents included in the package

-S displays the status of the files that the package contains

RPM Example:

1. Install a Package

# RPM-IVH


2. Upgrade a Package

# RPM-UVH [Note u must capitalize]


-I Installation

-U Lift Line installation

-H to # Displays the installation progress

-V Show additional information



3. Remove a Package

# RPM-E



4. Installation Parameters

--force Force installation Even if overwriting files belonging to other packages

--nodeps if the RPM package is installed depending on other packages, it is forced to install even if the other packages are not loaded.



5. Query whether a package is installed

# Rpm-q < RPM package name>



6. Get information about the packages that are installed

# Rpm-qi < RPM package name>



7. List what files are in the package

# RPM-QL < RPM package name>



8. List which RPM package a file on the server belongs to

# RPM-QF



9. Can synthesize several parameters to a

# Rpm-qil < RPM package name>



10. List all installed RPM package

# RPM-QA



11. List what files are included in the RPM package file that is not installed into the system?

# RPM-QILP < RPM package name>





YUM:

Yellow dog Updater, Modified) is a shell front-end package manager in Fedora and Redhat as well as in CentOS. 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.


How to use Yum:

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




Compile and install:

Linux Software Installation and uninstallation (compiled installation): In general, the release of Linux programs can not be like windows, directly packaged into a Setup.exe file, and then the user installed directly by the next step is completed, Because it depends on the library more serious under the Linux software source package installation and uninstallation:


The distribution of the source code of the Linux software refers to the release form of all the program sources of the software, which requires the user to compile the executable binary code and install it, the advantage is that the configuration is flexible, can remove or retain certain functions/modules, adapt to a variety of hardware/operating system platform and compiling environment, the disadvantage is difficult , generally not suitable for beginners to use.



To compile the installation process:

TESTAPP-VERSION-RELEASE.SRC.RPM---after installation, use the Rpmbuild command to make the RPM package in binary format before installing


Source code----preprocessing----compile (GCC)------Execute



Installation steps:

First Step: Configure script

Options: Specify the installation location, specify the enabled features


--help: Get the options it supports

Option Categories:

Installation path settings:

--prefix=/path/to/somewhere: Specifies the default installation location; default is/usr/local/

--sysconfdir=/path/to/somewhere: Configuration file installation location;


System Types:


Optional Features: Optional Features

--disable-feature

--enable-feature[=arg]


Optional Packages: Optional Package

--with-package[=arg]

--without-package

Step Two: Make


Step three: Make install



Compile and install methods and applications:

1, *.src.rpm form of source code package

Installation: Rpm-rebuild *.src.rpm

Cd/usr/src/dist/rpms

RPM-IVH *.rpm

Uninstall: Rpm-e Packgename

Description: The rpm--rebuild *.src.rpm command compiles the source code and generates a binary RPM package under/usr/src/dist/rpms, and then installs the binary package. Packgename as mentioned earlier.


2, *.tar.gz/*.tgz, *.bz2 form of source code package

Installation: Tar zxvf *.tar.gz or tar yxvf *.bz2 first unzip

Then go to the extracted directory:

./configure Configuration

Make compilation

Make install Installation

Uninstall: Make uninstall or delete manually

Note: It is recommended to read the documentation before extracting, to understand what the installation needs, if necessary, you need to change the compilation configuration. The source code of some packages can be uninstalled with the Make install command after compilation and installation, and if this feature is not provided, the uninstallation of the software must be manually removed. Since the software may be distributed across multiple directories in the system, it is often difficult to remove it cleanly, you should configure it before compiling, specifying that the software will be installed to the target path:./configure--prefix= directory name, so you can use "RM-RF Software directory Name" command to perform a clean and thorough uninstallation. Compared with other installation methods, it is most difficult for users to compile and install themselves, it is suitable for people who have some experience in Linux, and it is generally not recommended for beginners to use.





Linux Package Management: RPM, yum, compile and install

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.