Installation of packages under Linux

Source: Internet
Author: User
Tags gpg sha1

There are two ways to install software packages under Linux: source file compilation, installation (source) , and rpm installation .

1. Common methods for installing source packages.

General installation of the source code program you have to look at its readme, usually in its directory.

Configuration :

The first step in building an app is to execute the Configure script, which is located in the main directory of the program source file:

[Email protected]~]#./configure

The script will scan the system to ensure that all the library files required by the program already exist, and that the file path and other required settings work well. If the library file required by the program is incomplete, the setup script exits and tells you which library files are needed or which ones are too old to be updated.

If this is the case, it is not enough to get only the package containing the library file, but also to find the development package with all the header files of the library file, in Linux, such a package generally takes-dev as the end of the file name. After installing all the required library files, rerun the setup script until there are no error prompts, which means that the required library files are fully installed to satisfy the dependency.

compiler :

When the setup script exits successfully, the next thing to do is compile the code. To do this, run the make command in the home directory of the source file:

[[Email protected]~]# make

Note: At this point, you will see a string of compiled output data is quickly rolled over the screen, if normal, the system will return the status of the prompt. However, if an error occurs during the compilation process, the troubleshooting process is not as simple as setting the steps. Because, this usually involves debugging the original code, there may be a syntax error in the original code, or other errors, and so on. What to do?

You are a master of programming, then debug it yourself! Otherwise, check the software's mailing list and other support channels to see if it is a known bug, if it is to see how others are resolved, not to submit a bug report, maybe soon there will be a solution.

installation :

When the software compiles successfully, the final step is to install them on the system. The makefile file for most programs will have a function for installation. It is important to note that most of the time we have to install the program as the root user, so that the program installs the file to/usr or any other directory that only the ultimate user has permission to write. Still in the home directory of the source file, execute the following command:

[[Email protected]~]# make install

Note: This will install the program on your computer.

04. In addition, when you no longer use the program, you can use the software with the uninstall function, the general program will have this feature. Convert to the source file's home directory and execute the following command:

[[Email protected]~]# make Uninstall


06. In most cases, using the method described above to install the program, are located under the/usr/local, compile and install the source package also has a feature is that we can specify the installation location, which need to specify the installation folder under configuration, usually we will be installed under/OPT, the command is as follows:

[Email protected]~]#./configure--prefix =/opt/

Note: Of course, sometimes there are exceptions, some programs simply ignore the folder you specify, it will specify the folder to install.

2.rpm How to install the package.

01. How to use the Life order parameters

Some of the above parameters need to be combined, such as rpm-h package.rpm is meaningless, but rpm-ih package.rpm means to install the package and display the installation progress with the # symbol.

• Install the RPM package:

# RPM-IVH package.rpm

• Upgrade RPM Package Command:

# RPM-UVH package.rpm

• Uninstall RPM Package Command:

# Rpm-ev Package

• Query the file list commands included in the RPM package:

# RPM-QLP Package

• Query the file list commands included in the RPM package:

# RPM-QLP Package

• Query the content information contained in the RPM Package command:

# RPM-QIP Package

• Query all installed RPM packages in the system:

# RPM-QA

Example of package management

The following steps describe a typical operating procedure for an ordinary user to install IBM Lotus Notes V85 (hereinafter referred to as Notes). The RPM package for Notes is named ibm_lotus_notes-8.5.i586.rpm.

1. First query whether the software is already present in the system
# Rpm-qa | grep ibm_lotus_notes

Note : If the return information is empty then the software has not been installed.

2. Query the Notes package contents:
# RPM-QIP ibm_lotus_notes-8.5.i586.rpm
Name:ibm_lotus_notes Relocations:/opt/ibm/lotus/notes
version:8.5 VENDOR:IBM
release:20081211.1925 Build date:sat Dec 09:38:55 AM CST
Install Date: (not installed) Build Host:dithers.notesdev.ibm.com
Group:applications/office
Source rpm:ibm_lotus_notes-8.5-20081211.1925.src.rpm
size:603779427 license:commercial
SIGNATURE:DSA/SHA1, Sat Dec 09:43:02 AM CST, Key ID 314c8c6534f9ae75
SUMMARY:IBM Lotus Notes
Description:
IBM Lotus Notes software provides a robust.

