-
Notifications
You must be signed in to change notification settings - Fork 0
/
jammyubuntu.sh
30 lines (22 loc) · 1 KB
/
jammyubuntu.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
#!/bin/bash
# Buat cadangan file sources.list
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
# Mengubah repositori dari focal ke jammy
sudo sed -i 's/focal/jammy/g' /etc/apt/sources.list
# Ganti dengan mirror baru
sudo bash -c 'cat <<EOF > /etc/apt/sources.list
deb http://mirror.poliwangi.ac.id/ubuntu/ jammy main restricted universe multiverse
deb http://mirror.poliwangi.ac.id/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirror.poliwangi.ac.id/ubuntu/ jammy-security main restricted universe multiverse
deb http://mirror.poliwangi.ac.id/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirror.poliwangi.ac.id/ubuntu/ jammy-proposed main restricted universe multiverse
EOF'
# Memperbarui daftar paket
sudo apt update
# Melakukan upgrade
sudo apt upgrade -y
# Melakukan dist-upgrade
sudo apt dist-upgrade -y
# Menghapus paket yang tidak diperlukan
sudo apt autoremove -y
echo "Pembaruan sistem dari Focal ke Jammy telah selesai dan repositori telah diganti."