0

I have recently seen on my 16.04 when running apt upgrade that some packages have been kept back. I went to investigate and found the answer here. It basically says that you are supposed to install the packages individually instead of running apt dist-upgrade. So that's what I did the only two packages I called apt install for were: libgl1-mesa-dev libgl1-mesa-devlibgl1-mesa-dev

The rest came along as dependencies.

But as the title says the machine ended up in emergency mode. Therefore the installation was probably a bad idea anyway. To oppose the problem I started the system in rescue mode (not to be confused withe emergency mode) from GRUB and ran dpkg to fix broken/missing packages. The Interesting thing is the system will boot normally right after that. When I boot it again, it will end up in emergency mode. To get a normal GUI I have to run dpkg every time I boot it and it will work even though, dpkg doesn't do anything.

My questions are:

What are kept back packages? Why are you not supposed to install them? And how to deal with it if you have...

What ACTUALLY causes the ubuntu to go into emergency mode? Since it works fine, if I go through my special boot process.

1 Answers1

1

Whoah, nice barrage of questions.

  1. What are kept back packages?
  2. Why are you not supposed to install them?
  3. And how to deal with it if you have...
  4. What ACTUALLY causes Ubuntu to go into emergency mode?
  5. Why (paraphrase mine) it works fine, if I go through my special boot process?

You may want to split this question into two (theory part kept-back packages and how to get out of your situation), honestly. For now I'm going on a limb here for there's a lot that I don't know about your situation. My answer is to give you something so you can do the split and ask better (fuller?) questions, or at least link you where your solutions might be.

Kept-back packages, questions 1-3

https://askubuntu.com/a/945816/72260 should help with what are kept back packages and what to do with them. Summarizing, there are couple possible reasons, including broken dependencies, pinned packages, packages "on hold" and packages which - upon install - would introduce dependencies inconsistencies. You can deal with them in various ways, from purging through installing by other tool or by hand (like you did it seems) to waiting till package maintainers fix their deps themselves.

So, yes, sometimes you're not supposed to install them. I'm unfortunately not that knowledgeable to tell you a golden recipe for which case is which. :(

Emergency mode, question 4

If we're talking about emergency mode like on a screenshot here, then there are couple of known reasons. Usually running the journalctl should give you an inkling about your case. From what you wrote it seems likely that you have dependencies mixed up. One of solutions that may work is to reinstall these packages that had problems (and their dependencies).

Without more details I don't know what could cause your system to go into emergency mode or why dpkg helps, but only for one boot.