How to manage packages using apt

apt is the Advanced Packaging Tool. It is a group of command-line programs that allow you to manage the set of installed packages on a system. The tool was created to run on Debian Linux releases. The primary command-line programs are apt-cache to find programs to download and install with the apt-get tool to do the actual downloading and installation. apt also manages the relationships between different packages, like if application A needs library B, apt will make sure B is installed first whenever you install A.

DIFFICULTY Basic - 1 | Medium - 2 | Advanced - 3
TIME REQUIRED 15-30+ min
RELATED PRODUCTS Linux-based VPS or dedicated servers

If you try to execute a command that isn't found on your system, you'll be told the apt-get command to download and install the package. For instance 'xjump' is a text adventure game most people won't have installed. If you try to run the program on a machine without the game, here is what you would see:

$ xjump

The program 'xjump' is currently not installed. You can install it by typing:

sudo apt-get install xjump

You would then run the "sudo apt-get install tome" specified, providing the password and pressing Y when asked to install.

$ sudo apt-get install xjump
[sudo] password for username:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libqt4-declarative liblcms1 qdbus libqt4-script libqt4-network libqt4-dbus libmysqlclient18 libqt4-xmlpatterns fontconfig
libqtcore4 libqt4-sql libqt4-xml libqtgui4 libqt4-sql-mysql libaudio2 mysql-common libmng1
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libasyncns0 libcaca0 libjson0 libpulse0 libsdl-image1.2 libsdl-ttf2.0-0 libsdl1.2debian
Suggested packages:
pulseaudio
The following NEW packages will be installed:
libasyncns0 libcaca0 libjson0 libpulse0 libsdl-image1.2 libsdl-ttf2.0-0 libsdl1.2debian tome
0 upgraded, 8 newly installed, 0 to remove and 106 not upgraded.
Need to get 3,312 kB of archives.
After this operation, 12.6 MB of additional disk space will be used.
Do you want to continue [Y/n]?

If you're unclear what you want to install, just use the apt-cache command with the search option:

apt-cache search xjump
gnujump - platform game where you have to jump up to survive
gnujump-data - platform game where you have to jump up to survive - data files
xjump - jumping game for X

If you want to find out about a specific package to install, use the show option of apt-cache:

apt-cache show xjump
gnujump - platform game where you have to jump up to survive
gnujump-data - platform game where you have to jump up to survive - data files
xjump - jumping game for X
$ apt-cache show xjump
Package: xjump
Priority: optional
Section: universe/games
Installed-Size: 115
Maintainer: Ubuntu Developers
Original-Maintainer: Samuel Mimram
Architecture: amd64
Version: 2.7.5-6.1
Depends: libc6 (>= 2.4), libx11-6, libxaw7, libxpm4, libxt6
Filename: pool/universe/x/xjump/xjump_2.7.5-6.1_amd64.deb
Size: 22358
MD5sum: 25405c97f29ee4385b52dc4ca4515031
SHA1: db715d5691fd51fe649feb39aef0d8bf9dab03b0
SHA256: 62a33592c38ad321e9318d13c72ab44915bafb214c65ff3fb8c4e4cf2faac371
Description-en: jumping game for X
The epitome of addictive and pointless games, xjump is simply a game
where one jumps from one platform to a higher platform, over and over. If
you can't keep up with the pace of jumping, the floor swallows you up and
your game is over.
Description-md5: af037c22dec141dc1b36fb8b9df3b12f
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Hjalp denne artikel?
Tak for din feedback.
Det glæder os, at vi kunne hjælpe! Er der andet, vi kan gøre for dig?
Beklager. Er der andet, vi kan gøre for at hjælpe dig?