Linux (i) Software Installation

Source: Internet
Author: User
Tags bz2 prepare unpack

Introduction: When installing software in Linux, we often have to consider such a few issues:

(1). How to install the software;
(2). Where the software is installed;
(3). How to uninstall the deleted software ...

Let's take a look at these issues together.



  I. Understanding the Linux application Software installation package

There are typically three installation packages for Linux applications:

1) Tar packages, such as software-1.2.3-1.tar.gz. It is packaged using a UNIX-system packaging tool, tar.
2) RPM packages, such as software-1.2.3-1.i386.rpm. It is a package encapsulation format provided by Redhat Linux.
(now the full name is RPM Package Manager, formerly called Redhat Package Manager)
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 packages are named with a certain regularity, which follows:
Name-version-Fixed version-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
Fixed version: 1
Available platforms: I386 for the Intel 80x86 platform.
Type: RPM, description is a RPM package.

Note: Because the RPM format is usually a compiled program, you need to specify the platform. It will be explained in more detail later.


   Second, understand the contents of the package:

A Linux application package can contain two different types of content:

1) One is an executable file, that is, after you unpack the package, you can run it directly. All packages in Windows are of this type. After installing this program, you can use it, but you can't see the source program. Also, please note that the software is the platform you use, otherwise it will not install properly.

2) The other is the source program, and after you unpack the package, 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 open source programs.

In general, it is the source program that is packaged with tar, while the RPM and dpkg are often executable programs. In general, self-compiled source programs can be more flexible, but also easy to encounter a variety of problems and difficulties. Instead, downloading those executable packages makes it easier to install the software, and of course, that's a lot less flexible. So generally a software will always provide a variety of packaging format of the installation program. You can choose according to your own situation.

  
several installation commands are described:

   First, RPM package installation method steps:

1, find the corresponding package, such as soft.version.rpm, download to the local directory;

2, open a terminal, Su-into the root user;

3, the CD soft.version.rpm is located in the directory;

4. Input RPM-IVH soft.version.rpm



Detailed Description:

1. Installation:
I just need a simple word, I can say it. Perform:
RPM–IVH RPM Package Name
For more advanced, see the following table:
RPM parameter Description
-I installation software
-t test installation, not really installed
-P Display Installation progress
-F Ignore any errors
-U Upgrade Installation
-V detection kit is installed correctly

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

2. Uninstall:
I just need a simple sentence to finish. Perform:
Rpm–e Software Name
ButNote that the software name, not the package name, is used later。 For example, to install software-1.2.3-1.i386.rpm This package, you should do the following:
RPM–IVH software-1.2.3-1.i386.rpm
When uninstalling, you should do the following:
Rpm–e software.
In addition, graphical RPM tools like gnorpm, KPackage, etc. are also available in Linux, making the process easier.



   Second, the Deb package installation method steps:

1, find the corresponding package, such as Soft.version.deb, download to the local directory;
2, open a terminal, Su-into the root user;
3, the CD Soft.version.deb is located in the directory;
4. Input Dpkg-i Soft.version.deb

Detailed Description:

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

However, because RPM appears earlier, it is often seen in various versions of Linux.

The Debian Package Manager dpkg only appears in Debina Linux, and no other Linux versions are available.

1. Installation

Dpkg–i Deb's package name

such as: Dpkg–i Software-1.2.3-1.deb

2. Uninstall

Dpkg–e Software Name

such as: Dpkg–e software

3. Query: Query the current system installed packages:

Dpkg–l ' * Package name * '

such as: Dpkg–l ' *software* '



   Three, tar.gz source code Package installation method:

1, find the corresponding package, such as soft.tar.gz, download to the local directory;

2, open a terminal, Su-into the root user;

3, the CD soft.tar.gz is located in the directory;

4, TAR-XZVF soft.tar.gz//general will generate a soft directory

5. CD Soft

6,./configure

7. Make

8. Make Install

Detailed Description:

1. Installation:

The entire installation process can be divided into the following steps:

1) Obtain the application software: by downloading, purchase the CD-ROM method obtains;

2) Unzip the file: General tar package, will do one more compression, such as gzip, bz2, etc., so you need to extract first. If it is the most common GZ format, you can do the following: "TAR–XVZF package Name", you can complete the decompression and unpacking work in one step. If not, the first with the decompression software, and then perform "TAR–XVF decompression after the tar package" to unpack;

