-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
ubuntu-deluxe
executable file
·76 lines (66 loc) · 3.79 KB
/
ubuntu-deluxe
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# BEWARE. HERE BE DRAGONS. IF YOU CONTINUE YOU WILL GET UBUNTU DELUXE
# better known as debian.
# alternative would be
#https://wiki.debian.org/DebianTakeover
# we assume you already got rid of:
# - snap, https://github.com/alexmyczko/autoexec.bat/blob/master/config.sys/ubuntu-remove-snap-firefox
# - external repos, mv /etc/apt/sources.list.d/* /usr/src/
# before the upgrade/dist-upgrade
# remove all -dev+-dev:amd64 packages, stash the list somewhere, at the end install them again
dpkg -l |grep ^ii|grep -- -dev| awk '{print $2}' > /root/dev.pkgs
apt-get --purge remove `cat /root/dev.pkgs`
# install debian repo keys and debian repo
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 0E98404D386FA1D9
cat > /etc/apt/sources.list << EOF
deb http://debian.ethz.ch/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://debian.ethz.ch/debian/ bookworm main contrib non-free non-free-firmware
# enable following two lines on 10/06/2023
#deb http://security.debian.org/debian-security bookworm-security main
#deb-src http://security.debian.org/debian-security bookworm-security main
# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://debian.ethz.ch/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src http://debian.ethz.ch/debian/ bookworm-updates main contrib non-free non-free-firmware
EOF
# remove ubuntu hack
rm /etc/profile.d/01-locale-fix.sh
# update pkg index
apt-get update
#
#export DEBIAN_FRONTEND=noninteractive
eatmydata apt-get upgrade -uy
eatmydata apt-get dist-upgrade
# might need a few apt --fix-broken install
# together with dpkg -P --force-all
# dpkg -P --force-all libjpeg-turbo8-dev libgstreamer-plugins-good1.0-0 gconf-service-backend grilo-plugins-0.3-base plymouth-theme-spinner libsgutils2-2 libkf5baloowidgets-data
#
# apt-get --purge remove ess nautilus-sendto libwhoopsie0 libruby3.0
# apt --purge remove `deborphan |grep ^lib`
# apt-get --purge remove libfmt8 gcc-11-doc libstd-rust-1.65 libperl5.34 perl-modules-5.34 qemu unity telepathy-mission-control-5
# apt-get --purge remove zram-config
# apt-get --purge remove finalrd dpatch hw-probe smartmontools guile-cairo libgwrap-runtime2
# apt-get --purge remove guile-g-wrap guile-gnome2-glib guile-gnome2-gtk linux-sound-base libprocps8
# apt-get --purge remove indicator-messages indicator-common libreoffice-style-yaru fusesmb denef ctop
#
# list obsolete or local packages
# apt list '~o'
apt-get install linux-image-amd64 firmware-linux-free
# removing ubuntu only packages
apt-get --purge remove whoopsie-preferences
apt-get --purge remove fonts-khmeros-core fonts-takao-pgothic mknfonts.tool xfonts-cyrillic
apt-get --purge remove `dpkg -l |grep ubuntu- |awk '{print $2}'`
apt-get --purge remove `dpkg -l |grep unity- |awk '{print $2}'`
apt-get --purge remove `dpkg -l |grep curtin|awk '{print $2}'`
apt-get --purge remove `deborphan |grep libpcl` # 6x
apt-get --purge remove `deborphan |grep opencv` # 6x
apt-get --purge remove openjdk-8.* openjdk-11.* llvm-11.* python3.10.* gcc-9.*
apt-get --purge remove `deborphan |grep ^lib` # 6x
apt-get --purge remove language-selector-.*
# try to upgrade all packages (libs first, the not libs) that are not from debian sources.list to debian ones
for a in $(apt-forktracer |grep ^lib |awk '{print $1}' |sort); do apt reinstall $a/bookworm -uy --allow-downgrades;done
for a in $(apt-forktracer |awk '{print $1}' |sort); do apt reinstall $a/bookworm -uy --allow-downgrades;done
apt-get install -uy `cat /root/dev.pkgs`
rm /root/dev.pkgs
# list packages not installe from repos
apt list --installed 2>/dev/null | grep installed,local
# apt-get --purge remove $(apt list --installed 2>/dev/null | grep installed,local |awk '{print $1}' |sed "s,/now,,g")