Install programs in Linux

Source: Internet
Author: User
Tags ftp port number
Recently, it takes a lot of effort to install a FastCGI support module in Apache, but it hasn't been done yet :(. First look at the basic, Linux Program Installation Problems. I have read this text before. I always need to re-query it on the Internet when it is used. I will go here this time and check it again.
In Linux, the most common software installation methods are:
One is software Source code , You need to compile it by yourself. This software installation package is usually a gzipcompressed tarpackage (suffixed with .tar.gz ).
The other is the executable program of the Software. You only need to install it. This software installation package is usually an RPM package (RedHat Linux packet manager, which is the RedHat Package Manager) with the suffix ". RPM. Of course, it also uses the RPM format to package the source Code And executable package compressed by gzip. As long as you understand the following ideas, the installation packages in these two forms are also unavailable.

Source code compilation and Installation

The source code distribution of Linux software refers to the release form of the source code of all programs of the software. You need to compile and install the executable binary code on your own. The advantage is that the configuration is flexible, and some functions/modules can be removed or retained at will to adapt to a variety of hardware/operating system platforms and compiling environments. The disadvantage is that it is difficult and generally not suitable for beginners.

The source code packages of each software are generally downloaded on the home page of each software project, for example, www.apache.org.

1. * Source code package in SRC. RPM format

Installation:

Rpm-rebuild *. SRC. rpm

CD/usr/src/Dist/RPMS

Rpm-IVH *. rpm

Uninstall:

Rpm-e packgename

Note: The rpm -- rebuild *. SRC. RPM command compiles the source code and generates a binary RPM package under/usr/src/Dist/RPMs. then install the Binary Package. Packgename is described above.

