Skip Installing Recommended Packages using APT

Skip Installing Recommended Packages using APT

When you install packages using APT on Debian-based Linux distributions (e.g. Ubuntu), it automatically installs not only the required dependencies but also the recommended packages by default. These recommended packages often provide extra features or enhancements, but sometimes you might want to install only the essentials - for example, to save space or reduce installation time. This tutorial explains how to skip installing recommended packages using APT.

To find out which packages are recommended, run the apt-cache show command and filter the output using grep. For example:

apt-cache show cmake | grep Recommends

Example output:

Recommends: gcc, make

This means that when you install cmake, APT will also install gcc and make unless you tell it not to.

To skip installing recommended packages, use the --no-install-recommends option with apt install. For example:

sudo apt install --no-install-recommends -y cmake

This will install only cmake and its essential dependencies, excluding the recommended packages like gcc and make.

Example output:

The following NEW packages will be installed:
  cmake cmake-data libarchive13t64 libjsoncpp25 librhash0 libuv1t64
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.

Leave a Comment

Cancel reply

Your email address will not be published.