Wednesday, April 27, 2011

Linux - apt-get

The apt-get program is a command-line package manager, which should be used if the Add/Remove tool and Synaptic ever run into problems. It provides an advanced interface to APT, the underlying package management system which Ubuntu uses, but is reasonably easy to operate. Power users may find that apt-get is quicker to use and more powerful than the graphical options.

Text based methods can be used across Ubuntu, Kubuntu and Xubuntu, but require familiarity with the terminal. When helping users to install packages, you should consider using an AptURL instead of apt-get or aptitude.


Installing downloaded packages


You may wish to install a package you have downloaded from a website, rather than from a software repository. These packages are called .deb files. Because they may have been created for a different Linux distribution, you might find that there's dependency issues with Ubuntu, meaning that they may be uninstallable.

Package management via apt-get runs hand-in-hand with the /etc/apt/sources.list file.
To find a package which you have previously downloaded using Synaptic, aptitude or apt-get, look in /var/cache/apt/archives




Introduction to APT


"In the beginning there was the .tar.gz. Users had to compile each program that they wanted to use on their GNU/Linux systems. When Debian was created, it was deemed necessary that the system include a method of managing the packages installed on the machine. The name dpkg was given to this system. Thus the famous 'package' first came into being on GNU/Linux, a while before Red Hat decided to create their own 'rpm' system.

A new dilemma quickly took hold of the minds of the makers of GNU/Linux. They needed a rapid, practical, and efficient way to install packages that would manage dependencies automatically and take care of their configuration files while upgrading. Here again, Debian led the way and gave birth to APT, the Advanced Packaging Tool, which has since been ported by Conectiva for use with rpm and has been adopted by some other distributions."

Commands
 
All of these commands must be run as root or with superuser privileges, see sudo for more information. Replace with the name of the package you are attempting to install.
 
 apt-get install

to download without install

apt-get install -d


This command installs a new package.

apt-get build-dep

This command searches the repositories and installs the build dependencies for . If the package is not in the repositories it will return an error.


 
Ref : https://help.ubuntu.com/community/AptGet/Howto

No comments:

Post a Comment