Linux--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] PasswordForEnadmin:reading Package Lists ... Donebuilding Dependency Tree Reading state information ... Donethe following extra packages'll be installed:binutils cpp cpp-4.6 Dpkg-dev fakeroot g++ g++-4.6 gcc gcc-4.6Libalgorithm-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:binutils-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 libgomp1-dbg libquadmath0-DBG libmudflap0-dbg binutils-gold Glibc-doc libstdc++6-4.6-Docthe following NEW packages'll be installed:binutils build-essential CPP cpp-4.6 Dpkg-dev fakeroot g++ g++-4.6GCC gcc-4.6 Libalgorithm-diff-perl libalgorithm-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'll be Upgraded:libc-bin libc62 upgraded, Span style= "color: #800080;" >23 newly installed, 0 to remove 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. Do you 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. Go to the Directory CD nagios-4.0.  2//3. Configuration./configure--prefix=/usr/local///4. Compile Make-all //5. Installing make Install & & Make Install-init && make Install-commandmode && make Install-config    

The above is the source code installation method.

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