Debian/Ubuntu set apt defaults for no recommends or suggests
techAdmin
Status: Site Admin
Joined: 26 Sep 2003
Posts: 4127
Location: East Coast, West Coast? I know it's one of them.
Reply Quote
Depending on the default configurations, Debian has some really bad settings for apt, the worst of all is the installation of suggests or recommends by default.

To fix this, create a file, I call this one: /etc/apt/apt.conf.d/80basics

Note that on this system, it's a Buster (testing) base, with sid (unstable) sources added so I can install stuff not in testing repos.

:: Code ::
// apt 0.7 introduces automatic behaviour unsuitable for sid, revert this
APT::Default-Release "buster";

// auto-remove breaks on meta packages
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";
APT::AutoRemove::SuggestsImportant "false";
APT::AutoRemove::RecommendsImportant "false";
Debug::pkgAutoRemove "0";

// PDiffs reduce the required download for apt-get update, but increase the
// CPU requirements and quite often fail.
Acquire::PDiffs "0";


Next, and this only applies if you want to pin the distro base to a specific version (does not apply if you only use one type of the distro, like testing, or sid, or stable. Note that by default, apt will use the highest level, unless you pin the distro:

File: /etc/apt/preferences.d/90basics
:: Code ::
preferences.d/90basics:1:Package: *
Pin: release a=testing
Pin-Priority: 900

Package: *
Pin: release a=unstable
Pin-Priority: 300

Package: *
Pin: release a=experimental
Pin-Priority: 50


The pin priority determines what apt will use when deciding between, in this case, sid and testing. I don't actually use experimental in general, but I put that in there just in case I needed something from it at some point. I don't believe numbers > 1000 have any meaning or point.
Back to top
Debian/Ubuntu set apt defaults for no recommends or suggests
aaronjeffery
Status: New User - Welcome
Joined: 28 Mar 2023
Posts: 1
Reply Quote
To set the apt defaults for no recommends or suggests in Debian/Ubuntu, you can create a configuration file for apt in the /etc/apt/apt.conf.d/ directory.

Open a terminal window and enter the following command to create a new configuration file:
sudo nano /etc/apt/apt.conf.d/99norecommends

In the text editor, add the following lines:
APT::Install-Recommends "false";
APT::Install-Suggests "false";

Save the file and exit the text editor.

Update the apt cache by entering the following command:
sudo apt update

refer to this link here: https://www.lenovo.com/gb/en/d/gaming-laptops/



From now on, when you use apt to install packages, it will not automatically install recommended or suggested packages.

If you want to install recommended or suggested packages for a specific package installation, you can use the --install-recommends or --install-suggests options with the apt install command. For example:
sudo apt install --install-recommends package_name

Note that disabling recommends and suggests can cause some packages to not function properly or miss some features, so it's important to carefully consider the implications before making this change.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours