Introduction to Linux installation commands

巴扎黑
Release: 2017-08-05 14:37:19
Original
2012 people have browsed it

There are generally three common installation methods:

1. Graphical interface installation: synaptic software management (seems to be all deb Package)

2. Terminal command line mode. Install source packages (tar, Z, gz, bz2, tar.gz, tar.bz2, tar.Z, rar, zip), rpm packages, deb packages (see details below)

3. Terminal apt Way. (They all seem to be deb packages) The packages downloaded through apt-get are stored in /var/cache/apt/archives.

Others that do not need to be installed, such as bin files, just need to change the usage permissions

There are also three corresponding uninstall methods:

1. It is very easy through the simple graphical interface of Synaptic Package Manager

. Find the software package you want to remove and click Remove.

2. Command line removal method

1) Source package:

(Premise: The uninstall program has been written in the source package)

make uninstall


2) dpkg method:
Removable uninstall: dpkg -r xxx
Purge uninstall: dpkg -P xxx

3) rpm mode:
rpm -e xxx

3, apt command
Removal uninstallation, remove the software package: apt-get remove xxx
Clear uninstallation, uninstall the configuration related to the software installation together: apt-get - -purge remove xxx

How to install software under LINUX Command method

How to install application software?
Where is my software installed?
How to delete unwanted applications?
  ……
  Now, let’s take a look at these issues together.
 
1. Analysis of Linux application software installation packages:
Usually there are three types of Linux application software installation packages:
1) tar package, such as software-1.2.3-1.tar.gz. It is packaged using tar, the packaging tool of 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 packaging format provided by Debain Linux.
Moreover, the naming of most Linux application software packages also has certain rules, which follow:
Name-version-revision-type
For example:
1) software-1.2.3-1. tar.gz means:
Software name: software
Version number: 1.2.3
Revision version: 1
Type: tar.gz, indicating that it is a tar package.
2) sfotware-1.2.3-1.i386.rpm
Software name: software
Version number: 1.2.3
Revision version: 1
Available platforms: i386, suitable for Intel 80x86 platform.
Type: rpm, indicating that it is an rpm package.
Note: Since the rpm format is usually a compiled program, the platform needs to be specified. This will be explained in detail later.
There’s no need to talk about software-1.2.3-1.deb! Everyone, practice it yourself.
2. Understand the contents of the package:
A Linux application software package can contain two different contents:
1) One is the executable file, which means you can unzip the package. run directly. All software packages in Windows are of this type. After installing the program, you can use it, but you cannot see the source program. And when downloading, please pay attention to whether the software is for the platform you are using, otherwise it will not be installed normally.
  2) The other is the source program, that is, after unpacking it, you need to use a compiler to compile it into an executable file. This is almost non-existent in Windows systems, because the idea of ​​Windows is not to open source programs.
Usually, those packaged with tar are source programs; while those packaged with rpm or dpkg are often executable programs. Generally speaking, compiling source programs by yourself can provide more flexibility, but it is also easy to encounter various problems and difficulties. Relatively speaking, downloading those executable packages makes it easier to install the software, but of course the flexibility is much less. Therefore, generally a software will always provide installation programs in multiple packaging formats. You can choose according to your own situation.
3. Get the application software packaged with tar
1. Installation:
The entire installation process can be divided into the following steps:
1) Obtain the application software: obtain it by downloading and purchasing a CD;
 2) Decompress the file: Generally, tar packages will be compressed again, such as gzip, bz2, etc., so you need to decompress them 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 decompression software first, and then execute "tar –xvf decompressed tar package" to unpack;
3) Read the attached INSTALL file and README file;
4) Execute "./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 the installation document.
Okay, you’re done. We can now run the application. But at this time, some readers will ask, how do I execute it? This is also a Linux-specific problem. In fact, generally speaking, the executable files of Linux application software will be stored in the /usr/local/bin directory! However, this is not a "one-size-fits-all" truth. The most reliable thing is to look at the INSTALL and README files of the software, which usually have instructions.
 2. Uninstallation:
Usually software developers seldom consider how to uninstall their own software, and tar only completes the packaging work, so it does not provide a good uninstallation method.
Does that mean it can’t be uninstalled? In fact, no, there are two software that can solve this problem, namely Kinstall and Kife. They are golden partners for installing and uninstalling tar packages. The author will introduce their usage in a separate article. I won’t go into details here.
4. Get application software packaged using rpm
rpm is a major contribution of Redhat, which makes Linux software installation simpler and easier.
 1. Installation:
  I only need a simple sentence to finish. Execution:
rpm –ivh rpm package name
For more advanced ones, please see the table below:
rpm parameter parameter description
-i Install software
-t Test installation, not real installation
-p Display installation progress
-f Ignore any Error
 -U upgrade installation
 -v check whether the package is installed correctly
  These parameters can be used at the same time. For more information, please refer to the RPM command help.
  2. Uninstall:
  I can finish it with just one simple sentence. Execution:
