I accidently added Debian PPA to my sources.list, and upgraded, and now have a broken Ubuntu 16.04 desktop. Debian is launched when I login via grub.

I looked at my sources.list entry and everything has xenial sources except

deb http://deb.debian.org/debian buster main contrib non-free.

My other usual entries are of the the form deb archive.ubuntu.com/ubuntu xenial main.

How do I purge the Debian packages and recover Ubuntu desktop?

I tried sudo ppa-purge -s http://deb.debian.org/debian debian/buster, but it says no package list for PPA: debian PPA.

  • 1
    The debian repo isn't added as a PPA which is why you can't use ppa-purge. You should be able to just remove it from sources.list or comment it out. – Nmath Oct 11 '20 at 20:31
  • I have Debian packages installed, and apt-get update also retrieves from Debian. I assume this means it's added? – Sridhar Thiagarajan Oct 11 '20 at 20:32
  • You can see what sources are added by looking at the line(s) in /etc/apt/sources.list. The one you quoted in your question at debian.org for buster is a Debian repository. Ubuntu gets packages upstream from Debian, but Ubuntu does not use Debian repositories this way... unless you tell it to, but that can result in a broken system as you've experienced. – Nmath Oct 11 '20 at 21:18
  • Yep, the problem I have is that it was added, and used in an upgrade. I now woild like to use the purge command to downgrade/remove those packages to the ubuntu default, and I understand ppa-purge could help with that? – Sridhar Thiagarajan Oct 11 '20 at 21:23
  • 1
    Personally I'd assess the damage, and likely use it as an opportunity to re-install (& thus upgrade) your system (ubuntu-support-status will provide some clues!). Ubuntu 16.04 LTS is on it's last months of support, so you'll need to upgrade soon anyway, and default package tools are designed to detect & upgrade to the latest package, so restoring to prior packages is a lot more manual (unless you resort to your backups). – guiverc Oct 11 '20 at 21:29

To get rid of the Debian repositories from your system, you can remove them from /etc/apt/sources.list.

  • First, back up your current sources.list, just in case you make a mistake or things don't go as planned:

    sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
  • Open the file for editing:

    sudo nano /etc/apt/sources.list
  • Delete the lines corresponding to Debian sources. (lines that have http://deb.debian.org/debian buster)

    (You could also disable individual lines by commenting them out with a # at the beginning of the line.)

  • Save changes CTRL+O and Exit CTRL+X

  • Run sudo apt clean to clear apt's cache, then sudo apt update to update the list of available software.

  • I would still need to roll back all the debian software? How would that work? I would have to still do a purge I suppose? – Sridhar Thiagarajan Oct 11 '20 at 21:35
  • Not via ppa-purge. If you are aware of specific packages that you believe may be in conflict, you can purge the package in apt with sudo apt purge packagename but keep in mind that both purge and remove will also remove dependencies for that package. Case-dependent this might not be worth the risk – Nmath Oct 11 '20 at 21:38
  • is not possible to do this via ppa-purge by selecting the debian buster source? – Sridhar Thiagarajan Oct 11 '20 at 21:41
  • No. Debian is not a PPA. launchpad.net/ubuntu/+ppas – Nmath Oct 11 '20 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.