Skip to content

Commit 37cf4fb

Browse files
committed
Add script and readme to repository
1 parent f09b724 commit 37cf4fb

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# update-ubuntu-python
22
A script to install the most up-to-date branch of Python on Ubuntu.
3+
4+
# usage
5+
- Run as root.

update-ubuntu-python.sh

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
3+
# Ottinger Digital Labs, LLC
4+
#
5+
# Author: Evan Ottinger @OttySec
6+
#
7+
# Description: A script to update Python3 to the latest
8+
# version on Ubuntu.
9+
#
10+
# Not guaranteed, use at your own risk, yadayada.
11+
12+
## Add the deadsnakes ppa branch to the apt repository
13+
add-apt-repository ppa:deadsnakes/ppa
14+
15+
## Update the apt database
16+
apt update
17+
18+
## Install the latest version of Python
19+
apt install python3.10
20+
21+
## Make Python3.10 the default version
22+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
23+
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
24+
25+
## Remove the default version of Python
26+
apt remove python3.8
27+
apt autoremove
28+
29+
## Fix pip3
30+
apt install python3.10-distutils
31+
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
32+
python3.10 get-pip.py
33+
rm get-pip.py
34+
35+
## Fix venv
36+
apt install python3.10-venv
37+
38+
## Fix Python3-apt
39+
apt remove --purge python3-apt
40+
apt autoremove
41+
42+
## Fix link to Python3
43+
update-alternatives --config python3

0 commit comments

Comments
 (0)