Files
python3_pip_installer/readme.md
2024-10-03 08:51:05 +03:00

1.6 KiB

How to Use the Installer Script

  1. Make the script executable: Make the script executable using the chmod command:

    chmod +x install_latest_python.sh

  2. Run the script: Execute the script:

    ./install_latest_python.sh

This will automatically install the latest Python version (as per the specified PYTHON_VERSION in the script) and pip. Modify PYTHON_VERSION=3.12 to the specific version you want, such as 3.12.7 if necessary.

How the Uninstaller Works:

  1. Detecting Python version: The script detects the installed Python version using python3 --version and extracts the version number. If no Python version is detected, the script exits with an error message.

  2. Uninstalling Python: The script uninstalls the detected Python version along with related packages (venv, dev, distutils).

  3. Uninstalling pip: The script removes pip.

  4. Removing the deadsnakes PPA: It checks if the deadsnakes PPA exists in the system and removes it.

  5. Cleaning up remaining packages: It runs apt autoremove to remove unnecessary dependencies.

  6. Verifying uninstallation: It checks whether Python and pip are successfully uninstalled.

How to Use the Uninstaller Script

  1. Create the script file: Save the script as uninstall_python.sh.

    nano uninstall_python.sh

  2. Make the script executable: Make the script executable using the chmod command:

    chmod +x uninstall_python.sh

  3. Run the script: Execute the script:

    ./uninstall_python.sh