2. * .tar.gz/*. tgz/*. bz2 source code package

Software packages ending with the format tar.gzor tgzor tar.bz2 are generally released in source code mode. to install such software, you must first decompress the software:

# Tar zxvf filename.tar.gz

# Tar xvfz filename. tgz

# Tar xvf J filename.tar.bz2

After decompression, you can enter the decompressed directory:

# Cd filename/

For such documents, the common installation steps are configuration, compilation, and installation. The most troublesome of these steps is configuration, because all configurations related to software installation are specified in this step: for example, the software installation location.

Configuration:./configure

Compile: Make

Install: make install

Uninstall: Make uninstall or manually delete

Note: It is recommended that you read the instruction file (Readme and install) after decompression to understand the installation requirements and modify the compilation configuration when necessary. The source code of some software packages can be uninstalled by using the make uninstall command after compilation and installation. If this function is not provided, the software must be uninstalled manually. Because the software may install files in multiple directories of the system, it is often difficult to delete the files, you should configure them before compilation, specify the path to which the software will be installed :. /configure -- prefix = directory name. In this way, you can run the "RM-RF Software Directory Name" command to thoroughly uninstall the directory. Compared with other installation methods, it is the most difficult to compile and install by yourself. It is suitable for users who already have some experience in Linux. It is generally not recommended for beginners.

Installation of rpm-format software packages

Rpm is a software package manager developed by RedHat. It can easily install, upgrade, uninstall, verify, and query software packages in RPM format. It is easy to install, when you uninstall the software, you can also delete the files installed in multiple directories. Therefore, we recommend that you use software packages in RPM format as much as possible. Software packages often have specific command specifications and names are strings consisting of "file name + version number +. RPM", such as apache-3.1.12-i386.rpm and apache-devel-3.1.12-i386.rpm, whose packages are named Apache and APACHE-devel respectively. The RPM packages of common Linux software that support RPM format can be found on the website rpmfind.net.

1. Install

Command Format:

Rpm-I (or -- install) Options file1.rpm... filen. rpm

Parameters:

File1.rpm... filen. RPM indicates the name of the RPM package to be installed.

Detailed options:

-H (or-hash) outputs the hash mark during installation. test only tests the installation and does not actually install it. -- percent outputs the installation progress as a percentage; -- excludedocs does not install the document in the software package; -- includedocs installation document; -- replacepkgs forcibly re-installs the installed software package; -- replacefiles replaces the files of other software packages; -- force ignores conflicts between software packages and documents; -- noscripts does not run pre-Installation and post-installation scripts; -- prefix newpath installs the software package to the path specified by newpath; -- ignorearch does not check the structure of the software package; -- ignoreos does not check the operating system of the software package running; -- nodeps does not check the dependency; -- ftpproxy host uses host as the FTP proxy; -- ftpport port: Specifies the ftp port number as port.

General options:

-V: displays additional information.-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory; -- rcfile filelist sets the rpmrc document to filelist; -- dbpath directory sets the path of the RPM database to directory.

2. Delete

Command Format:

Rpm-E (or -- Erase) Options pkg1... pkgn

Parameters:

Pkg1. .. pkgn: The software package to be deleted.

Detailed options:

-- Test only executes the delete test; -- noscripts does not run the pre-Installation and post-installation script programs; -- nodeps does not check dependencies.

General options:

-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory. In this way, both the pre-installation program and the post-installation program are installed in this directory; -- rcfile filelist: Set rpmrc to filelist; -- dbpath Directory: set the path of the RPM database to directory.

3. Upgrade

Command Format:

Rpm-U (or -- upgrade) Options file1.rpm... filen. rpm

Parameters:

File1.rpm... filen. RPM indicates the name of the software package.

Detailed options:

-H (or-hash) outputs the hash mark during installation;-oldpackage allows an old version; -- test only performs the upgrade test; -- excludedocs does not install files in the software package; -- includedocs installation file; -- replacepkgs force the installation of installed software packages; -- replacefiles replace files belonging to other software packages; -- force ignores conflicts between software packages and files; -- percent outputs the installation progress as a percentage; -- noscripts does not run the pre-Installation and post-installation scripts; -- prefix newpath installs the software package to the path specified by newpath; -- ignorearch does not verify the structure of the software package; -- ignoreos does not check the operating system where the software package runs; -- nodeps does not check the dependency; -- ftpproxy host uses host as the FTP proxy; -- ftpport host specifies the ftp port number as the host.

General options:

-V: displays additional information.-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory; -- rcfile filelist sets the rpmrc file to filelist; -- dbpath directory sets the path of the RPM database to directory.

4. Query

Command Format:

Rpm-Q (or -- Query) Options

Parameters:

Pkg1. .. pkgn: Query installed software packages.

Detailed options:

-P package_file: query the file of the software package.-F file: query which software package the file belongs to.-A: Query all installed software packages. -- whatprovides capability: query the software packages that provide the capability function; -G group: query the software packages that belong to the group. -- whatrequires capability: Query all software packages that require capability.

Option:

-I: displays the summary of the software package.-L: displays the file list in the software package.-C: displays the configuration file list.-D: displays the file list; -S: displays the document list in the software package and the status of each file-;-scripts: displays the installation, uninstallation, and validation scripts; -- queryformat (or -- qf) display query information as specified by the user; -- dump: displays all checked information for each file; -- provides: displays functions provided by the software package; -- requires (or-R) displays the features required by the software package.

General options:

-V: displays additional information.-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory;-rcfile filelist sets the rpmrc file to filelist; -- dbpath directory sets the path of the RPM database to directory.

5. Verify installed software packages

Command Format:

Rpm-V (or -- verify, or-y) Options

Parameters:

Pkg1. .. pkgn name of the software package to be verified

Package options:

-P package_file: Verify the software package to which package_file belongs.-A verifies all software packages and-G group verifies all software packages belonging to the group.

Detailed options:

-- Noscripts does not run the validation script; -- nodeps does not verify dependencies; -- nofiles does not verify document attributes.

General options:

-V displays additional information;-VV displays debugging information; -- root path allows RPM to use the path specified by path as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory; -- rcfile filelist sets the rpmrc file to filelist; -- dbpath directory sets the path of the RPM database to directory.

6. Verify the files in the Software Package

Syntax:

Rpm-K (or -- checksig) Options file1.rpm... filen. rpm

Parameters:

File1.rpm... filen. RPM package file name; checksig -- details option; -- nopgp does not verify the PGP signature.

General options:

-V: displays additional information.-VV: displays debugging information. -- rcfile filelist: sets the rpmrc file to filelist.

7. Other RPM options

-- Rebuilddb re-creates an RPM database; -- initdb creates a new RPM database; -- Quiet minimizes the output; -- help displays the Help file; -- version displays the current version of RPM.

If you do not like to install or uninstall these software packages under the character interface, you can install the X-window-based graphical interface software package management program, such as glint and xrpm. Or use KDE's kpackage (Click Start> Run Command, and enter kpackage to start kpackage, in this way, you can easily install, upgrade, uninstall, verify, and query the software package by clicking the mouse ,.

Note that the format of each RPM software package is not necessarily independent, and there is a certain dependency between each RPM software package. Deleting an RPM software package may make other software unavailable. Therefore, pay attention to the upgrade and deletion. Recently, it takes a lot of effort to install a FastCGI support module in Apache, but it hasn't been done yet :(. Let's take a look at the basic Linux program installation problems. I have read this text before. I always need to re-query it on the Internet when it is used. I will go here this time and check it again.
In Linux, the most common software installation methods are:
One is the source code of the Software. You need to compile it by yourself. This software installation package is usually a gzipcompressed tarpackage (suffixed with .tar.gz ).
The other is the executable program of the Software. You only need to install it. This software installation package is usually an RPM package (RedHat Linux packet manager, which is the RedHat Package Manager) with the suffix ". RPM. Of course, it also uses the source code packaged in RPM format and executable programs compressed using gzip. As long as you understand the following ideas, the installation packages in these two forms are also unavailable.

Source code compilation and Installation

The source code distribution of Linux software refers to the release form of the source code of all programs of the software. You need to compile and install the executable binary code on your own. The advantage is that the configuration is flexible, and some functions/modules can be removed or retained at will to adapt to a variety of hardware/operating system platforms and compiling environments. The disadvantage is that it is difficult and generally not suitable for beginners.

The source code packages of each software are generally downloaded on the home page of each software project, for example, www.apache.org.

1. * Source code package in SRC. RPM format

Installation:

Rpm-rebuild *. SRC. rpm

CD/usr/src/Dist/RPMS

Rpm-IVH *. rpm

Uninstall:

Rpm-e packgename

Note: The rpm -- rebuild *. SRC. RPM command compiles the source code and generates a binary RPM package under/usr/src/Dist/RPMs. then install the Binary Package. Packgename is described above.

2. * .tar.gz/*. tgz/*. bz2 source code package

Software packages ending with the format tar.gzor tgzor tar.bz2 are generally released in source code mode. to install such software, you must first decompress the software:

# Tar zxvf filename.tar.gz

# Tar xvfz filename. tgz

# Tar xvf J filename.tar.bz2

After decompression, you can enter the decompressed directory:

# Cd filename/

For such documents, the common installation steps are configuration, compilation, and installation. The most troublesome of these steps is configuration, because all configurations related to software installation are specified in this step: for example, the software installation location.

Configuration:./configure

Compile: Make

Install: make install

Uninstall: Make uninstall or manually delete

Note: It is recommended that you read the instruction file (Readme and install) after decompression to understand the installation requirements and modify the compilation configuration when necessary. The source code of some software packages can be uninstalled by using the make uninstall command after compilation and installation. If this function is not provided, the software must be uninstalled manually. Because the software may install files in multiple directories of the system, it is often difficult to delete the files, you should configure them before compilation, specify the path to which the software will be installed :. /configure -- prefix = directory name. In this way, you can run the "RM-RF Software Directory Name" command to thoroughly uninstall the directory. Compared with other installation methods, it is the most difficult to compile and install by yourself. It is suitable for users who already have some experience in Linux. It is generally not recommended for beginners.

Installation of rpm-format software packages

Rpm is a software package manager developed by RedHat. It can easily install, upgrade, uninstall, verify, and query software packages in RPM format. It is easy to install, when you uninstall the software, you can also delete the files installed in multiple directories. Therefore, we recommend that you use software packages in RPM format as much as possible. Software packages often have specific command specifications and names are strings consisting of "file name + version number +. RPM", such as apache-3.1.12-i386.rpm and apache-devel-3.1.12-i386.rpm, whose packages are named Apache and APACHE-devel respectively. The RPM packages of common Linux software that support RPM format can be found on the website rpmfind.net.

1. Install

Command Format:

Rpm-I (or -- install) Options file1.rpm... filen. rpm

Parameters:

File1.rpm... filen. RPM indicates the name of the RPM package to be installed.

Detailed options:

-H (or-hash) outputs the hash mark during installation. test only tests the installation and does not actually install it. -- percent outputs the installation progress as a percentage; -- excludedocs does not install the document in the software package; -- includedocs installation document; -- replacepkgs forcibly re-installs the installed software package; -- replacefiles replaces the files of other software packages; -- force ignores conflicts between software packages and documents; -- noscripts does not run pre-Installation and post-installation scripts; -- prefix newpath installs the software package to the path specified by newpath; -- ignorearch does not check the structure of the software package; -- ignoreos does not check the operating system of the software package running; -- nodeps does not check the dependency; -- ftpproxy host uses host as the FTP proxy; -- ftpport port: Specifies the ftp port number as port.

General options:

-V: displays additional information.-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory; -- rcfile filelist sets the rpmrc document to filelist; -- dbpath directory sets the path of the RPM database to directory.

2. Delete

Command Format:

Rpm-E (or -- Erase) Options pkg1... pkgn

Parameters:

Pkg1. .. pkgn: The software package to be deleted.

Detailed options:

-- Test only executes the delete test; -- noscripts does not run the pre-Installation and post-installation script programs; -- nodeps does not check dependencies.

General options:

-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory. In this way, both the pre-installation program and the post-installation program are installed in this directory; -- rcfile filelist: Set rpmrc to filelist; -- dbpath Directory: set the path of the RPM database to directory.

3. Upgrade

Command Format:

Rpm-U (or -- upgrade) Options file1.rpm... filen. rpm

Parameters:

File1.rpm... filen. RPM indicates the name of the software package.

Detailed options:

-H (or-hash) outputs the hash mark during installation;-oldpackage allows an old version; -- test only performs the upgrade test; -- excludedocs does not install files in the software package; -- includedocs installation file; -- replacepkgs force the installation of installed software packages; -- replacefiles replace files belonging to other software packages; -- force ignores conflicts between software packages and files; -- percent outputs the installation progress as a percentage; -- noscripts does not run the pre-Installation and post-installation scripts; -- prefix newpath installs the software package to the path specified by newpath; -- ignorearch does not verify the structure of the software package; -- ignoreos does not check the operating system where the software package runs; -- nodeps does not check the dependency; -- ftpproxy host uses host as the FTP proxy; -- ftpport host specifies the ftp port number as the host.

General options:

-V: displays additional information.-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory; -- rcfile filelist sets the rpmrc file to filelist; -- dbpath directory sets the path of the RPM database to directory.

4. Query

Command Format:

Rpm-Q (or -- Query) Options

Parameters:

Pkg1. .. pkgn: Query installed software packages.

Detailed options:

-P package_file: query the file of the software package.-F file: query which software package the file belongs to.-A: Query all installed software packages. -- whatprovides capability: query the software packages that provide the capability function; -G group: query the software packages that belong to the group. -- whatrequires capability: Query all software packages that require capability.

Option:

-I: displays the summary of the software package.-L: displays the file list in the software package.-C: displays the configuration file list.-D: displays the file list; -S: displays the document list in the software package and the status of each file-;-scripts: displays the installation, uninstallation, and validation scripts; -- queryformat (or -- qf) display query information as specified by the user; -- dump: displays all checked information for each file; -- provides: displays functions provided by the software package; -- requires (or-R) displays the features required by the software package.

General options:

-V: displays additional information.-VV: displays debugging information. -- root directory allows RPM to use the path specified by directory as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory;-rcfile filelist sets the rpmrc file to filelist; -- dbpath directory sets the path of the RPM database to directory.

5. Verify installed software packages

Command Format:

Rpm-V (or -- verify, or-y) Options

Parameters:

Pkg1. .. pkgn name of the software package to be verified

Package options:

-P package_file: Verify the software package to which package_file belongs.-A verifies all software packages and-G group verifies all software packages belonging to the group.

Detailed options:

-- Noscripts does not run the validation script; -- nodeps does not verify dependencies; -- nofiles does not verify document attributes.

General options:

-V displays additional information;-VV displays debugging information; -- root path allows RPM to use the path specified by path as the root directory, in this way, both the pre-installation program and the post-installation program will be installed in this directory; -- rcfile filelist sets the rpmrc file to filelist; -- dbpath directory sets the path of the RPM database to directory.

6. Verify the files in the Software Package

Syntax:

Rpm-K (or -- checksig) Options file1.rpm... filen. rpm

Parameters:

File1.rpm... filen. RPM package file name; checksig -- details option; -- nopgp does not verify the PGP signature.

General options:

-V: displays additional information.-VV: displays debugging information. -- rcfile filelist: sets the rpmrc file to filelist.

7. Other RPM options

-- Rebuilddb re-creates an RPM database; -- initdb creates a new RPM database; -- Quiet minimizes the output; -- help displays the Help file; -- version displays the current version of RPM.

If you do not like to install or uninstall these software packages under the character interface, you can install the X-window-based graphical interface software package management program, such as glint and xrpm. Or use KDE's kpackage (Click Start> Run Command, and enter kpackage to start kpackage, in this way, you can easily install, upgrade, uninstall, verify, and query the software package by clicking the mouse ,.

Note that the format of each RPM software package is not necessarily independent, and there is a certain dependency between each RPM software package. Deleting an RPM software package may make other software unavailable. Therefore, pay attention to the upgrade and deletion.

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.