Home arrow Debian arrow Package Management in Debian Linux
Package Management in Debian Linux PDF  
Digg Reddit Stumble Upon Facebook Twitter Google Technorati Bookmark
Thursday, 05 June 2008
To manage packages in Debian Linux you have 3 tools: dpkg, apt-get and aptitude.
Here are some useful command to manage packages under Debian linux using those tools.


Install ftpd FTP server on Debian
---------------------------------------------
Next command will install ftpd FTP server:

  apt-get install ftpd



Remove a package from Debian
--------------------------------------------
Following command removes ftpd package from the system:

  apt-get remove ftpd


Do not install only simulate package installation on Debian
--------------------------------------------
  apt-get -s ftpd



Install and remove a Debian package using dpkg
------------------------------------------------------------------
Install:
  dpkg -i ftpd

Remove:
  dpkg -r ftpd


2. Find files from ftpd package on Debian
--------------------------------------------------------
  dpkg -L ftpd


Search for a package from Debian installed packages
----------------------------------------------------------------------------
  dpkg -l | grep ftpd

To list all packages use:

  dpkg -l


or:

  dpkg --get-selections


Resynchronize the package index file from sources
-----------------------------------------------------------------------
(index is fetched from location listed in /etc/apt/sources.list)

apt-get update


Upgrade Debian packages after you've run an update
------------------------------------------------------------------------

apt-get upgrade


Search for a package in cache
-----------------------------------------

  apt-cache search net-tools


Find to which package belongs a file in Debian
------------------------------------------------------------------
Find complete path of netstat:

  whereis netstat

You will get:

netstat: /bin/netstat /usr/share/man/man8/netstat.8.gz

Then type following command using complete path for file

  dpkg -S /bin/netstat

You will get:
net-tools: /bin/netstat

(net-tools is the package name).


Get info about a package in Debian
--------------------------------------------------

  dpkg -s net-tools


List packages from cache dir
----------------------------------------

  ls /var/cache/apt/archives/


Remove all files from packages cache
----------------------------------------------------

  apt-get clean


Manage packages in Debian with aptitude
---------------------------------------------------------
aptitude install ftpd
- will install ftpd package
aptitude remove ftpd - will remove ftpd package
aptitude update - will update packages  index
aptitude seach ftpd - will search for ftpd package
aptitude download ftpd - will download ftpd package in current directory
Last Updated ( Sunday, 16 October 2011 )
 
< Prev   Next >

Misc

Linux Tips

Polls

What is your favorite Linux Distribution ? (we just added Mint and reset the pool data)