Summary of software installation methods in Linuxx

Source: Internet
Author: User
When installing software in Linux, we often need to consider the following issues: (1) how to install the software; (2) where the software is installed; (3) Preface: when installing software in Linux, we often need to consider the following issues: (1 ). how to install software; (2 ). where is the software installed? (3 ). how to uninstall and delete unwanted software ...... next, let's take a look at these issues.

1. understand the Linux application installation package

Generally, there are three installation packages for Linux application software:
1) tarpackages, such as software-1.2.3-1.tar.gz. It is packaged using tar, a packaging tool for UNIX systems.
2) rpm packages, such as software-1.2.3-1.i386.rpm. It is a package encapsulation format provided by Redhat Linux.

(RPM Package Manager (formerly Redhat Package Manager)

3) dpkg package, such as software-1.2.3-1.deb. It is a package encapsulation format provided by Debain Linux.
In addition, the naming rules of most Linux application software packages follow the following rules:
Name-version-revised version-type
For example:
1) software-1.2.3-1.tar.gz means:
Software name: software
Version: 1.2.3
Revised version: 1
Type: tar.gz, which indicates a tar package.
2) sfotware-1.2.3-1.i386.rpm
Software name: software
Version: 1.2.3
Revised version: 1
Available Platform: i386, applicable to Intel 80x86 platform.
Type: rpm, which indicates an rpm package.
Note: The rpm format is usually compiled, so you need to specify the platform. Detailed descriptions will be provided later.
And software-1.2.3-1.deb don't have to say it again! You can practice it yourself.

2. understand the content in the package:
    A Linux application package contains two different types of content:
1) one is the executable file, that is, it can be run directly after the package is unwrapped. All software packages in Windows are of this type. After installing this program, you can use it, but you cannot see the source program. When downloading the software, check whether the software is the platform you are using. Otherwise, the software cannot be installed normally.
2) the other is the source program. after the package is unwrapped, you also need to use the compiler to compile it into an executable file. This is almost impossible in Windows systems, because the idea of Windows is not to open source programs.
Generally, all packages are source programs packaged with tar, while packages with rpm and dpkg are often executable programs. In general, it is more flexible to compile the source program by yourself, but it is also prone to various problems and difficulties. Relatively speaking, downloading executable packages makes it easier to install the software. of course, the flexibility is much lower. Therefore, a software always provides installation steps in multiple packaging formats. You can choose based on your own situation.

Several installation commands:

1. steps for installing the rpm Package:
1. find the corresponding software package, such as soft. version. rpm, and download it to a local directory;

2. open a terminal and su-become the root user;

3. directory where cd soft. version. rpm is located;

4. input rpm-ivh soft. version. rpm

Details:

1. installation:
I just need a simple sentence to finish. Run:
Rpm-ivh rpm Package name
For more advanced information, see the following table:
Rpm parameter description
-I install software
-T test the installation.
-P: shows the installation progress.
-F ignore any errors
-U upgrade and installation
-V check kit is correctly installed
These parameters can be used at the same time. For more information, see The RPM command help.
2. uninstall:
I just need a simple sentence to finish. Run:
Rpm-e software name
Note that the software name is used later, not the software package name. For example, to install the software-1.2.3-1.i386.rpm package, execute:
Rpm-ivh software-1.2.3-1.i386.rpm
When uninstalling, execute:
Rpm-e software.
In addition, graphical RPM tools such as GnoRPM and kpackage are provided in Linux to simplify the entire process.

II. steps for installing the deb package:
1. find the corresponding software package, such as soft. version. deb, and download it to a local directory;

2. open a terminal and su-become the root user;

3. directory where cd soft. version. deb is located;

4. input dpkg-I soft. version. deb

Details:
This is a package manager provided by Debian Linux, which is very similar to RPM.

However, since RPM appeared earlier, it is common in various versions of Linux.

The debian package manager dpkg only appears in Debina Linux. it is not available in other Linux versions.
1. install
Package name of dpkg-I deb
Such as: dpkg-I software-1.2.3-1.deb
2. uninstall
Dpkg-e software name
For example, dpkg-e software

3. query: query the software packages installed in the current system:

Dpkg-l '* package name *'

For example, dpkg-l '* software *'

Install the three-character tar.gz source code package:
1. find the corresponding software package, such as soft.tar.gz, and download it to a local directory;

2. open a terminal and su-become the root user;

3. directory where cd soft.tar.gz is located;

4. tar-xzvf soft.tar.gz // A soft directory is usually generated.

