Update readme.md

This commit is contained in:
2024-10-03 08:51:05 +03:00
parent 4ad5070325
commit 8a8cfb3b17

View File

@@ -1,4 +1,4 @@
### How to Use the Script
### How to Use the Installer Script
1. **Make the script executable**: Make the script executable using the `chmod` command:
@@ -10,4 +10,34 @@
`./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.
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`