Detailed explanation of software installation commands under Linux

0. How to install the application software?

    Where is my software installed?
    How to delete unwanted applications?
    ...
    Now, let's take a look at these issues together.

1. Analyze the Linux application software installation package:

    Usually there are three kinds of installation packages for Linux application software:
    1) tar package, such as software-1.2.3-1.tar.gz. It is packaged using tar, the 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, most Linux application software packages are named according to certain rules, which follow:
    name-version-modification-type
    For example:
    1) software-1.2.3-1.tar.gz means:
    software name: software
    version number : 1.2.3
    Fixed version: 1
     Type: tar.gz, description is a tar package.
    2) sfotware-1.2.3-1.i386.rpm
    software name: software
    version number: 1.2.3
    revision version: 1
    available platform: i386, suitable for Intel 80x86 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.
    And software-1.2.3-1.deb needn't say anymore! Everyone practice it.

Second, understand the contents of the package:

    A Linux application package can contain two different contents:
    1) One is an executable file, that is, it can be run directly after unpacking. All software packages in Windows are of this type. After installing this program, you can use it, but you cannot see the source program. And when downloading, pay attention to whether this software is the platform you are using, otherwise it will not be installed normally.
    2) The other is the source program, that is, 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 open source.
    Usually, packages packaged with tar are source programs; packages packaged with rpm and dpkg are often executable programs. In general, compiling source programs by yourself can be more flexible, but it is also prone to various problems and difficulties. Relatively speaking, downloading those executable packages makes it easier to complete the installation of the software, of course, the flexibility is much less. Therefore, generally a software will always provide installers in a variety of packaging formats. You can choose according to your own situation.

Third, get the application software packaged with tar

   1. Install:

    The whole installation process can be divided into the following steps:
    1) Obtaining the application software: obtained by downloading and purchasing CD-ROM;
    2) Decompressing the file: the general tar package will be compressed again, such as gzip, bz2, etc., so you need to Unzip first. If it is the most common gz format, you can execute: "tar -xvzf package name" to complete the decompression and unpacking work in one step. If not, use the decompression software first, and then execute "tar -xvf decompressed tar package" 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 complete the installation;
    7) Execute “make clean” to delete the temporary files generated during installation.
    Alright, you're done. We are ready to run the application. But at this time, some readers will ask, how do I implement it? This is also a Linux-specific issue. In fact, in general, the executable files of Linux application software will be stored in the /usr/local/bin directory! However, this is not the truth of "one size fits all". The most reliable way is to look at the INSTALL and README files of this 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 a good uninstall method.
    So does that mean it can't be uninstalled? In fact, it is not. There are two softwares that can solve this problem, that is, Kinstall and Kife, which are the golden partners of tar package installation and uninstallation. How to use them will be introduced in another article. I won't go into details here.

Fourth, get the application software packaged with rpm

    rpm can be described as a major contribution of Redhat company, it makes Linux software installation easier and easier.

  1. Install:

    I only need one simple sentence to finish. Execute: rpm –ivh rpm package name
    More advanced, see the following table:
         rpm parameter parameter description
          -i install software -t test installation          ,
         not real installation
         -p show installation progress
         -f ignore any errors
         -U upgrade installation-
v Check if the kit is installed correctly
    These parameters can be used at the same time. For more information, please refer to RPM's command help.

  2. Uninstall:

    I can also finish with just one simple sentence. Execute:
             rpm -e software name
    However, it should be noted that the software name is used later, not the 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
    and when uninstalling, execute: rpm –e software.
  
    In addition, graphical RPM tools such as GnoRPM and kpackage are also provided in Linux, which makes the whole process easier. The specific application of these software will be introduced in another article.

Fifth, get the application packaged with deb

  This is a package manager provided by Debian Linux, which is very similar to RPM. But because RPM appeared earlier, it is common in various versions of Linux. The debian package manager dpkg only appears in Debian Linux, and other Linux versions generally do not. Here we briefly explain:

 1. Installation

        dpkg –i deb package name
      such as: dpkg –i software-1.2.3-1.deb

   2. Uninstall

         dpkg -e software name
  such as: dpkg -e software
    

===================================================================================

6. Software installation 

  ---- There are mainly two different forms of software installation under Linux. The first installation file is named filename.tar.gz. Another installation file is named filename.i386.rpm. Most software released in the first way is sent in source code form. The second way is to distribute directly in binary form. i386 means that the software is compiled according to the Inter 386 instruction set.
  ---- For the first one, the installation method is as follows:   ---- First, copy the installation files to your directory. For example, if you are logged in as root, copy the software to /root.   ---- #cp filename.tar.gz /root   ---- Since this file is compressed and packed, it should be decompressed. The command is:   ---- #tar xvzf filename.tar.gz   ---- After executing this command, the installation file will be decompressed in the current directory according to the path. Use the ls command to see the decompressed files. Usually there is a file named "INSTALL" in the resulting file after decompression. This file is a plain text file and details how to install the package.   ---- For most software that needs to be compiled, the installation method is basically the same. Execute an executable script program named configure generated after decompression. It is used to check whether the system has the library required for compilation, and whether the version of the library meets the needs of compilation and other system information required for installation. Prepare for subsequent compilation work. The command is:   ---- #./configure   ---- If an error is found during the inspection process, configure will give a prompt and stop the inspection. You can follow the prompts to configure the system. Execute the program again. After the check passes, a MakeFile file for compilation will be generated. At this point, you can start compiling. The compilation process takes different time depending on the size of the software and the performance of the computer. The command is: 
 
 
 
 


 

  ---- #make   ---- After successful compilation, type the following command to start the installation:   ---- #make install   ---- After the installation is complete, the temporary files generated during the compilation process and the files generated during the configuration process should be cleared. document. Type the following commands:   #make clean   #make distclean   At this point, the software installation is complete.   ---- For the second, the installation method is much simpler.   ---- Same as the first method, copy the installation files to your directory. Then use rpm to install the file. The commands are as follows:   ---- #rpm -i filename.i386.rpm   ---- rpm will automatically unpack the installation files and install the software to the default directory. And the software installation information is registered in the rpm database. The function of parameter i is to make rpm enter install mode.   ---- In addition, there are some commercial software under the Linux platform. In its installation file, there is the Setup installation program, and its installation method is the same as that under the Windows platform. Such as: Corel WordPerfect.   Uninstallation   of software----Uninstallation of software is mainly carried out using rpm. To uninstall a software, you must first know the name of the software package registered in the system. Type the command:   ---- #rpm -q -a   ---- to query all the software packages installed in the current system. The function of parameter q is to make rpm enter query command mode. The parameter a is a sub-parameter of the query mode, meaning all (ALL). There is a lot of information queried, which can be displayed on the less screen.   ---- Determine the name of the software to be uninstalled, you can start actually uninstalling the software. Type the command: 
 
 
 
 
 
 
 
 
 
 

 
 
 

 
  ---- #rpm -e [package name]   ---- to uninstall the software. The function of parameter e is to make rpm enter unload mode. Uninstall the package named [package name]. Because there are dependencies among the various software packages in the system. If it cannot be uninstalled due to dependencies, rpm will prompt and stop the uninstallation. You can use the following command to ignore dependencies and start uninstalling directly:   ---- #rpm -e [package name] -nodeps   ---- Ignoring the uninstallation of dependencies may make other software in the system unusable . You can use   ---- #rpm -e [package name] -test   ---- to make the rpm do a rehearsal of an uninstall, rather than an actual uninstall. This allows you to check if the software has dependencies. Is there an error during the uninstallation process. 

 
 
 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325210030&siteId=291194637
Recommended