File tree 2 files changed +46
-0
lines changed
2 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1
1
# update-ubuntu-python
2
2
A script to install the most up-to-date branch of Python on Ubuntu.
3
+
4
+ # usage
5
+ - Run as root.
Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments