Software Installation under Linux

Source: Internet
Author: User

First, the software installation on Linux

Typically, there are four main ways to install software on Linux:

    • Online installation
    • Installing the de package from disk
    • Installing from a binary package
    • Compiling the installation from source code

Second, on-line installation

There are some differences between the online installation methods on different Linux distributions, including the commands used and their package management tools, for example in Ubuntu.

1. Try it first

For example, we want to install a software, called w3m (w3m is a command line of the simple Web browser), then enter the following command:

$ sudo apt-get install w3m

$ w3m Www.shiyanlou.com/faq

Note : If you cannot immediately use the TAB completion command after installing a software, you can try to execute the source ~/.ZSHRC first, and then you can use the complement operation.

2. Apt Package management tool Introduction

APT is the abbreviation for the Advance Packaging tool (advanced packaging tools) and is the package manager for Debian and its derived distributions, and apt can automatically download, configure, install binary or source-code packages, thus simplifying the process of managing software on UNIX systems. Apt was originally designed as the front end of the dpkg to handle packages in the Deb format. Now that the APT-RPM organization has been modified, APT can be installed in the RPM-enabled system management RPM package. This Package Manager contains several tools that start with apt-, such as Apt-get Apt-cache apt-cdrom, etc., used in the Debian series release.

When you perform the installation operation, first the Apt-get tool searches the local database for information about the w3m software and downloads the software installation on the relevant server based on that information, and here are a few questions: since it is an online installation of the software, Why search in a local database? This involves several nouns:

    • Software source mirror server
    • Software source

We need to periodically download a list of packages from the server and use the sudo apt-get Update command to keep the local package list up to date (sometimes you also need to do this manually, such as replacing the software source), and this table will have a record of the software dependency information. For software dependencies, for example: we install w3m software, and this software needs LIBGC1C2 this package to work properly, this time Apt-get install the software will be installed for us, to ensure that w3m can work properly.

3.apt-get

Apt-get uses common assemblies for handling apt packages, which we can use to install, uninstall, and upgrade packages online, and the following are some of the common tools that Apt-get contains:

Tools

Description

Install

followed by a package name for installing a package

Update

Download/update the list of packages used to update the local software source from the software source mirror server

Upgrade

Upgrade all locally updatable packages, but will not upgrade if there is a dependency problem and will typically perform an update before updating

Dist-upgrade

Resolve Dependencies and upgrade (there is a risk)

Remove

Remove installed packages, including packages that are dependent on the removed package, but do not contain a configuration file for the package

Autoremove

Remove packages that were previously dependent on other packages but are no longer being used

Purge

Same as remove, but completely removes the package, including its configuration file

Clean

Remove the installed packages that are downloaded to the local, which are saved by default in/var/cache/apt/archives/

AutoClean

Remove older versions of installed software packages

Here are some of the parameters commonly used by Apt-get:

Parameters

Description

-Y

It is useful to use this parameter in some automated installation scripts to automatically respond to the option to install packages.

-S

Analog installation

-Q

Silent installation, specifying multiple Q or-q=#, #表示数字, used to set the level of silence, which is useful when you don't want to have too much screen output when installing packages

-F

Repairing a corrupted dependency

-D

Download-Only not installed

--reinstall

Reinstall installed packages that may have problems

--install-suggests

Install the recommended package installed by apt at the same time

4. Install the Package

A lot of times we need to reinstall a package, such as your system is compromised, or some bad configuration causes the software to not work properly.

You can reinstall it in the following ways:

$ sudo apt-get--reinstall install w3m

The other one you need to know is how to install the package without knowing the full name of it. Usually we use the TAB key to complete the package name.

5. Software upgrades

# Update the software source

$ sudo apt-get update

# Upgrade packages with no dependency issues

$ sudo apt-get upgrade

# Upgrade and resolve dependencies

$ sudo apt-get dist-upgrade

6. Uninstalling the Software

sudo apt-get remove w3m, the system will have a confirmed operation, then the software will be uninstalled.

Or, you can perform

# do not preserve the removal of configuration files

$ sudo apt-get purge w3m

# or

sudo apt-get--purge Remove

# Remove dependent packages that are no longer needed

$ sudo apt-get autoremove

7. Software Search

When you just know a software, want to download the use, need to confirm the software warehouse inside there is no, you need to use the search function, the command is as follows:

sudo apt-cache search softname1 softname2 softname3 ...

The Apt-cache command is a tool for related operations on local data, and search, as the name implies, searches the local database for softname1 softname2 ... Information about the relevant software.

Iii. installing the Deb package from a local disk using dpkg

1.DPKG Introduction

Dpkg is the foundation of the Debian Package Manager, which was created in 1993 by Ian Murdock. The dpkg is very similar to RPM and is also used to install, unload, and supply information related to. deb packages.

Dpkg itself is a bottom-level tool. The upper-level tools, like APT, are used to remotely retrieve packages and handle complex package relationships. "Dpkg" is a shorthand for "Debian package".

We often have packages that can be packaged in a simple form of Deb on the network and need to be installed using the dpkg command.

Dpkg Common Parameters Introduction:

Parameters

Description

-I.

Install the specified Deb package

-R

followed by a directory name for installing all of the Deb installation packages in this directory

-R

Remove, removing an installed package

-I.

Displays information about the Deb package file

-S

Display information for installed software

-S

Search for installed Packages

-L

Display directory information for installed packages

2. Install the Deb package using dpkg

We first use the Apt-get plus-d parameter only download not installed, download the Emacs Editor's Deb package, after the download is complete, we can view the contents of the/var/cache/apt/archives/directory.

Then we copy the first deb to the home directory and use dpkg to install

$ cp/var/cache/apt/archives/emacs24_24.3+1-4ubuntu1_amd64.deb ~ # before installing see Deb package information $ sudo dpkg-i emacs24_24.3+1-4ubuntu1_ Amd64.deb

As you can see, this package is also dependent on a few packages, which means that if the host does not currently have these dependent packages, there may be some problems with using the DPKG installation directly, because DPKG does not resolve dependencies for you.

# use dpkg to install $ sudo dpkg-i emacs24_24.3+1-4ubuntu1_amd64.deb

As expected, here you may have some errors:

To fix this error, this is going to be apt-get, using its-f parameter, fixing the dependency installation

$ sudo apt-get-f Install

Without any errors, so that we install successfully, then you can run the Emacs program

3. View the installation directory for installed packages

If you're still struggling with where Linux is installing the software, then you're lucky you'll be able to find the answer through DPKG.

Using Dpkg-l to view the Deb package directory information

$ sudo dpkg-l emacs

Iv. installing from a binary package

Binary package installation is relatively simple, all we need to do is to unzip the binary package downloaded from the network and put it into the appropriate directory, and then add the directory containing the executable main program files into the PATH environment variable.

Software Installation under Linux

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.