FREE TRIAL

Deploy a Free VPS Server Worldwide. No Credit Card Required.

Start Free Trial
  • +357 2425 0808
  • Login
  • English

Home

Blog

How To Install Latest Python 3.11 on Ubu...

How To Install Latest Python 3.11 on Ubuntu Server

How To Install Latest Python 3.11 on Ubuntu Server

NetShop ISP

NetShop ISP · Blog Author

Dec 03, 2022 · Tutorials

Python is one of the most popular and fastest-growing object-oriented programming languages. Python is mostly used for building websites, applications for mobile, web and desktop. It is also the programming language of choice for automating tasks and conducting data analysis.

At the time of writing this article (December 2022) there are two main Python versions being used; Python v2 and v3. Whilst Python 2 will see no major releases, the v3 is under active development and has already seen a lot of stable releases. Currently, the latest stable version is 3.11 which was released on Oct. 24, 2022.

In this article we will demonstrate how to install the latest Python 3.11 version on an Ubuntu server via the apt package manager, and also how to set the default Python version in case you have multiple versions installed on your server.

Install Python 3.11 on Ubuntu using apt

In this tutorial we will be using the “deadsnakes” repository as it contains the more recent Python versions ready for Ubuntu.

Pre-requisites

  1. root access (or any sudo level user account)
  2. Ubuntu server (in this tutorial we are using Ubuntu Server 22.10)

Easy Steps to Install Python 3.11 on Ubuntu

Login to your Ubuntu server and type the following commands:

root@ubuntu-server:~$ sudo add-apt-repository ppa:deadsnakes/ppa
root@ubuntu-server:~$ sudo apt update
root@ubuntu-server:~$ sudo apt install python3.11

By adding the repository ppa:deadsnakes/ppa allows us to install other versions as well. See below the commands for installing old python versions.

root@ubuntu-server:~$ sudo apt install python3.11
root@ubuntu-server:~$ sudo apt install python3.10
root@ubuntu-server:~$ sudo apt install python3.7

Finally, type the following command to see all Python binaries installed on your Ubuntu server.

root@ubuntu-server:~$ ls -l /usr/bin/python*

Sample Output:

lrwxrwxrwx 1 root root      10 Dec 2  2022 /usr/bin/python3 -> python3.10
-rwxr-xr-x 1 root root 5901416 Dec  2  2022 /usr/bin/python3.10
-rwxr-xr-x 1 root root 6705016 Dec 3 09:45 /usr/bin/python3.11
-rwxr-xr-x 1 root root     960 Dec 2  2022 /usr/bin/python3-futurize
-rwxr-xr-x 1 root root     964 Dec 2  2022 /usr/bin/python3-pasteurize

In our system, the default Python version used is 3.10, as indicated by the symlink:
lrwxrwxrwx 1 root root 10 Dec 2 2022 /usr/bin/python3 -> python3.10

We can also verify the current Python version by executing the following command:

root@ubuntu-server:~$ python -V

Sample Output:

Python 3.10.4
To use Python 11 whilst maintaining an older version as default, type the following command and hit 'Enter':
root@ubuntu-server:~$ python3.11

By doing so you will enter the Python Shell. To exit the Python interpreter, type the following commands within the shell and then press ‘Enter’:

quit()
OR
exit()

Change Default Python Version on Ubuntu Server

In the case you have multiple Python versions installed, you can change the default version as follows. In our example, our Ubuntu server had as default Python 3.10 and we will change it to Python 3.11.

root@ubuntu-server:~$ python3 --version
root@ubuntu-server:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
root@ubuntu-server:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2
root@ubuntu-server:~$ sudo update-alternatives --config python3
root@ubuntu-server:~$ python3 --version

That’s all! If you followed all the steps above you have successfully installed Python 3.11 on your Ubuntu server!

Categories

Backup
6
Business Continuity
4
Cloud Hosting
10
Colocation
4
Company Updates
1
Cryptocurrencies
1
Data Centers
12
Dedicated Servers
4
Disaster Recovery
3
Forex
25
Gaming
1
iGaming
33
Industry News
32
Interviews
10
Joomla
9
Magento
5
Managed Services
1
Operating Systems
1
Press Releases
65
Product News
6
Resellers
1
Security
25
Software & Apps
1
Streaming
1
Tech Startups
12
Tutorials
61
Uncategorized
389
Vps Hosting
11
Web Design & Development
3
Web Hosting
44
Webinars
1
Wordpress
14

Free VPS Trial

No Credit Card Required.

Recent Posts

How To Enable Remote Connections to SQL Server

How To Enable Remote Connections to SQL Server

27 March, 2023

How To Fix Error Failed to download metadata for repo in CentOS 8

How To Fix Error Failed to download metadata for repo in CentOS 8

23 March, 2023

How can Forex Brokers be Protected from DDoS Attacks

How can Forex Brokers be Protected from DDoS Attacks

20 March, 2023

NetShop ISP Bronze Sponsors for the University of Cyprus at Harvard WorldMUN 2023

NetShop ISP Bronze Sponsors for the University of Cyprus at Harvard WorldMUN 2023

15 March, 2023

Top 5 Cloud Computing Trends in 2023

Top 5 Cloud Computing Trends in 2023

13 March, 2023

#letushostyou

Award Winning Hosting Provider established in 2004.

Best iGaming Service ProviderISO Certified

120 Faneromenis Avenue, Imperial Tower, 2nd Floor, Larnaca 6031, Cyprus

Products

Bare Metal Servers

Customized Servers

Virtual / Cloud Servers

Forex VPS

Storage VPS

cPanel Web Hosting

Reseller Web Hosting

Colocation

Addons

Premium DNS

Email Hosting

Cloud Backup

DDoS Protection

Licenses

SSL Certificates

Domain Names

Premium SLAs

About Us

Data Center Locations

Looking Glass

Our Company

Contact Us

Careers in Cyprus

Become a Partner

Awards

Certifications

© 2023 S.S. NetShop Internet Services Ltd. All rights reserved.  Terms & Conditions  |  Privacy Policy
CY Reg. Number: HE 217340 | EU VAT Number: CY10217340J

Visa
Mastercard
PayPal
Bitcoin
Tether
Ethereum
Litecoin
Wise
Revolut
Wire Transfer