5. cd soft

6../configure

7. make

8. make install

Details:

1. installation:
The installation process can be divided into the following steps:
1) Application software acquisition: obtained by downloading and purchasing CDs;
2) decompress the File: Generally, the tar package will be compressed again, such as gzip and bz2, so you need to decompress it first. If it is the most common gz format, you can run "tar-xvzf package name" to decompress and unpack the package in one step. If not, decompress the software and then run tar-xvf to decompress the package;
3) read the INSTALL and README files;
4) execute the "./configure" command to prepare for compilation;
5) execute the "make" command for software compilation;
6) execute "make install" to complete the installation;
7) execute "make clean" to delete the temporary files generated during installation.
Now, we are done. We can run the application. However, some readers may ask, how can I implement it? This is also a Linux issue. In fact, the executable files of Linux applications are stored in the/usr/local/bin directory! However, this is not the truth of "universal availability". the most reliable part is the INSTALL and README files of this software.
2. uninstall:
Generally, software developers seldom consider how to uninstall their own software. tar is only a package, so it does not provide a good method to uninstall the software.
Can't you uninstall it! Actually, no. There are two software that can solve this problem: Kinstall and Kife. they are the golden partner for installing and uninstalling tar packages.

Note:

. /Configure is the first step in source code installation. it mainly serves to configure the software to be installed and check whether the current environment meets the dependency of the software to be installed, however, not all tar packages are source code packages. you can use ls to check if there is any configure file. maybe you have a binary package. if it is a binary package, decompress the package and use it directly. (For example, if you install the firefox flash plug-in the previous article, you can install the source code package in the following way: 1. download the corresponding software package to a local directory, for example, soft.tar.bz2. 2. open a terminal and su-to root users; 3. directory where cd soft.tar.bz2 is located; 4. tar-xjvf soft.tar.bz2 // A soft directory is usually generated. 5. cd soft6 ,. /configure7, make8, make install 5, apt installation: (install deb package) 1. open a terminal and su-to root users; 2. apt-cache search soft note: soft is the name or related information of the software you are looking for. 3. if software soft is found in 2. version, use apt-get install soft. version command to install software

Note: as long as you can access the Internet, you only need to use apt-cache search to find the software and use apt-get install software.
Details:

Apt-get is the package management tool of debian and ubuntu, which is similar to the yum tool in Red Hat.

The apt-get command generally requires the root permission for execution, so it is generally followed by the sudo command example sudo apt-get xxxx
Apt-get install packagename -- install a new package (see aptitude below) apt-get remove packagename -- uninstall an installed package (keep the configuration file) apt-get -- purge remove packagename -- uninstall an installed package (delete configuration file) dpkg -- force-all -- purge packagename -- some software is hard to uninstall, it also stops other software applications and can be used, but it is a little risky. Apt-get autoremove -- because apt will back up installed or unloaded software on the hard disk, if you need space, you can run this command to delete the software you have deleted. Apt-get autoclean -- run this command regularly to clear the. deb files of uninstalled software packages. In this way, a large amount of disk space can be released. If the demand is urgent, you can use apt-get clean to release more space. This command will delete the. deb file that has installed the software package. Apt-get clean -- this command will also delete the backup of the installed software, but this will not affect the use of the software. Apt-get upgrade -- update all installed software packages apt-get dist-upgrade -- upgrade the system to the new version apt-cache search string -- search for the apt-cache showpkg pkgs string in the software package list -- displays the package information. Apt-cache stats -- view the number of software in the library apt-cache dumpavail -- print the list of available software packages. Apt-cache show pkgs -- displays software package records, similar to dpkg-print-avail. Apt-cache pkgnames -- print the names of all packages in the package list (you need to run this command regularly to ensure that your package list is up-to-date)
To put it simply, dpkg can only install the deb package that has been downloaded to the local machine. apt-get can download and install the deb package online, update the system, and automatically handle dependencies between the package and the package. this is not available in the dpkg tool.

VI. yum installation: (install the rpm Package)

Rpm is a linux software package name ending with. rmp. The syntax for installation is rpm-ivh.
The main drawback of rpm Package installation is that the file is too relevant. it is very troublesome to install many other software packages for a software.
Therefore, the yum installation method has been developed for RedHat Red Hat. it can completely solve this issue and is very convenient. you only need to configure two files to install it. the installation method is yum-y install.
Yum is not a package, but the software of the installation package.

Simply put, only the rpm package that has been downloaded to the local machine can be installed. yum can download and install rpm packages online, update the system, and automatically handle dependencies between Packages. this is not available in rpm tools. 7. binfile installation: if the software you downloaded is soft. bin, which is generally an executable file. the installation method is as follows: 1. open a terminal and su-to root users; 2. chmod + x soft. bin3 ,. /soft. bin // run this command to install software. 8. software without installation is not required, after the built-in jre is decompressed, it can be directly run. The download path is lumaqq.tar.gz. the usage is as follows: 1. open a terminal and su-becomes the root user; 2. tar-xzvf lumaqq.tar.gz // This step will generate a directory named LumaQQ 3, cd LumaQQ4, chmod + x lumaqq // you can set the lumaqq program file to run 5. lumaqq is running, use commands. /lumaqq, but you need to enter the full path or switch to the generated LumaQQ Directory. 6. to ensure that no path is set, you can use it, you can create a lumaqq link in the/bin directory and run ln-s lumaqq/bin, open a terminal and enter lumaqq at any time to start the QQ chat software. 7. if you want lumaqq to have a menu item, use the menu editing tool, such as Alacarte MenuEditor, find LumaQQ in the lumaqq directory generated above and set a menu item. of course, you can also directly go to/usr /Share/applications Directory. generate a desktop file of your own according to the format of the other *. desktop files in it.

========================================================== ========================================================== ===
Software Installation
---- There are two different installation methods for software in Linux. The first installation file is filename.tar.gz. The installation file is filename. i386.rpm. Most of the software released in the first method is sent as source code. The second method is directly issued in binary format. I386 indicates that the software is compiled and generated according to the Inter 386 instruction set.
---- For the first method, the installation method is as follows:
---- First, copy the installation file to your Directory. For example, if you log on as root, copy the software to/root.
---- # Cp filename.tar.gz/root
---- Because the file is compressed and packaged, decompress it. Command:
---- # Tar xvzf filename.tar.gz
---- After executing this command, decompress the installation file to the current directory by path. Run the ls command to view the decompressed file. The file named "INSTALL" is usually generated after decompression. This file is a plain text file that describes the installation method of the software package in detail.
---- For most software to be compiled, the installation method is roughly the same. After decompression, an executable script program named configure is generated. It is used to check whether the system has the library required for compilation, and whether the library version meets the compilation requirements and other system information required for installation. Prepare for subsequent compilation. Command:
---- #./Configure
---- If an error is found during the check, configure will prompt and stop the check. You can configure the system as prompted. Run the program again. After the check is passed, the MakeFile file for compilation will be generated. Now you can start compiling. The compilation process varies depending on the size of the software and the performance of the computer. Command:
---- # Make
---- After compilation, enter the following command to start installation:
---- # Make install
---- After installation is completed, the temporary files generated during compilation and files generated during configuration should be cleared. Run the following command:
# Make clean
# Make distclean
So far, the software installation is complete.
---- For the second method, the installation method is much simpler.
---- Copy the installation file to your directory in the same way as the first method. Then use rpm to install the file. The command is as follows:
---- # Rpm-I filename. i386.rpm
---- Rpm automatically unpacks the installation file and installs the software in the default directory. And register the software installation information to the rpm database. The role of parameter I is to enable rpm to enter the installation mode.
---- In addition, there are some commercial software on the Linux platform. In the installation file, there is a Setup installer, which is installed in the same way as on Windows. For example, Corel WordPerfect.
Uninstall software
---- The software is mainly detached using rpm. To uninstall a software package, you must first know the name registered in the system. Type the following command:
---- # Rpm-q-
---- You can query all the software packages installed in the current system. The function of the q parameter is to enable rpm to enter the query command mode. Parameter a is a subparameter of the query mode, meaning ALL ). You can use the less person screen to display more information.
---- Determine the name of the software to be detached, and you can start to uninstall the software. Type the following command:
---- # Rpm-e [package name]
---- You can uninstall the software. The function of parameter e is to enable rpm to enter the uninstall mode. Uninstall the software package named [package name. Each software package in the system depends on each other. If the object cannot be detached because of dependency, the rpm prompts and stops uninstalling the object. You can use the following command to ignore dependencies and directly start to uninstall them:
---- # Rpm-e [package name]-nodeps
---- Detaching dependencies may make other software unavailable in the system. You can use
---- # Rpm-e [package name]-test
---- Run the rpm command to uninstall the preview, instead of detaching the preview. This allows you to check whether the software has dependencies. Whether there is an error during the uninstall process.

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.