-
Notifications
You must be signed in to change notification settings - Fork 0
/
update.sh
executable file
·61 lines (56 loc) · 1.54 KB
/
update.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
# Update 14.04 to 16.04
apt update || echo
apt upgrade -y --force-yes || echo
apt install -y update-manager-core
do-release-upgrade -f DistUpgradeViewNonInteractive
# Update 16.04 to 18.04
apt update || echo
apt upgrade -y --force-yes || echo
do-release-upgrade -f DistUpgradeViewNonInteractive
# Update 18.04 to 20.04
apt update || echo
apt upgrade -y --force-yes || echo
do-release-upgrade -f DistUpgradeViewNonInteractive
apt remove -y usrmerge
# Update 20.04 to 22.04
apt update
apt upgrade -y \
--allow-downgrades \
--allow-remove-essential \
--allow-change-held-packages
do-release-upgrade -f DistUpgradeViewNonInteractive || test $? -eq 1
apt remove -y usrmerge
# Install latest docker
for pkg in docker.io docker-doc docker-compose docker-compose-v2 \
podman-docker containerd runc; do sudo apt-get remove $pkg; done
apt install -y curl
apt autoremove -y
curl -fsSL https://get.docker.com | sh
apt remove -y $(dpkg-query --show 'linux-modules-*' | cut -f1 | grep -v "$(uname -r)")
rm -rf \
/tmp \
/boot \
/usr/lib/firmware \
/usr/lib/jvm/java-8-openjdk-amd64 \
/usr/share/doc \
/usr/share/man
find /usr/share/locale \
-mindepth 1 -maxdepth 1 \
-not -name en \
-execdir rm -rf {} +
mkdir /.docker
mkdir /tmp
mkdir /boot
mkdir -p /usr/lib/firmware
mkdir -p /usr/lib/jvm/java-8-openjdk-amd64
mkdir -p /usr/share/doc
mkdir -p /usr/share/man
chmod 777 \
/.docker \
/boot \
/tmp \
/usr/lib/firmware \
/usr/lib/jvm/java-8-openjdk-amd64 \
/usr/share/doc \
/usr/share/man