Обновить python linux kali

How to Install Python 3 on Kali Linux

In this tutorial, you will learn how to get the latest version of Python and pip installed on Kali Linux. Python can be installed from the Kali software repository with apt command, or we can get the latest Python release or pre-release from Python.org. We’ll cover both methods below.

Install From Kali Repo

Step 1. To check what version of Python is installed in your system:

$ python3 --version Python 3.10.8

Step 2. To install the latest version of Python, execute the following command:

$ sudo apt update $ sudo apt install python3

Step 3. To install pip on Kali (the package installer for Python):

$ sudo apt install python3-pip

Step 4. To launch Python, simply execute the next command:

Install Latest Version From Official Download

The next method takes a few additional steps, but ensures that you download and install the absolute latest Python release.

Step 1. Before installing Python, always make sure that you have your system up to date:

$ sudo apt update $ sudo apt upgrade

Step 2. Next, we’ll install the dependencies:

$ sudo apt install build-essential pkg-config zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev libbz2-dev

Step 3. Navigate to the Python download page and choose from either the latest stable release or pre-release version. Download either the compressed gzipped tarball, or the xz tarball.

Step 4. Extract the downloaded file with tar command:

$ cd ~/Downloads $ tar -xf Python-*

Step 5. Change into the directory where the Python source was extracted:

Читайте также:  What is kernel linux wiki

Step 6. Optimize the Python build process by executing:

$ ./configure --enable-optimizations

Step 7. Once done, we build the Python source with the make command followed by the -j parameter and the number of CPU cores you want to dedicate to the process. You can check how many CPU cores you have in your system by running the nproc command.

Step 8. Finally, proceed to install Python:

Note: the altinstall option is necessary to ensure that the system-default Python files won’t be touched.

Step 9. To verify that the installation was successful, execute the following command and you should see the expected version number:

Note: Replace 3.11 with the version number that you installed.

Источник

How to Update Python in Kali Linux?

Kali Linux comes with Python3 installed, but you need to make sure it’s updated as older versions of python may not work any longer.

Before Updating the kali Linux, first, determine what python version is currently installed in it. For this, open the Kali Linux terminal, and type Python — version. Hit enter to run this command and it will show the version of python in your kali Linux.

As of now (2022, 20th October) The latest version of python is Python 3.9.15. Or verify the latest python version from the official website. Less than this version means it’s older and thus needed an upgrade.

Now start updating python in Kali Linux. Open the Terminal Again. And write this command, sudo apt-get install python3. Hit enter and then enter the password of your Kali Linux to execute this command. An automatic process will start that will download all the essential libraries, and files. Wait for a few minutes to let the process finish.

Читайте также:  Gitlab runner install linux

After this simple step, your python should update if there is nothing wrong with the system from your side.

Troubleshooting.

Make sure you’ve written the correct command (sudo apt-get install python3) without brackets, there should be no extra spaces, commas, or alphabetical mistakes.

Make sure your Kali Linux is updated, otherwise chances of getting an error are normal.

Источник

Оцените статью
Adblock
detector