Introduction to Linux. Lesson 9. Software Management in Ubuntu.
0
Software management in the Debian-like distros such as Ubuntu is done using DPMS and all the attendant applications built around it, such as APT and dpkg. In this section we will look at how to perform basic software management tasks on Debian-like distros.
On your Ubuntu server, the equivalent command to list all currently installed
software is
yyang@ubuntu-server:$ dpkg -l
The command to get basic information about an installed package is
yyang@ubuntu-server:$ dpkg -l bash
The command to get more detailed information about the bash package is
yyang@ubuntu-server:$ dpkg --print-avail bash
To view the list of files that comes with the bash package, type
yyang@ubuntu-server:$ dpkg-query -L bash
The querying capabilities of dpkg are extensive. You can use DPMS to query for specific
information about a package. For example, to find out the size of the installed bash
package, you can type
yyang@ubuntu-server:~$ dpkg-query -W --showformat='${Package} ${Installed-Size}
\n' bash
There are several ways to get software installed on Ubuntu systems. You can use dpkg
to directly install a .deb (pronounced dot deb) file, or you may choose to use apt-get
to install any software available in the Ubuntu repositories on the Internet or locally
(CD/DVD ROM, file system, etc).
NOTE Installing software and uninstalling software on a system is considered an administrative or
privileged function. This is why you will notice that any commands that require superuser privileges
are preceded with the sudo command. The sudo command can be used to execute commands in
the context of a privileged user (or another user). On the other hand, querying the software database
is not considered a privileged function. To use dpkg to install a .deb package named lynx_2.8.6-
2ubuntu2_i386.deb , type
yyang@ubuntu-serverA:$ sudo dpkg --install lynx_2.8.6-2ubuntu2_i386.deb
Using apt-get to install software is a little easier, because APT will usually take care
of any dependency issues for you. The only caveat is that the repositories configured in
the sources.list file (/etc/apt/sources.list) have to be reachable either over the Internet
or locally. The other advantage to using APT to install software is that you only need to
know a part of the name of the software; you don’t need to know the exact version number.
You also don’t need to manually download the software before installing.
To use apt-get to install a package called lynx, type
yyang@ubuntu-server:$ sudo apt-get install lynx
Uninstalling software in Ubuntu using dpkg is as easy as typing
yyang@ubuntu-server:$ sudo dpkg --remove lynx
You can also use apt-get to remove software by using the remove option. To
remove the lynx package using apt-get, type
yyang@ubuntu-server:$ sudo apt-get remove lynx
A less commonly used method for uninstalling software with APT is by using the
install switch, but appending a minus sign to the package name to be removed. This
may be useful when you want to install and remove a package in one shot. To remove
the Lynx package using this method, type
yyang@ubuntu-server:$ sudo apt-get install lynx-
APT makes it easy to completely remove software and any attendant configuration
file(s) from a system. This allows you to truly start from scratch by getting rid of any
customized configuration files. Assuming we completely want to remove the lynx application
from the system, we would type
yyang@ubuntu-server:$ sudo apt-get --purge remove lynx
No tags have been pushed to this repository yet.