Skip to content

Commit bddab1e

Browse files
author
Derek
committed
fix(gnome): add --break-system-packages for Ubuntu PEP 668 compliance
Ubuntu 24.04+ has PEP 668 protection that prevents pip from installing to system Python. Add the flag conditionally for Ubuntu only (Fedora doesn't need it).
1 parent 926a51f commit bddab1e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ansible/roles/dfe_developer/tasks/gnome_common.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,21 @@
5050

5151
# Distro-packaged pipx can be outdated (Ubuntu 24.04 has 1.4.3).
5252
# community.general.pipx requires >= 1.7.0 for application parameter.
53-
# Upgrade pip and pipx system-wide - overwrites older distro versions in-place
53+
# Upgrade pip and pipx system-wide - overwrites older distro versions in-place.
54+
# --break-system-packages required on Ubuntu 24.04+ (PEP 668 protection).
5455
- name: Upgrade pip to latest (system-wide)
5556
ansible.builtin.pip:
5657
name: pip
5758
state: latest
59+
extra_args: "{{ '--break-system-packages' if ansible_facts['distribution'] == 'Ubuntu' else omit }}"
5860
become: true
5961
when: ansible_facts['distribution'] in ['Ubuntu', 'Fedora']
6062

6163
- name: Upgrade pipx to latest (system-wide)
6264
ansible.builtin.pip:
6365
name: pipx
6466
state: latest
67+
extra_args: "{{ '--break-system-packages' if ansible_facts['distribution'] == 'Ubuntu' else omit }}"
6568
become: true
6669
when: ansible_facts['distribution'] in ['Ubuntu', 'Fedora']
6770

0 commit comments

Comments
 (0)