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 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.

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.