apt-get

APT

install

apt-get install

<package_name>



root@1J52VQ1:~# apt-get install putty



Reading package lists... Done

Building dependency tree

Reading state information... Done

The following extra packages will be installed:

putty-tools

Suggested packages:

putty-doc

The following NEW packages will be installed:

putty putty-tools





remove

apt-get remove

<package_name>

root@1J52VQ1:~# apt-get remove putty



Reading package lists... Done

Building dependency tree

Reading state information... Done

The following package was automatically installed and is no longer required:

putty-tools

Use 'apt-get autoremove' to remove them.

The following packages will be REMOVED:

putty





autoremove

apt-get autoremove

root@1J52VQ1:~# apt-get autoremove

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages will be REMOVED:

putty-tools





purge

apt-get purge

<package_name>

root@1J52VQ1:~# apt-get purge putty



Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages will be REMOVED:

putty*





update

etc/apt/sources.list

apt-get update

root@1J52VQ1:~# apt-get update



Get:1 http://security.ubuntu.com precise-security Release.gpg [198 B]

Hit http://archive.ubuntu.com precise Release.gpg

Get:2 http://archive.ubuntu.com precise-updates Release.gpg [198 B]

Get:3 http://archive.ubuntu.com precise-proposed Release.gpg [198 B]

Get:4 http://archive.ubuntu.com precise-backports Release.gpg [198 B]

Get:5 http://security.ubuntu.com precise-security Release [49.6 kB]





upgrade

/etc/apt/sources.list

apt-get upgrade

root@1J52VQ1:~# apt-get upgrade



Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages have been kept back:

linux-generic linux-headers-generic linux-headers-generic-lts-raring

linux-headers-lowlatency linux-image-generic linux-image-generic-lts-raring

linux-image-lowlatency linux-lowlatency





search

apt-cache search

<search_term>

root@1J52VQ1:~# apt-cache search terminal



pterm - PuTTY terminal emulator

ptex2tex - easy generation of (possibly complex) LaTeX environments

putty - Telnet/SSH client for X

pyqonsole - X Window terminal emulation written in Python

python-libssh2 - Python binding for libssh2 library





apt-cache search

<package_name>

root@1J52VQ1:~# apt-cache search putty



libtrilead-putty-extension-java - PuTTY key support for Trilead SSH2 library

libtrilead-putty-extension-java-doc - Documentation for libtrilead-putty-extension-java

pterm - PuTTY terminal emulator

putty - Telnet/SSH client for X

putty-doc - PuTTY HTML documentation

putty-tools - command-line tools for SSH, SCP, and SFTP





show

apt-cache show

<package_name>

root@1J52VQ1:~# apt-cache show putty



Package: putty

Description-en: Telnet/SSH client for X

This is the Unix port of the popular Windows SSH client, PuTTY. It supports

flexible terminal setup, mid-session reconfiguration using Ctrl-rightclick,

multiple X11 authentication protocols, and various other interesting things

not provided by ssh in an xterm.

Priority: optional

Section: universe/net

Installed-Size: 850

Architecture: amd64

Version: 0.62-6ubuntu0.1





policy

apt-cache policy

<package_name>

root@1J52VQ1# apt-cache policy putty



putty:

Installed: (none)

Candidate: 0.62-6ubuntu0.1

Version table:

0.62-6ubuntu0.1 0

500 http://security.ubuntu.com/ubuntu/ precise-security/universe amd64 Packages

500 http://archive.ubuntu.com/ubuntu/ precise-updates/universe amd64 Packages

0.62-6 0

500 http://archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages





package-name:

Installed: <installed-version>

Candidate: <version-installed-when-doing-apt-get-upgrade>

Package-Pin: <version-of-Pin-in-etc-apt-preferences>

Version table:

*** <some-version> <minimum-priority-to-consider>

<priority-of-this-instance> <repository1>

<priority-of-this-instance> <repository2>

*** <some-other-version> <minimum-priority-to-consider>

<priority-of-this-instance> <repository3>

<priority-of-this-instance> <repository4>





clean

/var/cache/apt/archives/

/var/cache/apt/archives/partial/

apt-get clean

root@1J52VQ1:~# apt-get clean





clean

autoclean

apt-get autoclean

root@1J52VQ1:~# apt-get autoclean

Reading package lists... Done

Building dependency tree

Reading state information... Done





install -f

apt-get install -f

root@1J52VQ1:~# apt-get install -f



Reading package lists... Done

Building dependency tree

Reading state information... Done

0 upgraded, 0 newly installed, 0 to remove and 264 not upgraded.





download

apt-get download

<package_name>

root@1J52VQ1:~# apt-get download putty

Get:1 Downloading putty 0.62-6ubuntu0.1 [338 kB]

Fetched 338 kB in 3s (92.9 kB/s)





is the command-line tool for handling packages, and may be considered the user's "back-end" to other tools using the APT library.Several "front-end" interfaces exist, such as dselect, aptitude, synaptic and wajig.If you are a debian user, you are probably aware of thepackage handling utility. This article will help you gain more about the usage of apt-get utility.1.is followed by one or more packages desired for installation or upgrading. Each package is a package name, not a fully qualified filename (for example, in a Debian GNU/Linux system, libc6 would be the argument provided, not libc6_1.9.6-2.deb)If a hyphen is appended to the package name (with no intervening space), the identified package will be removed if it is installed. Similarly a plus sign can be used to designate a package to install.2.is identical to install except that packages are removed instead of installed. Note the removing a package leaves its configuration files in system.If a plus sign is appended to the package name (with no intervening space), the identified package will be installed instead of removed.3.is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed.4.is identical to remove except that packages are removed and purged, i.e. the configuration files are removed along with the package.5.is used to resynchronize the package index files from their sources. The indexes of available packages are fetched from the location(s) specified in /6.is used to install the newest versions of all packages currently installed on the system from the sources enumerated in7.With, you can search for any package from the apt-cache by providing a search term related to the package.In case, you want to search more about any particular package:8.With, you can view the description of package fetched from the apt-cache and other relevant information including version, size, dependencies, architecure, section, etc.9.With, you can view if a particular package is installed on your system or not and it will display the available version as well.This quote below explains the above output.This link here explains a bit more about the above output.10.clears out the local repository of retrieved package files.It removes everything but the lock file fromand11.Likeclears out the local repository of retrieved package files. The difference is that it only removes package files that can no longer be downloaded, and are largely useless.12.This has been a life saver for me a lot of times. You have a package that did not install properly because of some missing dependencies, try using, it fixes the stuff most of the times.13.will download the given binary package into the current directory.