Installation and uninstallation of software under Linux system


1、 Understanding Linux applicationsinstallPackage:

Generally, Linux application softwareinstallThere are three kinds of packages:

1) tar package, such as software-1.2.3-1 tar. gz。 It is packaged using tar, a packaging tool for UNIX systems.

2) RPM package, such as software-1.2.3-1 i386. rpm。 It is a package encapsulation format provided by RedHat Linux.

3) dpkg package, such as software-1.2.3-1 deb。 It is a package encapsulation format provided by debain Linux.

Moreover, the naming of most Linux application packages also has certain rules, which follows:

Name – version – Revision – type

For example:

  1) software-1.2.3-1. tar. GZ means:

Software name: Software

Version No.: 1.2.3

Revised version: 1

Type: tar GZ, the description is a tar package.

  2) sfotware-1.2.3-1.i386.rpm

Software name: Software

Version No.: 1.2.3

Revised version: 1

Available platforms: i386, applicable to Intel 80×86 platform.

Type: RPM. Description is an RPM package.

Note: since the RPM format is usually a compiled program, it is necessary to specify the platform. It will be explained in detail later.

Software-1.2.3-1 Deb, don’t talk about it! Let’s practice by ourselves.

2、 Understand the contents of the package:

The software package of a Linux application can contain two different contents:

1) one is the executable file, which can be run directly after unpacking. All software packages in windows are of this type.installYou can use the source program, but you can’t see it. And when downloading, you should pay attention to whether the software is the platform you use, otherwise it will not work normallyinstall

2) the other is the source program. After unpacking, you also need to use the compiler to compile it into an executable file. This is almost absent in the windows system, because the idea of windows is not to open the source program.

Usually, tar packages are source programs; The programs packaged with RPM and dpkg are often executable programs. Generally speaking, compiling source programs by yourself can be more flexible, but it is also easy to encounter various problems and difficulties. Relatively speaking, downloading those executable packages is easier to complete the softwareinstallOf course, that would be much less flexible. Therefore, generally, a software will always provide multiple packaging formatsinstallProcedural. You can choose according to your own situation.

3、 Application software packaged with tar

  1. install

WholeinstallThe process can be divided into the following steps:

1) obtain application software: by downloading and purchasing CD-ROMmethodget;

2) unzip files: generally, tar packages will be compressed again, such as gzip, bz2, etc., so you need to unzip them first. If it is the most common GZ format, you can execute “tar cxvzf package name” to complete the decompression and unpacking in one step. If not, first use the decompression software, and then execute “tar package decompressed by tar cxvf” to unpack;

3) read the attached install file and readme file;

4) execute the “. / configure” command to prepare for compilation;

5) execute the “make” command to compile the software;

6) execute “make install” to completeinstall

7) execute “make clean” deletioninstallTemporary files generated when.

All right, that’s it. We can run the application. But at this time, some readers will ask, how can I implement it? This is also a Linux characteristic problem. In fact, generally speaking, the executable files of Linux application software will be stored in / usr / local / bin directory! However, this is not a universal truth. The most reliable thing is to look at the install and readme files of the software, which are generally explained.

  2. Uninstall:

Usually, software developers rarely consider how to uninstall their own software, and tar only completes the packaging work, so it does not provide good uninstallationmethod

Does that mean you can’t uninstall! In fact, it’s not. There are two software that cansolveThe problem is kinstall and kife. They are tar bagsinstall, unloaded golden partner. Another is to use the command whereis to find out all of the softwareinstallDirectory, delete all

4、 Application software packaged with RPM

Rpm is a great contribution of RedHat, which makes Linux SoftwareinstallWork becomes easier and easier.

  1. install

I just need a simple sentence to finish. Execution:

RPM civh RPM package name

RPM parameter description
-i installSoftware
-T testinstallNo, it’s not trueinstall
-P displayinstallspeed of progress
-F ignore any errors
-U upgradeinstall
-V check whether the kit is correctinstall

These parameters can be used at the same time. For more information, please refer to the command help of RPM.

  2. Uninstall:

First query: RPM -ql software name, and then execute: RPM CE Software name after confirmation

However, it should be noted that the software name is used later, not the package name. For example, toinstallsoftware-1.2.3-1. i386. RPM this package, you should execute:

rpm Civh software-1.2.3-1.i386.rpm

When uninstalling, perform the following steps:

rpm Ce software。

In addition, graphical RPM tools such as gnorpm and kpackage are also provided in Linux, which makes the whole process easier. The specific applications of these software will be introduced separately.

5、 Application packaged with DEB

This is a package manager provided by Debian Linux, which is very similar to rpm. However, because RPM appeared earlier, it is common in various versions of Linux. The package manager dpkg of Debian only appears in debina Linux, and other Linux versions generally do not. Let’s briefly explain here:

  1. install

Dpkg CI DEB package name

For example: dpkg CI software-1.2.3-1 deb

  2. uninstall

Dpkg CE Software name

For example: dpkg CE Software