How to install software in Linux

Source: Internet
Author: User
For Linux beginners, installing a very small software may be a headache, because installing software in Linux is not as simple as in Windows. In Linux, most software provides source code rather than ready-made executable files, which requires users to follow the actual situation of their systems and their own needs.

For Linux beginners, installing a very small software may be a headache, because installing software in Linux is not as simple as in Windows. In Linux, most software provides source code rather than ready-made executable files. This requires you to configure and compile the source program based on your system's actual situation and requirements, software can be used. Most beginners tend to blindly run some files with execution properties or mechanically run commands such as "make" and "make install" without knowing how to configure and compile them. What are the results? If the software is not installed, the system will suffer severe consequences and damage the stability of the system. Below I will write out some of the software installation rules to share with you.

Currently, popular software packages have two common forms: RPM and * .tar.gz. This article will discuss the installation methods of these two forms of software packages in the text environment and the graphic environment (X Window.


Software Installation in text environment


1. install a simple RPM Package

RPM is the abbreviation of RedHat Package Manager. it can only be used in systems with RPM software installed. it is already used in RedHat Linux and Turbo Linux. This structure of the package is very convenient to use, as long as you remember a few simple commands and parameters can be easily used:

#> Rpm [options] filename. rpm

Common options include:

-I: Install Software

-E: uninstall software.

-Q: check the software installation information and status.

-U: upgrade existing software

For example, when installing the software, run the following command: "rpm-I filename. rpm ", you do not need to worry about where and how the software is installed. RPM can help you manage it. Thanks to the ease of use of RPM, many software are available in the RPM version. If you want to use software in the RPM format, you must first download an RPM Management software. In. Installation method of the license package.


Install the tar.gz package compiled by Alibaba.

Due to the limited nature of the rpmpackage (rpmloud is installed, more software currently uses the source code in the form of .tar.gz package. The installation of such software usually involves decompression, software configuration, software compilation and installation.

There are usually two command methods to decompress: one is "gunzip filename-VERSION-OS.tar.gz | tar xvf-", which is essentially two commands "gunzip filename-VERSION-OS.tar.gz" and "tar xvf filename-VERSION-OS.tar "; the other is the tar xzvf filename-VERSION-OS.tar.gz ". Generally, a directory named filename-VERSION-OS is generated after the software is decompressed.

Software configuration, compilation, and installation are the most daunting tasks for beginners, but I think it is not difficult to master some rules. Generally, files named Readme, Rnstall, or Readme. install are generated in the decompressed directory. These files generally describe the features, features, copyright licenses, installation and related knowledge of the software, and refer to the installation methods and steps. For example, the following content is described in the install file of apache_1.3.6 (only the total entries are listed here, and the specific content is omitted ):

Installing the Apache 1.3 HTTP server with APACI

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

1. Overview for the impatient (general description of the configuration process)

$./Configure -- prefix = PREFIX

$ Make

$ Make install

$ PREFIX/bin/apachectl start

2. Requirements (required condition)

3. grouping the source tree (configuration parameter description)

4. Building the package (software compilation method)

5. Installing the package (software installation method)

6. Testing the package (software test)

After understanding and mastering these instructions, you can use some rules to install most software. These rules are also applicable to software that does not contain instructions (of course, this is rare. Generally, there are only two files directly related to the software installation: configure and Makefile.

The configure file has executable attributes and is used to configure the software. it has many parameters and is flexible in usage. Of course, different software parameters are also different. in this case, you need to use the help parameter to run the following command to make you feel open-minded:

#>./Configure-help

Usage: configure [options]

Options: [defaults in brackets after descriptions]

General options:

-- Quiet, -- silent do not print messages

-- Verbose,-v print even more messages

-- Sha [= DIR] switch to a shadow tree (under DIR) for building

Stand-alone options:

-- Help,-h print this message

-- Show-layout print installation path layout (check and debug)


Gnome running interface

Installation layout options:

-- With-layout = [F:] ID use installation path layout ID (from file F)

-- Target = TARGET install name-associated files using basename TARGET

......

Next, you can run "./configure [options]" to configure the software. Note: /"is very important, it tells the system to run the command in the current directory (otherwise the system will go to the path specified by the $ path variable to execute the command ). After executing the command, you can generate a Makefile file or modify the configuration of an existing file.

Makefile files are usually used to compile and install software. When running the make command, the system automatically compiles and installs the software based on the settings in the Makefile file. The make command can sometimes contain parameters such as all, build, config, and install. For specific parameters, see Makefile. In Linux, most of the files are text files, and Makefile is a shell program (the shell program in Linux has many similarities with the batch processing files in DOS, of course, the function is much stronger), which is easy to understand, in particular, the parameters that can be included during compilation are clearly written, for example:

##====================================

# Targets

##====================================

# Default target

All: build

##------------------------

# Build Target

##------------------------

# Build the package

Build:

......

# The non-verbose variant for package maintainers

Build-quiet:

@ $ (MAKE)-f $ (TOP)/$ (MKF) $ (MFLAGS) $ (MFWD) QUIET = 1 build

# Build the additional support stuff

Build-support:

......

##------------------------

# Installation Targets

##-----------------------

# The install target for installing the complete Apache

# Package. This is implemented by running subtargets for

# Separate parts of the installation process.

Install:

......

# The non-verbose variant for package maintainers

Install-quiet:

@ $ (MAKE)-f $ (TOP)/$ (MKF) $ (MFLAGS) $ (MFWD) QUIET = 1 install

# Create the installation tree

Install-mktree:

......

The above code is part of the Makefile file of apache_1.3.6. from this code, we can see that the all parameter indicates full compilation (default parameter ). In addition, you can also include parameters such as build, build-quiet, and build-surpport during compilation. you can also include parameters such as install, install-quiet, and install-surpport during installation. Their functions are described in the notes. It should be noted that some software (such as the Linux Kernel upgrade program) does not need the configure command to configure the software, but uses make config to complete this work, which method should be used to analyze specific issues.


Software Installation in Gui


In a graphic environment, a simulation terminal can also pop up to install software in text mode, but that is too stupid, because there are some simple methods in X Window to help you complete software installation. Next I will introduce RedHat 6.0 as an example.

Install the .tar.gz package under the graphic interface

In X Window, the installation of this form of package is not very simplified, but it is easier to extract the software. The system will automatically generate a directory --filename.tar.gz # utar by clicking the software package that you want to install with the mouse on the left. the directory contains the file name you want to extract. Copy the directory to the directory you want to decompress. the extraction is done simply. However, the rest of the work is to bring up a simulation terminal to complete in text.

II. install the RPM package on the GUI

It is too easy to install, upgrade, uninstall, and query an RPM Package in X Window. Taking Redhat 6.0 as an example, there is a Gnome RPM software in its X Window that can complete all the work mentioned above.

Click Start> System> GnomeRPM to run the software. It divides the installed software in RPM package into several tree directories, including Amusements, Application, Development, Document, Extension, Extentions, Networking, System Environment, UserInterface, and X11 by function, each directory contains the corresponding file icon and name. To install or upgrade the software, you only need to click the corresponding button in the toolbar to pop up the open file dialog box, select the RPM file you want to install, and click the "OK" button; when you Uninstall the software, find the software icon by category, right-click it, and select Uninstall. If you search for files in Win 95/98, it is not difficult to find installed software in Linux. This software can go below

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.