rpm –e software name
However, it should be noted 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, you should execute:
​ rpm –ivh software-1.2.3-1.i386.rpm
When to uninstall, you should execute :
  rpm –e software.
 
 
 In addition, Linux also provides graphical RPM tools such as GnoRPM and kpackage, making the whole process easier. The specific applications of these software will be introduced by the author in a separate article.

5. Get applications packaged using deb
 
This is a package manager provided by Debian Linux, which is very similar to RPM. But because RPM appeared earlier, it is commonly seen in various versions of Linux. Debian's package manager dpkg only appears in Debina Linux, and is generally not available in other Linux versions. We will briefly explain it here:
 
  1. Installation
  dpkg –i deb software package name
  For example: dpkg –i software-1.2.3-1.deb
  2. Uninstall
   dpkg –e software name
   For example: dpkg –e software
  Okay, that’s all, I hope it can help everyone find the answer. If you have any questions, please ask in [url]www.linuxaid.com.cn/bbs/[/url] "Installation and Getting Started" version, or email to: [email]fjxufeng@linuxaid.com.cn[/email ].
================================================ ====================================
Software installation
 ----Linux There are two main different forms of software installation. The first installation file is named filename.tar.gz. The alternative installation file is named filename.i386.rpm. Most of the software released in the first way is sent in source code form. The second method is to distribute it directly in binary form. i386 means 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 are logged in as root, copy the software to /root.
 ---- #cp filename.tar.gz /root
 ---- Since the file is compressed and packaged, 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 file. Usually among the files generated after decompression, there is a file named "INSTALL". This file is a plain text file that details how to install the software package.
 ---- For most software that needs to be compiled, the installation methods are generally the same. Execute an executable script called configure generated after decompression. It is used to check whether the system has the libraries 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 check, configure will give a prompt and stop the check. You can follow the prompts to configure the system. Run the program again. After the check passes, the MakeFile file used for compilation will be generated. At this point, compilation can begin. 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
 ---- The installation is complete, Temporary files generated during compilation and files generated during configuration should be cleared. Type the following command:
 #make clean
 #make distclean
At this point, the software installation is completed.
 ---- For the second type, the installation method is much simpler.
 ----Same as the first method, copy the installation file to your directory. Then use rpm to install the file. The command is as follows:
 ---- #rpm -i filename.i386.rpm
 ---- rpm will automatically unpack the installation file and install the software to the default directory. And register the software installation information into the rpm database. The function of parameter i is to make rpm enter installation mode.
 ---- In addition, there are some commercial software under the Linux platform. In its installation file, there is a Setup installation program, and its installation method is the same as that on the Windows platform. Such as: Corel WordPerfect.
Uninstallation of software
---- Software uninstallation is mainly performed using rpm. To uninstall software, you must first know the name of the software package registered in the system. Type the command:
 ---- #rpm -q -a
 ---- to query all software packages installed in the current system. The function of parameter q is to make rpm enter query command mode. Parameter a is a sub-parameter of the query mode, meaning all (ALL). If the queried information is large, it can be displayed on the less human screen.
 ----After determining the name of the software to be uninstalled, you can start to actually uninstall the software. Type the command:
 ---- #rpm -e [package name]
 ---- to uninstall the software. The function of parameter e is to make rpm enter uninstall mode. Uninstall the software package named [package name]. Because there are dependencies between various software packages in the system. If it cannot be uninstalled due to dependencies, rpm will give a prompt and stop the uninstallation. You can use the following command to ignore dependencies and start uninstalling directly:
 ---- #rpm -e [package name] -nodeps
 ---- Uninstalling while ignoring dependencies may cause other problems in the system This software cannot be used. You can use
 ---- #rpm -e [package name] -test
 ---- to make rpm perform an uninstall preview instead of actually uninstalling. This allows you to check whether the software has any dependencies. Are there any errors during the uninstallation process?

(2)

For the benefit of people new to Linux, I have written a generic explanation of howto install software in Linux. Note that some software may have specific installation procedures, this HOWTO is not a substitute for reading the official installation documentation

This HOWTO covers the following topics:

##Command-line process:

  • Compiling and Installing software from source

  • Installing RPM's using the Redhat Package Manager

  • Installing using Debian's apt-get

  • Installing mandrake things

  • Installing with fedora / yum

  • ## Installing slackware packages
  • Installing software using Gentoo EMerge
  • ##Installing binary files (.BIN/.SH)
  • Installing .package Files (AutoPackage)
##Graphical (GUI) process:



Using Synaptic (Fedora, Ubuntu)

  • Using YaST2 (SuSE, openSuSE)

  • ... ...

(3)


Summary of software installation methods under Linux:


一, rpm package installation method steps:

1. Find the corresponding software package, such as soft.version.rpm, download it to a directory on the local machine;

2. Open a terminal, su - Become the root user;

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

4. Enter rpm -ivh soft.version.rpm

2. Steps to install the deb package:

1. Find the corresponding software package, such as soft.version.deb, and download it to a directory on your local machine;

2. Open a terminal, su - Become the root user;

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

4. Enter dpkg -i soft.version.deb

