dot_config/install_python3.sh

25 lines
596 B
Bash
Raw Normal View History

2023-05-08 10:25:33 -04:00
#!/bin/bash
# Update the package list
sudo apt-get update
# Install the software-properties-common package
sudo apt-get install software-properties-common
# Add the deadsnakes PPA to the sources list
sudo add-apt-repository ppa:deadsnakes/ppa
# Update the package list again
sudo apt-get update
# Check the latest version of Python 3 available
latest_version=$(apt-cache madison python3 | awk '{print $3}' | grep "^3\." | sort -V | tail -1)
# Install the latest version of Python 3
sudo apt-get install -y python3=$latest_version
# Verify the installation
python3 --version
which python3