3) Read the attached install file, Readme file;

4) Execute the "./configure" command to prepare for the compilation;

5) Execute the "make" command to compile the software;

6) perform "Make install" to complete the installation;

7) perform "Make clean" to remove temporary files from installation.

Well, that's it. So we can run the application. But then, some readers will ask, how do I do it? This is also a Linux feature problem. In fact, in general, the Linux application software executable files will be stored in the/usr/local/bin directory! But this is not the "all-in-one" truth, the most reliable or look at the software's install and readme files, generally will be explained.

2. Uninstall:

Usually software developers rarely consider how to uninstall their own software, and tar is only to complete the packaging work, so does not provide a good way to uninstall.

So is it not possible to uninstall it! In fact, there are two software to solve this problem, that is kinstall and kife, they are the TAR package installed, uninstall the Gold partner.

Attention:

./configure is the first step in the source code installation, and the main purpose is to configure the software to be installed, to check whether the current environment meets the dependencies to install the software,

But not all the tar package is the source code of the package, the landlord can see if LS configure this file, perhaps you are under the binary package, if it is a binary package,

It can be used directly after decompression. (for example, the previous article installs the Firefox browser Flash plugin, the downloaded. tar.gz compression package does not configure this file)


   Four, tar.bz2 source code Package installation method:

1, find the corresponding package, such as soft.tar.bz2, download to the local directory;

2, open a terminal, Su-into the root user;

3, the CD soft.tar.bz2 is located in the directory;

4, TAR-XJVF soft.tar.bz2//general will generate a soft directory

5. CD Soft

6,./configure

7. Make

8. Make Install



   Five, APT installation: (Install Deb package)

1, open a terminal, Su-into the root user;

2, Apt-cache search Soft Note: Soft is the name of the software you are looking for or related information

3. If the software soft.version is found in 2, install the software with the Apt-get install soft.version command

Note: As long as you can surf the Internet, only need to use Apt-cache search to find software, with Apt-get install software

Detailed Description:

Apt-get is a package management tool for the Debian,ubuntu release, very similar to the Yum tool in Red Hat.

Apt-get commands generally require root permission to execute, so follow the sudo command example sudo apt-get xxxx

Apt-get Install a new package packagename--(see aptitude below)

Apt-get Remove packagename--Uninstall an installed package (keep config file)

Apt-get--purge Remove packagename--Uninstall an installed package (delete configuration file)

dpkg--force-all--purge packagename--Some software is difficult to uninstall, but also to prevent the application of other software, you can use this, but a bit risky.

Apt-get autoremove--because apt will back up the installed or unloaded software on the hard drive, if you need space, you can allow this command to delete the software you have deleted.

Apt-get autoclean--Run this command periodically to clear the. deb file for the packages that have been uninstalled. In this way, you can free up a lot of disk space. If the demand is urgent, you can use apt-get clean to free up more space. This command will remove the. deb file that has the software package installed.

Apt-get clean--This command will also remove the backup of the installed software, but this will not affect the use of the software.

Apt-get upgrade--Update all installed packages

Apt-get dist-upgrade--upgrading the system to a new version

Apt-cache search string--searching for strings in the package list

Apt-cache showpkg pkgs--Displays package information.

Apt-cache stats--See how much software is in the library

Apt-cache dumpavail--Print the list of available packages.

Apt-cache Show pkgs--shows the package record, similar to Dpkg–print-avail.

Apt-cache pkgnames--The name of all packages in the Print packages list

(You need to run this command regularly to ensure that your package list is up to date.)

Simply put: 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,

It also automatically handles dependencies between packages and packages, which is not available in the Dpkg tool.

  

Six, yum mode installation: (Install RPM package)

RPM is a software package name for Linux that ends in. RMP and is installed with the following syntax: RPM-IVH.

RPM Package installation has a big drawback is that the file is too large, sometimes installed a software to install a lot of other packages, very troublesome.

So Redhat Little Red Hat developed the Yum installation method, he can completely solve the problem of relevance, very convenient, as long as the configuration of two files can be installed, installation method is: Yum-y install.

Yum is not a package, but the software that installs the package

Simply put: RPM can only install RPM packages that have already been downloaded to the local machine. Yum can download and install RPM packages online, update the system,

It also automatically handles dependencies between packages and packets, which is not available in the RPM tool.



   Seven, bin file installation:

If the name of the software you downloaded to is Soft.bin, which is generally an executable file, the installation method is as follows:

1, open a terminal, Su-into the root user;

2, chmod +x Soft.bin

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

  
Eight, do not need to install the software:

Some software, such as LUMAQQ, does not need to be installed and can be run directly after the JRE is extracted. Assume

The download is lumaqq.tar.gz, using the following method:

1, open a terminal, Su-into 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 LUMAQQ This program file to be run

5, at this time can run Lumaqq, with the command./lumaqq, but each time you run to enter the full path or

Switch to the LUMAQQ directory you just generated.

6, in order to ensure that you do not set the path can be used, you can set up a lumaqq link in the/bin directory,

With the command ln-s lumaqq/bin/, you can open a terminal input lumaqq at any time.

Start the QQ chat software

7, if you want to lumaqq a menu item, use the menu editing tools, such as Alacarte menu

Editor, find the Lumaqq in the generated Lumaqq directory above to set a menu item on it, of course you

You can also go directly to the/usr/share/applications directory, according to the other *.desktop files inside the grid

To generate a desktop file of your own.


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

installation of software

   There are two main types of software installation----Linux. The first installation file is named filename.tar.gz. The other installation file is named filename.i386.rpm. Most of the software released in the first way is sent in the form of source code. The second approach is distributed directly in binary form. i386 means that the software is generated by compiling the Inter 386 instruction set.

----for the first type, the installation method is as follows:

----First, copy the installation files to your directory. For example, if you are logged on as root, copy the software to/root.

----#cp Filename.tar.gz/root

----Because the file is compressed and packaged, it should be uncompressed. The command is:

----#tar Xvzf filename.tar.gz

----After the command is executed, the installation files are extracted in the current directory by path. You can see the extracted files with the LS command. Files that are usually named "INSTALL" are in the resulting file after decompression. This file is a plain text file, detailing how the package is installed.

----for most software that needs to be compiled, it is installed in much the same way. An executable script named Configure that was produced after the decompression was performed. It is used to check whether the system has a library that is required for compilation, and whether the version of the library meets the required system information for installation such as compilation. Prepare for the subsequent compilation work. The command is:

----#./configure

----If an error is found during the inspection, configure will give a hint and stop the check. You can follow the prompts to configure the system. Then re-execute the program. After the check passes, the makefile file is generated for compilation. At this point, you can start compiling. The process of compiling depends on the size of the software and the performance of the computer, and the time spent is different. The command is:

----#make

After the----compiles successfully, type the following command to start the installation:

----#make Install

----The installation is complete, you should clear the files generated during the compilation process and the temporary files generated during the configuration process. Type the following command:

#make Clean

#make Distclean

This concludes the installation of the software.

----for the second, the installation method is much simpler.

----the same as the first way, copy the installation files 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 files and install the software into the default directory. and register the installation information of the software in the RPM database. The function of the parameter i is to get the RPM into the installation mode.

----In addition, there are some commercial software under the Linux platform. In its installation file, there is the setup installer, which is installed in the same way as the Windows platform. such as: Corel WordPerfect.

Uninstalling the Software  

  The uninstallation of----software is mainly done using RPM. To uninstall the software, first know the name of the package registered in the system. Type the command:

----#rpm-Q-A

----can query to all packages installed on the current system. The function of parameter q is to make RPM into query command mode. Parameter A is a sub-parameter of the query pattern, meaning all. More information is available and can be displayed using the less person screen.

----Determine the name of the software to be uninstalled, you are ready to actually uninstall the software. Type the command:

----#rpm-E [package name]

You can uninstall the software----. The function of the parameter e is to allow the RPM to enter the Unload mode. Uninstall the package named Packages name. Because of the dependencies between the various packages in the system. If there is a dependency that cannot be uninstalled, RPM will give you a hint and stop uninstalling. You can use the following command to ignore dependencies and start unloading directly:

----#rpm-E [package name]-nodeps

Unloading----ignoring dependencies may cause other software in the system to be unusable. You can use

----#rpm-E [package name]-test

----Let RPM do an uninstall preview instead of actually uninstalling it. This will allow you to check if the software has dependencies. Whether there are errors during the uninstallation process.

Original text:http://blog.sina.com.cn/s/blog_5d9de9950102x7z5.html

Linux (i) Software Installation

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.