Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Managing Debian Software with APT (apt-get etc)
Prev Home Next

3.2 Installing packages

Finally, the process you've all been waiting for! With your sources.list ready and your list of available packages up to date, all you have to do is run apt-get to get your desired package installed. For example, you can run:

     # apt-get install xchat

APT will search it's database for the most recent version of this package and will retrieve it from the corresponding archive as specified in sources.list. In the event that this package depends on another -- as is the case here -- APT will check the dependencies and install the needed packages. See this example:

     # apt-get install nautilus
     Reading Package Lists... Done
     Building Dependency Tree... Done
     The following extra packages will be installed:
       bonobo libmedusa0 libnautilus0 
     The following NEW packages will be installed:
       bonobo libmedusa0 libnautilus0 nautilus 
     0 packages upgraded, 4 newly installed, 0 to remove and 1  not upgraded.
     Need to get 8329kB of archives. After unpacking 17.2MB will be used.
     Do you want to continue? [Y/n]

The package nautilus depends on the shared libraries cited, therefore APT will get them from the archive. If you had specified the names of these libraries on the apt-get command line, APT would not have asked if you wanted to continue; it would automatically accept that you wanted to install all of those packages.

This means that APT only asks for confirmation when it needs to install packages which weren't specified on the command line.

The following options to apt-get may be useful:

     -h  This help text.
     -d  Download only - do NOT install or unpack archives
     -f  Attempt to continue if the integrity check fails
     -s  No-act. Perform ordering simulation
     -y  Assume Yes to all queries and do not prompt
     -u  Show a list of upgraded packages as well

Multiple packages may be selected for installation in one line. Files downloaded from the network are placed in the directory /var/cache/apt/archives for later installation.

You can specify packages to be removed on the same command line, as well. Just put a '-' immediately after the name of the package to be removed, like this:

     # apt-get install nautilus gnome-panel-       
     Reading Package Lists... Done
     Building Dependency Tree... Done
     The following extra packages will be installed:
       bonobo libmedusa0 libnautilus0 
     The following packages will be REMOVED:
       gnome-applets gnome-panel gnome-panel-data gnome-session 
     The following NEW packages will be installed:
       bonobo libmedusa0 libnautilus0 nautilus 
     0 packages upgraded, 4 newly installed, 4 to remove and 1  not upgraded.
     Need to get 8329kB of archives. After unpacking 2594kB will be used.
     Do you want to continue? [Y/n]

See section Removing packages, Section 3.3 for more details on package removal.

If you somehow damage an installed package, or simply want the files of a package to be reinstalled with the newest version that is available, you can use the --reinstall option like so:

     # apt-get --reinstall install gdm
     Reading Package Lists... Done
     Building Dependency Tree... Done
     0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1  not upgraded.
     Need to get 0B/182kB of archives. After unpacking 0B will be used.
     Do you want to continue? [Y/n]

Managing Debian Software with APT (apt-get etc)
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire