Botched upgrade--dpkg hangs on 'Started Braille Device Support'
Screwed up an upgrade from 14.10->15.04->15.10 badly. I've been messing around in recovery mode and am confidentish that I managed to get all the broken packages/dependencies removed and reinstalled, but now I'm running into this queer issue. Aptitude won't run, it says I need to do stuff with dpkg. dpkg will do stuff, but always gets hung up on
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
Error getting authority: Error initializing authority: Could not connect: No such file or directory (g-io-error-quark, 1)
[ OK ] Started Braille Device Support.
This Braille hang has been plaguing me for a while, but I've finally reached an impasse. The first part, with the errors, seems to be an obscure error relating to screwed up hard drives, and after some log digging, it seems as though it may me pointing to the Windows partition on this HD, which is fine. That seems like a dead end, and I can't find anything else on it online.
I'd really like to not have to backup, reformat, and reinstall. Does anybody have a lead?
Solution 1:
I just got into a similar situation with a botched upgrade and subsequent messing around in recovery mode, where a certain subset of packages (namely apport) were hanging on dpkg --configure -a
with that same Started Braille Device Support.
message. The hack that got me through this was:
- If you're currently staring at a hung
apt-get
command, press Ctrl+C to stop. If that doesn't work (as it did for me), press Ctrl+Z, then runkill -9 %1
a couple times to kill it off for good. Then runrm /var/lib/dpkg/lock
, since you murdered the process that usually does that. - Run
screen
(in order to get more than one prompt). - Press Ctrl+A and then c to open a different prompt.
- Run
dpkg --configure -a
and wait for the process to hang. - Press Ctrl+A and then a to switch back to the other prompt.
- Run
killall systemctl
- Press Ctrl+A and then a to switch back to the
dpkg --configure -a
command. - Note that the last package should have finished configuring, and
dpkg
has moved on to the next package and hung in the same fashion, or completed. - If
dpkg
is hanging again, goto step 5. - Once
dpkg --configure -a
is finally done, proceed mucking around in recovery mode, possibly runningapt-get upgrade
until the system seems in a rebootable state.
As for why this worked (for me at least), my debug process was as follows:
-
apt-get upgrade
was hanging. Run the Ctrl+Z andkill -9 %1
thing above to get back to the prompt. - Run
dpkg --configure -a
, and observe it hangs with the sameStarted Braille Device Support.
message asapt-get upgrade
. However, Ctrl+C works this time to return to prompt. - Search around for "ubuntu started braille device support". Find out from this debian accessibility page that it has to do with
brltty
. - Run
apt-get remove brltty
, maybe it'll make the problem go away. - Rerun
dpkg --configure -a
and notice that it still hangs, but this time, there's no message aboutStarted Braille Device Support
. OK. - Run
strace dpkg --configure -a
, and observe that the process is stuck on await4(...)
call to a subprocess. - A couple strace lines upwards, note that the process writes the file
/var/lib/dpkg/info/apport.postinst
(or something similar, IIRC). -
less
the above file, and see it's attempting to restart a boot service. Posit that since we're in recovery mode and the init system hasn't run to completion, that's going to be awkward. - Run
pstree
, and see thatdpkg --reconfigure -a
did indeed fork to abash
thing, which then forks toperl
, and finallysystemctl
, which does restart boot services, and may be confused. - Note that the
postinst
script doesn't haveset -e
in it, so maybe we can kill the hung command inside of it, so the shell script finishes anddpkg
moves on. - Open another screen prompt, run
killall systemctl
, switch back, and see thatdpkg
did indeed move on. Great. It's stuck in the same place again though, on a different package. - Run
killall systemctl
again untildpkg
exits. - Run
apt-get dist-upgrade
again, see that it says everything is up to date. - Cross my fingers, and reboot.
Miraculously, the system recovered, and so far has no issues.
So, it's not a complete reduction (why does systemctl hang in recovery mode?), nor is it likely generally applicable, but this hack and the process to discover it may help somebody who arrives at this page through a web search like I did.
Solution 2:
An improvement to the previous answers when you cannot use the command `screen':
dpkg --configure -a & (sleep 2m; killall systemctl)
Change the sleep time to a minimum time interval after which you are quite certain that dpkg gets stuck. (In my case I, in fact, used 10s). Worked for me!
Solution 3:
I encountered this issue when I tried upgrading 15.10 to 16.04 and I fixed using below steps.
Boot in command line by pressing E when highlight the first entry to edit it.
Cursor to the end of the
linux
line. Removequiet splash vt.handoff=7
and addsingle
.Press Ctrl+X to boot.
Run
screen
(in order to get more than one prompt).Press Ctrl+A and then C to open a different prompt.
Run
dpkg --configure -a
and wait to finish.Reboot