3. Installation method of tar.gz source code package:

1. Find the corresponding software package, such as soft.tar.gz, and download it to a directory on the local machine;

2 , open a terminal, su - to become the root user;

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

4, tar -xzvf soft.tar.gz //generally generated A soft directory

5, cd soft

6, ./configure

7, make

8, make install

4. Installation method of tar.bz2 source code package:

1. Find the corresponding software package, such as soft.tar.bz2, and download it to a directory on the local machine;

2. Open a terminal, su - to become the root user;

3. cd the directory where soft.tar.bz2 is located;

4. tar -xjvf soft.tar.bz2 //General A soft directory

5, cd soft

6, ./configure

7, make

8, make install

## will be generated.

#5. Installation in apt mode:

1. Open a terminal, su - become the root user;

2. apt-cache search soft Note: soft is what you want The name or related information of the software you are looking for

3. If the software soft.version is found in 2, use the apt-get install soft.version command to install the software. Note: As long as you can access the Internet, you only need to use apt- cachesearch to find software, use apt-get install software

6. Bin file installation:

If the name of the software you download is soft.bin, usually it is Executable file, the installation method is as follows:

1. Open a terminal, su - to become the root user;

2. chmod +x soft.bin

3, ./ soft.bin //Run this command to install the software

/************About this document************ *************************************

*filename: Summary of software installation methods under Linux

*purpose: Summarizes various software installation methods under Linux

*wrote by: zhoulifa(zhoulifa@163.com) Zhou Lifa(http://zhoulifa.bokee.com)

Linux enthusiast Linux knowledge disseminator SOHO developers are best at C language programming

*date time:2006-07-26 18:10:00

*Note: Anyone can do anything Copy the code and use these documents for your commercial purposes

* but please follow the GPL.

*Hope: I hope that more and more people will contribute their own strength and contribute to the development of science and technology

****************** *************************************************** */

7. Software that does not need to be installed:

There are some software, such as lumaqq, that do not need to be installed. You can directly decompress the jre that comes with it run. Assume that you downloaded lumaqq.tar.gz. The usage method is as follows:

1. Open a terminal and su - become the root user;

2. tar -xzvf lumaqq.tar.gz // This step will generate a directory called LumaQQ

3, cd LumaQQ

4, chmod +x lumaqq //Set the lumaqq program file to be runnable

5, this Then you can run lumaqq, just use the command ./lumaqq, but every time you run it, you need to enter the full path or switch to the LumaQQ directory just generated

6. In order to ensure that it can be used without setting the path, you You can create a lumaqq link in the /bin directory and use the command ln -s lumaqq /bin/. In the future, you can start the QQ chat software by opening a terminal and entering lumaqq at any time.

7. If you want If you want lumaqq to have a menu item, use a menu editing tool, such as AlacarteMenu Editor, and find lumaqq in the LumaQQ directory generated above to set a menu item. Of course, you can also go directly to the /usr/share/applications directory and follow the other instructions in it. Just generate your own desktop file in the format of *.desktop file.

It is recommended that developers do not use first-generation Linux operating systems such as red hat/red flag/suse. Using these is not only convenient (that is, more fool-like) but also has a more luxurious interface. Nothing good. Use debian/ubuntu or other second generation software. The apt command is the easiest to install software. The apt command will automatically solve dependency issues during software installation, install packages that are not available, and automatically upgrade packages with lower versions. Of course, this requires your confirmation.

If you use the first generation Linux system such as RedHat, installing software is more troublesome. rpm-ivh softA.rpm is used to install softA software, but usually the problems you may encounter are prompts It says that you need to install a bunch of software such as softB1, softB2, softB3, etc., and then when you install the softB1 software package, you may be prompted to say that you need to install a bunch of software such as softC1, softC2, softC3, softC4... In this way, you only have enough time. I've been looking for these packages everywhere. If it is not on the CD, you have to download it online, and you have to search online for a long time, and all your time is spent searching for software packages. And even if you find these software packages, you may still encounter a problem: the softC2 software package must be installed before the softC1 software package. If the order is wrong, the installation will not be successful. But who knows? It's difficult. So, you don’t have time to install and experience the software’s features, let alone develop the software.

It is recommended that you install the second generation Linux operating system, typically Debian Linux and Ubuntu Linux. I mentioned a concise explanation in the article "How to install the Linux operating system on a computer with a Windows operating system" before. Installation manual, you can download and follow the instructions to install Ubuntu.

The second-generation operating system is quite simple in terms of installing software: the first step is to search for the software you want. For example, if you are looking for a game software, its name is myward. The description of this game software is: my own war game. To search for this software package, you only need to enter the command apt-cache search myward, or enter part of the software name apt-cache search war, or if you do not know the software name, enter part of the text apt-cache search game in the software description, you can find it. After finding the software, proceed to the second step. You only need to enter apt-get install myward, followed by the name of the software to install it.

I am engaged in program development. I don’t hope that I can only search for things on Google. I hope to have more time to study the Linux kernel.

The above is the detailed content of Introduction to Linux installation commands. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!