Description
Ubuntu packages declare strong dependencies (Depends) and weak ones (Recommends,
Suggests). By default APT also installs recommended packages. APT::Install-Recommends and
APT::Install-Suggests set to false make it install strong dependencies only.
Ubuntu Desktop installs most of its applications as recommendations of the ubuntu-desktop
metapackage. With this setting, applications that a later version of the metapackage
recommends (after an update or a release upgrade) are not installed; nothing already installed
is removed.
Rationale
Recommended packages are often optional services, documentation tools or helpers that the system does not need. Installing only what is required keeps the system minimal, as asked by the minimal installation principle.
Impact
Some features can be missing after an installation (for example a plugin or a helper shipped as
a recommendation). Install them explicitly with apt-get install <package>, or once with
apt-get install --install-recommends <package>. Packages already installed are not removed.
Setting
| Location | /etc/apt/apt.conf.d/ |
| Default | Install-Recommends true, Install-Suggests false |
| Recommended | Install-Recommends false, Install-Suggests false |
Audit
Run apt-config dump APT::Install-Recommends APT::Install-Suggests. Both must be 0 or
false.
Automated: every check must pass. Scanners report each check by its id.
weak-deps
APT::Install-Recommends and APT::Install-Suggests, as merged by apt-config.
script: |
eval "$(apt-config shell R APT::Install-Recommends S APT::Install-Suggests)" || exit 3
echo "Install-Recommends=${R:-unset} Install-Suggests=${S:-unset}"
case ${R:-true} in 0 | false | no | off) ;; *) exit 1 ;; esac
case ${S:-false} in 0 | false | no | off) ;; *) exit 1 ;; esac
Remediation
Create /etc/apt/apt.conf.d/99cirsec-no-recommends with:
APT::Install-Recommends "false";
APT::Install-Suggests "false";
and remove any later setting of these options (/etc/apt/apt.conf is read after the
directory).
| Restart | none |
| Disruption | none |
Rollback
Remove /etc/apt/apt.conf.d/99cirsec-no-recommends.
weak-deps
f=/etc/apt/apt.conf.d/99cirsec-no-recommends
cb_backup "$f"
printf '%s\n' '// CB-UBU-PKG-011: install strong dependencies only.' 'APT::Install-Recommends "false";' 'APT::Install-Suggests "false";' >"$f"
Handwritten code reads parameters from CB_<NAME> environment variables. Each release turns these fixes into remediate.sh and an Ansible role per profile: dry run by default, a fix runs only when its check fails.
References
- apt.conf(5), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
- apt-get(8), Ubuntu manual pages Canonical, vendor-doc, accessed 2026-10-19
Mappings
| Framework | ID | Relation | Note |
|---|---|---|---|
| ANSSI-BP-028 - Recommandations de configuration d'un système GNU/Linux2.0 | R58 | partial | R58 asks for a minimal set of packages; this control stops APT from adding optional ones. |
| NIST SP 800-53 Rev. 55.1.1 | CM-7 | related |
How this control relates to the other framework's: equivalent, stricter, looser, partial or related.
Related controls
- related
CB-UBU-PKG-010Install only the packages the system needs
People and lifecycle
| Authors |
|
| Verified | 2026-10-19 by Sn0wAlice on 20.04, Proxmox VM, Ubuntu 20.04 cloud image, kernel 5.4.0-216-generic. Fails on stock (Install-Recommends 1); fix writes 99cirsec-no-recommends; passes for server-hardened and desktop-hardened, kept after reboot. |
| Verified | 2026-10-19 by Sn0wAlice on 22.04, Proxmox VM, Ubuntu 22.04 cloud image, kernel 5.15.0-198-generic. Fails on stock (Install-Recommends 1); fix writes 99cirsec-no-recommends; passes for server-hardened and desktop-hardened, kept after reboot. |
| Verified | 2026-10-19 by Sn0wAlice on 24.04, Proxmox VM, Ubuntu 24.04 cloud image, kernel 6.8.0-147-generic. Fails on stock (Install-Recommends 1); fix writes 99cirsec-no-recommends; passes for server-hardened and desktop-hardened. |
| Verified | 2026-10-19 by Sn0wAlice on 26.04, Proxmox VM, Ubuntu 26.04 cloud image, kernel 7.0.0-38-generic. Fails on stock (Install-Recommends 1); fix writes 99cirsec-no-recommends; passes for server-hardened and desktop-hardened. |
| Introduced in | v0.1.0 |
| Created, updated | 2026-10-19, 2026-10-19 |
| Translations | fr |