Software for package management and source code installation under Linux

Source: Internet
Author: User

1. What is a package?
A package is the product of packaging applications, configuration files, and management data.
2. There are two basic package management tools commonly used under Linux: Dpkg Tools and RPM tools. Corresponds to two different formats of the package, the. deb format and the. rpm format. The Dpkg package tool is mainly used for both Debian and Ubuntu releases. The RPM tool is used for most Linux distributions, such as Red Hat, openSUSE, and so on.
3, the use of dpkg and RPM tools to install software needs to consider the software dependencies, only the application depends on all the libraries and support has been properly installed, the software can be installed correctly.
4. Common options for dpkg tools:
--install (-i): Installs a specific package. This option removes the old version of the system before installing the package.
--force: Force the installation of the package. The system ignores all dependencies and compatibility issues until the package is "installed." Please use it carefully.
-L: View the packages that are already installed. If you need to find the OpenSSH version information in the current system, you can use the following command: Dpkg-l | grep OpenSSH.
--search (-s): see what files are being copied from the installed package to the system. Take OpenSSH as an example: Dpkg-s openssh.
--remove (-R): Uninstalls the installed package. Uninstalling and installing the software requires a package name. For example, to uninstall the Opera browser installed in the system, first use Dpkg-l | grep Opera View the package information for Opera browser and then use sudo dpkg--remove opera to delete the opera browser.
Note: The uninstalled package may contain libraries and data files that other software relies on, in which case the uninstallation may result in unpredictable consequences. Therefore, before uninstalling, verify that all dependencies have been resolved or use more advanced package tools.
5. Common options for RPM tools:
-IVH: Install the package. Note that this is a combination of three options to use. -I is used to install a package. -V is used to display the work currently being performed by RPM. -H reminds the user of the current installation progress by printing a series of "#".
--force: Ignore all dependencies and compatibility issues and forcibly install the package.
--nodeps: Leave RPM ignoring package dependency conflicts to continue installing the package. A package affinity conflict occurs when a package that is being installed is supported by some other packages to work correctly.
-U: Used to upgrade a package. Usually plus-V,-H is used together (that is,-UVH). The upgrade operation is actually a combination of uninstallation and installation. When upgrading the software, RPM first uninstalls the old version of the package and then installs the new version of the package. The upgrade operation of RPM preserves the software's configuration file.
-Q: View installed packages.
-E: Uninstalls the package. This command receives the name of the package as a parameter, with no version information.
--test: Requires RPM to simulate the entire process of removing a package, but does not really perform a delete operation.
6. Advanced software Package Tool: APT.
(1) Apt can automatically detect software dependency issues, download and install all files. It is not necessary to install components that depend on each other like the dpkg and RPM tools.
(2) The first time the system starts, you need to run Apt-get update to update the package information in the cache, then you can install the package using the Apt-get Install command. It is recommended that you run Apt-get update every time you install and update your software to ensure that the packages you receive are up to date.
(3) Common options:
Apt-get: Used to perform all operations related to package installation.
Apt-cache: Used to find information about a package.
Apt-get Install: Download and install the package.
Apt-get Upgrade: Download and install the latest version of the software packages available on this system.
Apt-get Remove: Uninstalls a specific package.
Apt-get Source: Download the specific software source code.
Apt-get Clean: Deletes all downloaded package files.
Apt-get-h: Lists the full usage of the apt-get.
Apt-cache Search: Searches for specific packages in the package list.
Apt-cache depends: Lists dependencies for a specific package.
7. Compile and install the software from source code:
(1) from the source code to compile the installation software does not have an absolute process, different software has different compilation methods, but the basic idea is consistent.
(2) Compiling and installing software from source code usually allows the compiler to gain more control, such as the location of the software installation, the ability to turn on and off certain features of the software, and so on.
(3) The approximate steps are as follows:
A: Download the source code from the Web to the required installation software. Under Linux, the compression format ". tar.bz2" and ". tar.gz" is the standard format for publishing source code.
B: Unzip the source code using the Unzip tool.
C: According to the installation document provided by the software Readme or install, use the Configure script to personalize the software. All software on Linux uses the Configure script to configure software released in source code form. Configure generates the corresponding makefile file according to the user's relevant parameters, and then makefile instructs the make command to compile the software correctly.
D: Compile with the Make tool. Make is an advanced compilation tool that can invoke the appropriate compiler to compile the source code according to the rules in the makefile file. Because large software is always composed of a large number of modules, where the source code files are intricately linked, it is not possible to manually compile these files. Use the Make tool to automate all of this in a pre-set step.
E: Run make install to install the software according to the C-step configuration.
(4) If there is a problem, do not panic, this is normal, you should first read the installation document, and then find the relevant information on the Internet, step to solve the problems encountered.

Software for package management and source code installation under Linux

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.