3. Install Notes:
# RPM-IVH ibm_lotus_notes-8.5.i586.rpm

Return information:

Preparing ... ########################################### [100%]
1:ibm_lotus_notes ########################################### [100%]


4. Upgrade Notes:
If you need to upgrade to a later version of Notes (seam. 0-ibm_lotus_notes-9.0.i586.rpm) based on this version, use the-u parameter:

# RPM-UVH ibm_lotus_notes-8.5.i586.rpm
Note: If you use-I in this step the system will usually report a file conflict error that does not install properly.

5. Uninstalling Notes
Note : Uninstalling the software uses the software name instead of the package file name:

# Rpm-ev Ibm_lotus_notes

The package dependency relationship

Due to the polymorphism of open source, the dependency relationship between software in Linux operating system has always been a headache for users. If Package_a relies on Package_b, in a system that does not have Package_b installed, Package_a is not recommended by the system, and forcing the installation is likely to cause the software to not work properly.

Based on the relationship between Package_a and Package_b above, in a clean system (PACKAGE_A or Package_b not installed), to install package_a, the error usually appears as:

RHEL 5.2

# RPM-IVH package_a.rpm

error:failed dependencies:
Pacakge_b = version info is needed by package_a

To query the dependency of the RPM package, use RPM-QRP:

# RPM-QRP package_a.rpm

Package_b = Version_info
Or
Package_b >= Version_info
Or
Package_b <= Version_info


Indicates that package_a.rpm relies on the version_info version of Package_b, or any package_b that is above and including Version_info version, or below or including Version_info version. So package_b.rpm must be installed in the system before package_a.

For package_a, the correct installation method should be:
# #RPM
# RPM-IVH package_b.rpm
# RPM-IVH package_a.rpm

FAQ List

01. Can I manually force a dependency check without RPM?

RPM can. With the--nodeps auxiliary parameter, the installation process ignores dependency restrictions and forces the target package to be installed.

such as: # Rpm-i--nodeps package_a.rpm

What is the--force in 02.RPM?

The default installation rule in RPM is that the same package is not allowed to be installed multiple times, and the installation is not allowed to downgrade. Using the--force auxiliary parameter will not consider the above

Factor, force the installation of the RPM package. However,--force cannot force the installation of a package that does not satisfy the system dependency relationship (--nodeps is required at this time)

Parameters). Use methods such as:
# rpm-i--force package_a.rpm

Does 03.RPM support remote installation?

RPM is. RPM supports HTTP and FTP protocols such as: # RPM-UVH Ftp://user:[email protected]/package.rpm
Does 04.RPM provide a validation mechanism for package installation success?

RPM is. You can use the-v parameter for validation.
Does 05.RPM provide package security signatures?

RPM is. You can use--import to import GPG keys that are released concurrently with the software, and then use the-K command to verify the security of the package, such as:
# rpm--import PUB_IBM_LOTUS_NOTES.GPG # rpm-k ibm_lotus_notes-8.5.i586.rpm return information: ibm_lotus_notes-

8.5.I586.RPM: (SHA1) DSA SHA1 MD5 GPG OK

06. Can I use RPM if the underlying database of RPM is corrupted?

RPM will not work properly if the underlying database is damaged. The most common workaround at this point is to refactor the database:
# rm-f/var/lib/rpm/__*; RPM-VV--REBUILDDB

07. Can you query which RPM package is part of a file that is already installed on the system?

RPM can. Use the-QF parameter, as in a system with Notes8.5 installed:
# rpm-qf/opt/ibm/lotus/notes/notes return information: ibm_lotus_notes-8.5-20081211.1920

08. Can I check the installation time of RPM package?

RPM can. You can use--last queries. Such as:
# RPM-QA--last return information: The installation time of all software in the system.

Installation of packages under Linux

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.