Professional Documents
Culture Documents
apt commands provide command line way to interact with APT and manage packages.
You’ll see three types of lines here, Hit, Get and Ign. Basically these are:
Get: There is a new version available. It will download the information about the version
(not the package itself).
Once you have updated the package database, you can now upgrade the installed packages. The
most convenient way is to upgrade all the packages that have available updates. You can simply
use the command below:
There is another way to provide a complete upgrade by using the command below:
The fastest and the most convenient way to update Ubuntu system by using this command:
If you already know the name of the package, you can install it using the command below:
Just replace the <package_name> with the desired package. Suppose you want to install mplayer,
you can simply use the command below:
The good thing here is that you can use auto-completion. So, if you are not sure about the exact
package name, you can type a few letters and press tab and it will suggest all the packages
available with those letters.
You are not bound to install just one package at a time. You can install several packages at a
time by providing the package names all together:
By default, the latest version available in the repository will be installed for an application. But if
you don’t want to install the latest version, you can specify the version number. You would need
to know the exact version number that you want to install.
Removing packages is as easy as installing them. Just use the command below:
Another way of uninstalling packages is to use purge. The command is used in the following
manner:
If you want to know more about a package before installing or removing it, you can use the
below command:
This will show information about the given package(s) like its dependencies, installation and
download size, different sources the package is available from, the description of the content of
the package among other things:
Ubuntu Lab-5
apt command has a new option called list. Using this command, you can see all the packages that
have a newer version ready to be upgraded:
You can also see all the installed packages on the system with installed option:
There is also a third option called –all-versions. It will list all the packages available for your
system: