mirror of
https://github.com/actions/runner-images.git
synced 2025-12-10 19:16:48 +00:00
[Ubuntu24] Update pipx installation method (#10872)
This commit is contained in:
committed by
GitHub
parent
a531b96b21
commit
a8d59b2440
@@ -12,24 +12,22 @@ source $HELPER_SCRIPTS/os.sh
|
||||
# Install Python, Python 3, pip, pip3
|
||||
apt-get install --no-install-recommends python3 python3-dev python3-pip python3-venv
|
||||
|
||||
# Install pipx
|
||||
# Set pipx custom directory
|
||||
export PIPX_BIN_DIR=/opt/pipx_bin
|
||||
export PIPX_HOME=/opt/pipx
|
||||
if is_ubuntu24; then
|
||||
apt-get install --no-install-recommends pipx
|
||||
pipx ensurepath
|
||||
|
||||
# Create temporary workaround to allow user to continue using pip
|
||||
sudo cat <<EOF > /etc/pip.conf
|
||||
[global]
|
||||
break-system-packages = true
|
||||
EOF
|
||||
|
||||
else
|
||||
python3 -m pip install pipx
|
||||
python3 -m pipx ensurepath
|
||||
fi
|
||||
|
||||
# Install pipx
|
||||
# Set pipx custom directory
|
||||
export PIPX_BIN_DIR=/opt/pipx_bin
|
||||
export PIPX_HOME=/opt/pipx
|
||||
|
||||
python3 -m pip install pipx
|
||||
python3 -m pipx ensurepath
|
||||
|
||||
# Update /etc/environment
|
||||
set_etc_environment_variable "PIPX_BIN_DIR" $PIPX_BIN_DIR
|
||||
set_etc_environment_variable "PIPX_HOME" $PIPX_HOME
|
||||
|
||||
Reference in New Issue
Block a user