Trace: odoo_mis ubuntu_debian

Ubuntu 2 Debian

Table of Contents

This page tries to convert one Ubuntu installation to Debian GNU/Linux.

Why

Short answer: Why not?
Long answer: I was happily using Oracle Cloud Infrastructure with Debian GNU/Linux self created images until one day Oracle stopped to support that on the free usage tier. They only provide few options like Ubuntu, Oracle and CentOS, the most close option is Ubuntu… but I don´t like because I don´t like.

How

Requirements

  • WIP
  • The principal requirement is to use a Ubuntu Server LTS version that was released before of the freeze of the Debian version that you want to move. So for example, Ubuntu 20.04 was released April 23, 2020 and Debian 12 was freezed January 12, 2023 (first freeze, hard freeze was on May 24, 2023), so that will be an option. Ubuntu LTS 22.04 was release on April 21, 2022 so is this one option too.

Stop talking... how?

Ubuntu 20.04
  • WIP
  • Tested with Ubuntu 20.04 to Debian 12
  • Update your Ubuntu:
apt-get update
apt-get upgrade
  • Replace /etc/apt/sources.list with:
#deb cdrom:[Debian GNU/Linux 12.2.0 _Bookworm_ - Official amd64 NETINST with firmware 20231007-10:28]/ bookworm main non-free-firmware

deb http://deb.debian.org/debian/ bookworm main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main non-free-firmware

deb http://security.debian.org/debian-security bookworm-security main non-free-firmware
deb-src http://security.debian.org/debian-security bookworm-security main non-free-firmware

# 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://deb.debian.org/debian/ bookworm-updates main non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main non-free-firmware

# This system was installed using small removable media
# (e.g. netinst, live or single CD). The matching "deb cdrom"
# entries were disabled at the end of the installation process.
# For information about how to configure apt package sources,
# see the sources.list(5) manual.
  • Import Debian Keyring:
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys '0E98404D386FA1D9'
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys '6ED0E7B82643E131'
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 'F8D2585B8783D481'
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys '54404762BBB6E853'
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 'BDE6D2B9216EC7A8'
cd /etc/apt/trusted.gpg.d/
wget https://ftp-master.debian.org/keys/archive-key-12.asc
wget https://ftp-master.debian.org/keys/archive-key-12-security.asc
  • Update Debian repositories:
apt-get clean
apt-get clean all
apt-get update
apt-get dist-upgrade
  • Before press enter review what will updated, what will removed and what will kept. If you are sure of everything before… press enter… wait to download
  • Answering of the questions of apt is your decision, as I want to convert my Ubuntu to Debian from a clean new image I answer to everything yes, like restart services without ask or replace files with maintainers version, except to participate on package survey.
  • Process didn´t finish with the correctly because the following error:
Unpacking amd64-microcode (3.20230808.1.1~deb12u1) over (3.20191218.1ubuntu1.2) ...
dpkg: error processing archive /var/cache/apt/archives/amd64-microcode_3.20230808.1.1~deb12u1_amd64.deb (--unpack):
 trying to overwrite '/lib/firmware/amd/amd_sev_fam17h_model0xh.sbin', which is also in package linux-firmware 1.187.39
Errors were encountered while processing:
 /var/cache/apt/archives/amd64-microcode_3.20230808.1.1~deb12u1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • Fix the problem removing the package:
apt-get remove --purge linux-firmware
  • apt will continue the installation, wait to finish… is slow
  • Repeat again:
apt-get dist-upgrade
  • Take care of the following step, that will remove all packages that apt thinks are useless but maybe you not =):
apt-get autoremove --purge
  • /etc/resolv.conf will be broken so you need to create a new one:
nameserver 94.140.14.14
nameserver 94.140.15.15

* Install Linux kernel (if you are using Ampere… change to arm64 or something more appropiate):

apt-get install linux-image-amd64
  • Remove old kernels:
dpkg -l |grep linux-image
dpkg -l |grep linux-headers
apt-get remove --purge linux-headers-5.4.0-144-generic linux-headers-5.4.0-169-generic
  • Reboot. Is very probable that you can´t reboot the operating system by an error with the libraries… so I made a hard reboot with the hyper visor. At this point you are working on Debian, following steps are more adjustments related to issues or remaining packages of Ubuntu.
  • If you see this error:
-bash: /usr/bin/locale-check: No such file or directory

Delete the following file:

rm /etc/profile.d/01-locale-fix.sh
  • Remove all Ubuntu related crap, ignore the sudo error, if you don't have root with password you will lost access to the server:
apt-get remove --purge ubuntu-*
  • Check packages that weren´t upgrade and you don´t want, take care with ca-certificates and cloud-init packages if you are using a cloud:
dpkg -l |grep ubuntu
apt-get remove <packages>
apt-get autoremove --purge
  • Fix motd banner:
rm /etc/lsb-release
cp /usr/share/base-files/motd /etc/motd
cd /etc/update-motd.d
ls
rm 10-help-text 50-motd-news 85-fwupd # remove all if you want
  • Everything is OK except poweroff or reboot the server… I need to make a research to fix that.
  • Remove Ubuntu's cloud-init:
apt-get remove --purge cloud-init*
  • Remove Ubuntu's ca-certificates and install Debian's ca-certificates:
apt-get remove --purge ca-certificates
apt-get autoremove --purge
apt-get install ca-certificates cloud-init # Use cloud-init if applies
  • Fix lvm2 package missing (to support LVM Logical Volumes and Volume Groups)
apt-get install lvm2
  • Fix vim package missing (or nano if you use that)
apt-get install vim
Ubuntu 22.04
  • WIP
  • Follow the same steps of 20.04 but check the following fixes:
  • If you receive this error:
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 sg3-utils : Depends: libsgutils2-1.46-2 (>= 1.46) but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

You can remove the package and install after the upgrade, take on consideration that will remove multipath support:

apt-get remove --purge sg3-utils sg3-utils-udev  multipath-tools ubuntu-server ubuntu-server-minimal
apt-get dist-upgrade
  • Process didn´t finish with the correctly because the following error:
Unpacking amd64-microcode (3.20230808.1.1~deb12u1) over (3.20191218.1ubuntu1.2) ...
dpkg: error processing archive /var/cache/apt/archives/amd64-microcode_3.20230808.1.1~deb12u1_amd64.deb (--unpack):
 trying to overwrite '/lib/firmware/amd/amd_sev_fam17h_model0xh.sbin', which is also in package linux-firmware 1.187.39
Errors were encountered while processing:
 /var/cache/apt/archives/amd64-microcode_3.20230808.1.1~deb12u1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
  • Fix the problem removing the package:
apt-get remove --purge amd64-microcode

References

ubuntu_debian.txt · Last modified: 2023/12/21 16:18
Public Domain Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain