Skip to content

Commit

Permalink
postinst: Don't use pip on Ubuntu 24.10
Browse files Browse the repository at this point in the history
    ++ python3 /tmp/get-pip.py
    error: externally-managed-environment

    × This environment is externally managed
    ╰─> To install Python packages system-wide, try apt install
        python3-xyz, where xyz is the package you are trying to
        install.

        If you wish to install a non-Debian-packaged Python package,
        create a virtual environment using python3 -m venv path/to/venv.
        Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
        sure you have python3-full installed.

        If you wish to install a non-Debian packaged Python application,
        it may be easiest to use pipx install xyz, which will manage a
        virtual environment for you. Make sure you have pipx installed.

        See /usr/share/doc/python3.12/README.venv for more information.

    note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
    hint: See PEP 668 for the detailed specification.
    ++ return
    dpkg: error processing package bluecherry (--configure):
     installed bluecherry package post-installation script subprocess returned error exit status 1
    Processing triggers for php8.3-cli (8.3.11-0ubuntu0.24.10.2) ...
    Processing triggers for php8.3-fpm (8.3.11-0ubuntu0.24.10.2) ...
    Processing triggers for libc-bin (2.40-1ubuntu3) ...
    Errors were encountered while processing:
     bluecherry
    Error: Sub-process /usr/bin/dpkg returned an error code (1)
  • Loading branch information
andrey-utkin committed Dec 12, 2024
1 parent 5b7b1bc commit ef2c5ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion misc/postinstall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ function install_certbot
elif [[ "$ID" == ubuntu ]] && [[ "$VERSION_CODENAME" == mantic ]]; then
echo 'For Ubuntu 23.10 (mantic) we rely on packaged certbot'
return
elif [[ "$ID" == ubuntu ]] && [[ "$VERSION_CODENAME" == oracular ]]; then
echo 'For Ubuntu 24.10 (oracular) we rely on packaged certbot'
return
elif [[ "$ID" == debian ]] && [[ "$VERSION_CODENAME" == bookworm ]]; then
echo 'For Debian 12 (bookworm) we rely on packaged certbot'
return
Expand All @@ -113,7 +116,7 @@ function install_certbot
export PATH=/usr/local/bin:"$PATH"

# Ubuntu 23+, Debian 12 make this step fail. Fall back to system package.
install_pip || return
install_pip || return 0

# Install pip3 dependencies
pip3 install --user --upgrade setuptools_rust certbot certbot-dns-subdomain-provider
Expand Down

0 comments on commit ef2c5ff

Please sign in to comment.