(Modified 2025 Aug 04)
DEBs
Debian package management
DEBs are one way how binaries are packaged for Debian-based Linux distributions, such as the Ubuntus. They are somewhat analogous to RPMs used in RedHat/Fedora distros. Personally, I find that dependency management is better with DEBs, although I can't rule out that I started to use RPMs first, before both schools of thought ironed out the problems.
Ubuntu-based distros use the Software Center as the package manager by default. I find that, instead, Synaptic to be the best package manager, for any operating system. Synaptic is no longer installed by default on the Ubuntus, so you'll need to install it yourself.
I've been using Ubuntu-based distros on my primary computers since 2009, but I feel the need to write about DEBs now, in 2013, because of recent problems I encountered. Specifically, I have run into incompatibilities when installing the SPIDER image-processing suite. More specifically, the problem has been that SPIDER in some places requires 32-bit libraries, whereas 64-bit machines are becoming the norm. This isn't really the "fault" of Ubuntu for not installing both 64- and 32-bit libraries, but it does illustrate a problem that cannot be easily solved using the graphical interfaces.
The command apt-get is how to manage software packages from the command line. It handles dependencies, so it is analogous to yum in RPMs. An example of how it is used would be:
sudo apt-get install libjpeg62
More complete information can be found at the manual page for apt-get.
The more atomic, fine-grained command to manage packages is dpkg. If apt-get is analogous to yum, then dpkg would be analogous to rpm. dpkg does not handle dependencies. The analogous command to install a package would be:
dpkg -i libxmu6
If there were unsatisfied dependencies, the command above would not fix them. You can override unsatisfied dependencies with the following:
dpkg -i --force-depends libxmu6
However, the unmet dependencies may result in an error when you run the corresponding program.
Something useful and simple that dpkg can do, however, is report the status of a given package, for example:
dpkg -s libxmu6
That command will tell you whether the package installed OK.
To remove a package, the command is:
dpkg -r libreoffice3.6-debian-menus
If a dependency would break another program, there will be message that say what program(s) depend on this one.
If you don't know the full name of an installed package, it's hard to figure out, since you can't use wild cards (?). What you can do is get a list of the packages, and then grep for a string that should be in the name, e.g.:
dpkg --get-selections | grep libreoffice
Previously, I hadn't been able to find a way to search which package contains a specific library from the command line. Instead, I've been going to Ubuntu Packages Search, and searching their site.
You can search for which package provides a particular file with dpkg -S (or dpkg --search):
dpkg -S nvidia-smi
To list the files installed via package nvhpc-25-7:
dpkg -L nvhpc-25-7
I learned of the command apt-file (from AskUbuntu). You need to install it, and then update the cache:
sudo install apt-file
sudo apt-file update
Then, you can search packages in the repository like the following (sudo not required):
apt-file find libpng12.so.0
You can list files belonging to a particular package with dpkg -query -L (dpkg --L appears to work too):
dpkg-query -L fftw3
This command works with installed packages. For packages not yet installed, use:
apt-file list libfftw3-dev
See the note above about installing apt-file. More information at AskUbuntu.
As I learn more tricks with DEBs, I will include them here.
This page is Lynx-enhanced