Software Installation under Ubuntu

Source: Internet
Author: User

Usually installed on Linux software installation method:

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

Each of these methods has advantages and disadvantages, the following introduction of the first three.

First, online installation

Usually when we use Windows to install software, we need to download the installation package from the Internet, and then the next ... Now we have come to the world of Linux, feel the way of geek thinking-a command plus enter, wait, the software is installed, this is a convenient way to install software online. One thing to note in advance is that, due to the different Linux distributions, there are some differences (including package management tools and commands) for online installation, and the approach is only applicable to Ubuntu distributions, or Ubuntu-based distributions such as Ubuntukylin ( Excellent kylin), Ubuntu is a Debian-based distribution, it uses the Debian Package management tool dpkg, so some operations also apply to Debian. Distributions that use other package management tools do not apply.

(i). Apt Package management tool and command 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.

First look at a few nouns:

software source : Upload the download software server

software source mirror server : Server with the same software source content (updates with latency)

Package List : This table will have software dependent information records, for software dependencies, for example: When we install the A software, and this software needs B this package to work properly, this time apt-get When installing the software will be installed for us to ensure that A the normal work. 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)

Format: apt-get < Tools > < parameters > < package name >

apt-get uses various common assemblies for processing packages, which apt 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 the package name, the user installs a package   

update           download/update the package list for 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 removes the installed package, including the package that is dependent on the removed package, but does not contain a configuration file for the package          

autoremove         Removal of 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 Apt-get Common parameters:

Parameter description

- y The option to automatically respond to whether or not to install packages, using this parameter in some automated installation scripts will be very

- S           Analog Installation

- Q silent installation, specifying multiple q or -q=# , #表示数字, to set the level of silence, which is useful when you do not want to have too much screen output when you install a package

- 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

2. 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 ...
3. Software Installation
apt-Get Install < package name >

Note: How to install when you do not know the full name of the package. Usually we use the Tab key to complete the package name, and later we will describe a better way to search for the package. Sometimes you need to install multiple packages at the same time, and you can use regular expressions to match package names for batch installations.

4. Software upgrades
# Update software source $ sudo apt-get  update# Upgrade without dependency problem package $ sudo apt-get  upgrade# Upgrade and resolve dependencies $ sudo apt-get Dist-upgrade
5. Uninstalling the Software

sudo apt-get remove < software name >

Ii. Introduction to installing the Deb package from a local disk using dpkg 1.dpkg

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 can often easily package packages on the Web deb and need to use dpkg commands to install

dpkgCommon 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 Displaying deb information about a 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, such as:

Then we'll copy the first one deb to the home directory and use the dpkg installation

$ cp /var/cache/apt/archives/emacs24_24.3+1-4ubuntu1_amd64.deb ~# 安装之前参看deb包的信息$ 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, the direct use of the DPKG installation may have some problems because the dpkg dependencies cannot be resolved for you

# 使用dpkg安装$ sudo dpkg -i emacs24_24.3+1-4ubuntu1_amd64.deb

As expected, here you may have some errors:

How we're going to fix this error, it's going to work apt-get , use its -f parameters, fix the dependency installation

-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 installs the software, then luckily you'll be able to dpkg find the answer

Use dpkg -L view deb Package directory information

sudo dpkg-l emacs

Third, install from the binary package

Binary package installation is relatively simple, all we need to do is to extract 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 PATH the environment variable.

Software Installation under Ubuntu

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: 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.