Skip to content

Commit 79b9d24

Browse files
author
Derek
committed
fix: keep install_recommends, remove unwanted packages explicitly
Changed Ubuntu desktop install strategy: - Keep install_recommends: true (default) to get essential packages: - gnome-keyring, gnome-remote-desktop, gnome-terminal - gnome-disk-utility, gnome-system-monitor, gnome-calculator - evince, eog, seahorse, xdg-desktop-portal-gnome - yaru-theme-*, fonts-ubuntu, fonts-noto-*, bluez, cups - Explicitly remove unwanted packages after install: - firefox (we install Chrome + Brave) - gnome-initial-setup (we suppress anyway) - snapd (we prefer apt/flatpak, hold to prevent reinstall) - ubuntu-report, whoopsie, apport-gtk, apport (telemetry) This gives us a complete desktop with all essential tools while removing only the specific packages we don't want.
1 parent 5020899 commit 79b9d24

1 file changed

Lines changed: 29 additions & 3 deletions

File tree

ansible/roles/dfe_developer/tasks/desktop.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,41 @@
3030
# UBUNTU
3131
# ============================================================================
3232

33-
# NOTE: install_recommends: false prevents LibreOffice from being pulled in
34-
# LibreOffice is opt-in via dfe_install_libreoffice variable
33+
# Install with recommends (gets all essential GNOME tools, fonts, themes)
34+
# Then remove unwanted packages explicitly
3535
- name: Install GNOME desktop (Ubuntu)
3636
ansible.builtin.apt:
3737
name: ubuntu-desktop-minimal
3838
state: present
39-
install_recommends: false
4039
when: ansible_facts['distribution'] == 'Ubuntu'
4140

41+
# Remove unwanted packages that come as recommends
42+
# - firefox: We install Chrome + Brave
43+
# - gnome-initial-setup: We suppress this anyway
44+
# - snapd: We don't use snaps, prefer apt/flatpak
45+
# - ubuntu-report, whoopsie, apport-gtk: Telemetry/crash reporting
46+
- name: Remove unwanted packages (Ubuntu)
47+
ansible.builtin.apt:
48+
name:
49+
- firefox
50+
- gnome-initial-setup
51+
- snapd
52+
- ubuntu-report
53+
- whoopsie
54+
- apport-gtk
55+
- apport
56+
state: absent
57+
purge: true
58+
when: ansible_facts['distribution'] == 'Ubuntu'
59+
60+
# Prevent snapd from being reinstalled as a dependency
61+
- name: Hold snapd package to prevent reinstall
62+
ansible.builtin.dpkg_selections:
63+
name: snapd
64+
selection: hold
65+
when: ansible_facts['distribution'] == 'Ubuntu'
66+
failed_when: false
67+
4268
- name: Install LibreOffice (Ubuntu)
4369
ansible.builtin.apt:
4470
name: libreoffice

0 commit comments

Comments
 (0)