Skip to content

Remove --break-system-packages flag from aqtinstall installation just for Ubuntu 22.04 compatibility #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

acrucha
Copy link
Member

@acrucha acrucha commented Apr 22, 2025

📝 Summary

This PR removes the --break-system-packages flag from the pip3 install aqtinstall command in the Qt installation script for Ubuntu 22.04.

While the flag is supported and functions correctly on newer versions of pip3 (e.g., Ubuntu 24.04), it leads to failure on Ubuntu 22.04 due to stricter protections against modifying system-managed Python environments. By removing the flag, we ensure smoother compatibility with Ubuntu 22.04 without relying on pip internals or requiring manual intervention.

🎯 Changes made

This PR removes the --break-system-packages argument from the following line in the Qt installation script if Ubuntu version is 22.04:

pip3 install aqtinstall --break-system-packages

Now becomes:

UBUNTU_VERSION=$(lsb_release -rs)

if dpkg --compare-versions "$UBUNTU_VERSION" ge "24.04"; then
  pip3 install aqtinstall --break-system-packages
else
  pip3 install aqtinstall
fi

❓ Why This Change Was Made

  • The --break-system-packages flag is commonly used on Debian-based systems (e.g., Ubuntu 22.04+) to bypass certain package management protections in Python. While useful, it can lead to system instability or package conflicts. On Ubuntu 24.04, this flag is needed to bypass the externally-managed-environment error when installing aqtinstall via pip3.
  • For Ubuntu 22.04, removing this flag enhances compatibility and promotes safer package management, particularly in environments that depend on system-level Python packages.

🚀 Impact

  • No change in the script's core functionality.
  • Increases portability and ensures greater compatibility across multiple Ubuntu versions.

✅ How to test?

  • Follow the standard instructions to install all dependencies for either the VSS or SSL projects, using this branch of scripts-ubuntu-common.
  • Perform the installation on both Ubuntu 22.04 and 24.04 environments to verify compatibility and behavior.

💡 Tip! You can quickly validate the script by:

  • Running it inside a Docker container based on each Ubuntu version, or
  • Triggering the project's GitHub Actions to verify that everything builds correctly in CI.

@acrucha acrucha added the bug Something isn't working label Apr 22, 2025
@acrucha acrucha changed the title Remove --break-system-packages flag from aqtinstall installation for broader Ubuntu compatibility Remove --break-system-packages flag from aqtinstall installation just for Ubuntu 22.04 compatibility Apr 22, 2025
@acrucha acrucha requested a review from maa134340 April 25, 2025 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant