Three ways to install programs under Ubuntu

Source: Internet
Author: User
Tags diff unpack

Introduction

In Ubuntu, install the application I know there are three ways, respectively, apt-get,dpkg install Deb and make install Source package three. For each of the following methods, for example.

Apt-get method

Installing an application using Apt-get install is one of the most common installation methods, such as I want to install build-essential this software, using the following, he will help me to put all the dependencies are installed together.

sudo apt-get install build-essential

After executing the above command, we can see the information, thefollowing extra packages will is installed: represents all the dependent packages that need to be reinstalled.

sudo apt-get install Build-essential[sudo] Password for enadmin:reading package lists ... Donebuilding Dependency Tree Reading state information ... Donethe following extra packages would be installed:binutils cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6 libal Gorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libc-bin libc-dev-bin libc6 Libc6-dev Libdpkg-perl libgomp1 libmpc2 libmpfr4 libquadmath0 libstdc++6-4.6-dev linux-libc-dev manpages-devsuggested packages:b Inutils-doc cpp-doc gcc-4.6-locales debian-keyring g++-multilib g++-4.6-multilib gcc-4.6-doc libstdc++6-4.6-dbg Gcc-multilib autoconf automake1.9 Libtool Flex bison gdb gcc-doc gcc-4.6-multilib libmudflap0-4.6-dev libgcc1-dbg Libgom p1-dbg libquadmath0-dbg libmudflap0-dbg binutils-gold glibc-doc libstdc++6-4.6-docthe following NEW packages would be inst Alled:binutils build-essential cpp cpp-4.6 dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6 libalgorithm-diff-perl libalgorith M-diff-xs-perl LIbalgorithm-merge-perl libc-dev-bin libc6-dev libdpkg-perl libgomp1 libmpc2 libmpfr4 libquadmath0 Libstdc++6-4.6-dev Linux-libc-dev manpages-devthe following packages would be Upgraded:libc-bin libc62 upgraded, at newly installed, 0 to re Move and 101 not upgraded. Need to get 36.3 MB of archives. After this operation, 83.6 MB of additional disk space would be used. Want to continue [y/n]? Y

The various parameters of Apt-get are given below:

Apt-get Install XXX. If it has parameters, then-d means download only and-F indicates mandatory installation
Apt-get Remove xxx Uninstall XXX
Apt-get Update updates the Software information database
Apt-get Upgrade for system upgrades
Apt-cache Search Package
Tips: It is recommended that you use the "apt-get Update" command frequently to update your software information database

Apt-get in theory is required to be able to network, but if the local source is created, there is no need for networking, the production of local sources can be consulted: Ubuntu production local source

Dpkg Installing the Deb Package

The Ubuntu package format is Deb and the installation method is as follows:

sudo dpkg-i package.deb

Dpkg's detailed use method, there are many online, below a few simple list:

Dpkg-i Package.deb Install package
Dpkg-r Package Delete Package
Dpkg-p Package Delete package (including configuration file)
Dpkg-l Package List the files associated with the package
Dpkg-l Package Displays the version of the package
Dpkg–unpack Package.deb Unpack the contents of the Deb package
dpkg-s keyword Search for the package content that belongs to
Dpkg-l List the packages that are currently installed
Dpkg-c Package.deb List the contents of the Deb package
Dpkg–configure Package Configuration Package

According to the Ubuntu Chinese Forum, the software installed using the Apt-get method, all the downloaded Deb packages are cached in the/var/cache/apt/archives directory, so you can back up the usual Deb package, even into the ISO toolkit, the engraving, When you install Ubuntu in the future, you can do so without a network environment. The following command is to copy the Archives directory to the/var/cache/apt/directory, replacing the original archives

[Email protected]:~/ftp$ sudo cp-r archives//var/cache/apt/
Make Install source code installation if you want to use made installation, then you have to install build-essential this dependency package, the installation method has been mentioned earlier. After the installation is complete, we can install the source code. The source installation can be broadly divided into three steps: (./configure) –> compilation (sudo make) –> installation (sudo make install).
    1. Configuration: This is the first step in compiling the source code and is done through the ./configure command. Perform this step to prepare the source code for compilation. Common options are -- prefix=prefix to specify where the program is installed. More options are available through Help -- queries. There are also some programs that do not need to perform this step.
    2. Compile: Once configured, you can use make the instructions to execute the source code compilation process immediately. Depending on the specifics of the software, the time required for compiling is different, and all we have to do is to wait patiently and watch it change. Although this step is only a simple instruction, sometimes the problems encountered are very complex. The more frequently encountered scenario is that the program compiles halfway through but does not end satisfactorily. At this point, you need to analyze the error message to find a strategy.
    3. Installation: If the compilation is not a problem, then execution sudo make install can install the program into the system.
The following example illustrates the installation of Nagios.
1. Unzip the TAR-ZXF nagios-4.0.2.tar.gz  //2. Enter the directory CD NAGIOS-4.0.2//3. Configuration./configure--prefix=/usr/local/nagios     // 4. Compile make ALL//5. Installing make install && make Install-init && make Install-commandmode && make Install-c Onfig

The above is the source code installation method.

Three ways to install programs under Ubuntu

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.