A package manager called apt is the main tool for installing software. Apt is popular among Debian-based Linux distributions, such as Ubuntu, Mint, and others.
By default apt installs all dependencies of a package, including optional and not always necessary. They’re called recommended and suggested dependencies. They can affect the system speed and memory consumption, therefore in this article we will talk about how not to install them.
What recommended packages are ?
This is the type of packages, that allows a program be able to perform additional features. Let’s take MPV package from Debian repository as an example:
As we can see, youtube-dl here as a recommended package. If it’s installed MPV will be able to play YouTube videos, right in this manner:
So, this is what recommended packages are, they give programs more features.
What suggested packages are ?
In simple terms, it is often some additional things, such as documentation, documentation for programmers, debuggers, scripting tools, and so on.
Let’s take GIMP package from Debian repository as an example:
As we can see, suggested packages are often simply not needed. Most likely, we don’t want to write python scripts for gimp. This is a job for developers. Rather, we don’t need “extra” brushes. There are a lot of them, and not all of these we might like. Most likely it would be better to choose them by yourself on some resources or forums. So, with gimp, we install 6 more packages that we probably don’t need.
What is the risk of not installing recommended packages?
Some features of a program may not work. For example, I have installed a program that could scroll through pictures in a directory. But I didn’t install unzip package, which was in recommended dependencies. Therefore, my program will not be able to open zip archives and scroll through pictures inside this archive.
So what should I do if I suddenly need some feature of a program?
You can easily install recommended package in the future.
So, for the example above, it will be:
sudo apt install unzip
And the feature of reading pictures from an archive will work again
How not to install recommended and suggested packages?
Let’s take a look at apt MAN page:
We can easily avoid installing recommended and suggested packages by adding a parameter –no-install-recommends
Add this parameter to your line in the terminal. For example, let’s install GIMP
sudo apt install --no-install-recommends gimp
sudo apt-get install --no-install-recommends gimp
apt and apt-get are both must work, apt is more modern version of apt-get (Check this article for additional info – apt vs apt-get, apt-cache).
When you use –no-install-recommends, pay attention to the line:
The following additional packages will be installed:
These are the packages that will be installed. As we can see, recommended and suggested packages are no longer listed there!
Thanks for attention!