Upgrade older Linux Mint, Ubuntu or Debian to latest Debian
As these systems use apt, you should just be able to update /etc/apt/sources.list and maybe files in /etc/apt/sources.list.d/* with the lines for the latest Debian version and hit apt update, apt upgrade and apt dist-upgrade. Things are however not that easy. Trying it on Linux Mint 16 (based on Ubuntu 13.10 based on Debian 7 Wheezy) to upgrade to Debian 13 Trixie resulted in error about unsupported xz packages. Trying it on Debian 10 to upgrade to Debian 13 Trixie resulted in usrmerge error. The system should be able to solve the problems on its own and finish the upgrade as requested. No one wants to fiddle with aptitude, dpkg and so on. The most working method is to upgrade to one Debian version at a time, first the one closest to your current OS version, then the next. If you decide to do an upgrade from one older version to a newer with some versions in between please note: - You have to babisit the installation process. Like other Debian installations you will have to answer questions about replacing configurations to make it proceed. But this will be multiplied with the quantity of steps you decide on, for example going from Debian 11 to 12 to 13 will double it. - It fails repeatedly at any time in the process and you have to fix all problems by repeating apt, dpkg and remove files. - It takes much more time than just a re-install since you are multiplying the installation time. - You get a final OS that contains junk files and awkward problems. - The content you fight to keep, like the configurations in /etc/ might actually hinder the target version of Debian from working properly since leftover junk like that might be left after the upgrades. For example, X11/lightdm configs from Linux Mint 16 made Debian 13 MATE Desktop refuse to start. My suggestion to save time is: Take a backup of the important stuff - /etc/, /home/, /root/. Try to upgrade directly to the latest version. If it fails, wipe the partition and re-install, then put your files back from the backup. Or if you really must do an upgrade: Take one version at a time, go from 7 to 8, then from 8 to 9 and so on.
Simpler solution - backup and re-install
The simple solution is to backup the contents you want to keep and re-install. You might want to keep /root/, /home/, /etc/ and maybe more After re-installing, move needed files from the backup of /etc/ into /etc/, re-create the users, then replace the user directories in /home/ with the directories of your backup of /home/ and selected files of the backup of /root/ into /root/.
Harder solution - upgrade with apt
Before you begin, purge as much content from the source OS as possible - purge desktop applications such as Gimp and Filezilla and so on with apt purge so also the configurations are removed. List installed packages: dpkg -l|grep ii Purge those you decide you can remove - both programs and configurations: apt purge <package name> Search for available packages: apt-cache search <package name> Then find the apt sources needed: https://debiansupport.com/mirrors/ NOTE, choose the version closest to the version of your old OS, for example for Linux Mint 16 that is based on Ubuntu 13.10 that is based on Debian 7 you might select 7 or 8. The reason for this is that it is less prone to errors to do so. Then when you have installed the older Debian version you can repeat the steps to slowly upgrade one Debian version at a time. Input these into /etc/apt/source.list Since the GPG-keys are not available, add [trusted=yes] after deb on each line: deb [trusted=yes] http://archive.debian.org/debian jessie main deb [trusted=yes] http://archive.debian.org/debian-security jessie/updates main Move /etc/apt/source.list.d/<files> somewhere else: mkdir /etc/apt/source.list.d.OLD mv /etc/apt/source.list.d/* /etc/apt/source.list.d.OLD/ Then do the usual: apt update apt upgrade apt dist-upgrade On apt update you will get this - and you can ignore it due to [trusted=yes] - just proceed with apt upgrade: W: GPG error: http://archive.debian.org jessie/updates InRelease: The following signatures were invalid: KEYEXPIRED 1668892417 KEYEXPIRED 1747766513 KEYEXPIRED 1747766513 KEYEXPIRED 1747766513 KEYEXPIRED 1747766513 KEYEXPIRED 1747766513 KEYEXPIRED 1747766513 KEYEXPIRED 1747766513 W: GPG error: http://archive.debian.org jessie Release: The following signatures were invalid: KEYEXPIRED 1587841717 You will probably get a lot of upgrade errors, generally you will have to re-run apt upgrade and apt apt dist-upgrade and check the MB amounts, while you work your way through the errors and retry the MB size will decrease. General commands to try first when the install stops - repeat these frequently on unknown errors, also apt upgrade and apt dist-upgrade. dpkg --configure -a apt install -f apt install --fix-broken On other errors see separate sections below. Avoid rebooting until you have installed everything needed, the risks are high that you will need a live CD to chroot-mount the system to continue fixing it since it will not boot. If you finally get no output on apt upgrade and apt dist-upgrade except held back packages, then start to remove the held back packages with dpkg --remove <package name>. Then check for remaining junk from the original installation: dpkg -l |grep mint dpkg -l |grep ubuntu Replace mint and ubuntu or something else matching the old system. Remove each package with dpkg --remove or dpkg -P to remove configs also. You will possibly remove important packages. Maybe note them and reinstall them after you have removed all old packages. Since you have changed the sources list it should install the newer Debian versions. Stuff you should ensure are installed when you have reached the target Debian version (some of these lines are for MATE desktop): mate-desktop-environment (not only mate-desktop) mate-panel marco lightdm linux-image-(insert an appropriate-kernel version here) grub-pc (or grub-efi) init xorg xserver-xorg-core
dpkg - trying to overwrite '/usr/bin/something', which is also in package something-else
dpkg: error processing archive /var/cache/apt/archives/package.deb (--unpack): trying to overwrite '/usr/bin/something', which is also in package something-else dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) dpkg -i --force-overwrite /var/cache/apt/archives/package.deb
apt - E: Could not get lock /var/lib/dpkg/lock - even if there is no apt or dpkg process active
E: Could not get lock /var/lib/dpkg/lock - even if there is no apt or dpkg process active Solution: killall dpkg killall apt If it still refuses, remove the lock files: sudo rm /var/lib/apt/lists/lock sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/dpkg/lock
dpkg: error: parsing file '/var/lib/dpkg/updates/NNN' near line 0:
dpkg: error: parsing file '/var/lib/dpkg/updates/NNN' near line 0: newline in field name `#padding' Solution: rm /var/lib/dpkg/updates/NNN
dpkg: dependency problems prevent removal of X:
dpkg: dependency problems prevent removal of X: Y on X (>= n). dpkg: error processing package X (--purge): dependency problems - not removing Errors were encountered while processing: X Solution: Use dpkg --purge or -P to remove package and config, or only --remove to keep config: dpkg -P Y - which might cause another errors about dependencies on Y, down the rabbit hole you go dpkg -P X In case you cannot remove X because of Y, and Y because of X, then remove both at the same time: dpkg -P X Y Or force ignorance of the dependant packages, causing Y to be broken: dpkg -P --force-depends X
Black screen with underscore _ or black screen with cursor after boot
First of all, do not worry about this until you have reached the desired version of Debian. Things might both break and fix themselves during the process. But to the problem, something is wrong with the display manager (lightdm), the window manager (marco), the session manager (mate-session or something else. Most likely are the configuration outdated or you are missing some dependency. Relevant logs for Debian 13: /var/log/X.org.log /var/log/lightdm/lightdm.log /home/.xsession-errors The easiest method to get by this is to purge everything related to desktop environment INCLUDING configuration and then re-install the desktop environment. The important configurations to get rid of are /etc/X11/* and the login/etc/lightdm/*. The method to remove the whole desktop and the related programs varies between versions. But here are some - search on debian remove desktop environment and add to the list: apt purge libx11-6 libwayland-client0 x11-common libwayland-server0 x11* mate-* lightdm* marco* task-desktop task-german task-german-desktop hyphen-en-us libglu1-mesa libreoffice-* libu2f-udev mythes-en-us x11-apps x11-session-utils xinit xorg xserver-* desktop-base totem gedit gedit-common gir1.2-* gnome-* gstreamer* sound-icons speech-dispatcher totem-common xserver-* xfonts-* xwayland gir1.2* gnome-* vlc* Forget about deborphan - it was removed in Debian 13 and tasksel did not help me. Remove leftover configuration files - this should be much easier than this: dpkg --purge $(dpkg --get-selections | grep deinstall | cut -f1) Then re-install: apt install mate-desktop-environment lightdm xorg xinit
References
https://unix.stackexchange.com/questions/598344/debian-8-jessie-keyexpired-1587841717 https://askubuntu.com/questions/445487/what-debian-version-are-the-different-ubuntu-versions-based-on https://askubuntu.com/questions/176121/dpkg-error-trying-to-overwrite-file-which-is-also-in https://itsfoss.com/could-not-get-lock-error/ https://unix.stackexchange.com/questions/413942/how-to-handle-obsolete-packages-when-upgrading-distribution https://askubuntu.com/questions/213460/dpkg-error-parsing-file-var-lib-dpkg-updates-0045-near-line-0 https://www.reddit.com/r/debian/comments/6lnakq/what_are_the_essential_packages/ https://askubuntu.com/questions/104126/can-i-purge-configuration-files-after-ive-removed-the-package
This is a personal note. Last updated: 2025-11-17 17:47:13.



