pense-bête de bruno sanchiz

Accueil > Linux > installation d’un linux ou mises à jour > maj ubuntu ou mint vers debian

maj ubuntu ou mint vers debian

Publié le 2 mai 2024, dernière mise-à-jour le 2 mai 2024, 4 visites, visites totales.

s’inspirer de MAJ : betsy vers bullseye
l’idée générale est de changer les sources en un debian équivalent le plus bas possible puis de monter les debian , en regardant toujours les programmes virés et en réinstallant les nécessaires et en ouvrant ceux qui doivent l’être pour leur maj interne ( thunderbird, firefox , …)
Evidemment une sauvegarde préalable est indispensable

par exemple mint betsy est fondée sur jessie ( deb8 ) , j’ai donc mis stretch ( deb9) en sources .list , MAJ normale, MAJ upgrade , puis deb10 puis deb11

enlever ubuntu

d’après https://github.com/alexmyczko/autoexec.bat/blob/master/config.sys/ubuntu-deluxe, non vérifié

# 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")

enlever snap d’abord

d’après https://github.com/alexmyczko/autoexec.bat/blob/master/config.sys/ubuntu-remove-snap-firefox, non vérifié

# ubuntu 24.04
mkdir -p /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null
echo 'Package: *
Pin: origin packages.mozilla.org
Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/mozilla-firefox
apt-get update
apt install firefox
apt-get -uy --purge remove snapd
exit 0

# ubuntu 22.04
snap remove snapd-desktop-integration
snap remove snap-store
snap remove gtk-common-themes
snap remove gnome-3-38-2004
snap remove firefox
snap remove core20
snap remove bare
snap remove snapd
apt-get -uy --purge remove snapd
kill -9 $(echo $(ps -ef | pgrep snap))

# https://forum.snapcraft.io/t/sdb5-mounted-on-firefox/31897
systemctl disable var-snap-firefox-common-host\\x2dhunspell.mount
umount /var/snap/firefox/common/host-hunspell

add-apt-repository -y ppa:mozillateam/ppa
echo 'Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001' | sudo tee /etc/apt/preferences.d/mozilla-firefox
apt-get update
apt-get -uy install firefox
[bruno sanchiz]