I survived a disastrous upgrade from Ubuntu 20.04 to 22.04

Last time I upgraded Ubuntu from 18.04 to 20.04, I almost swore I will never upgrade again. I encountered a kernel issue which prevented the pc from booting up. The situation was so stressful that I did not take any note or screenshots of the error messages, but I recall vaguely that the issue was related to “too many” versions of the Linux kernel being present at the same time. I solved it by booting under recovery mode, and typing some random commands I found on StackExchange which removed the old kernel version. The relief I felt when seeing the Ubuntu splash again was huge. I learned the hard lesson to never start an upgrade without doing proper backup. Lately, I got tempted to upgrade to new LTS Ubuntu version, after resisting for too long to the Software Updater pop up window.

ubuntu upgrade banner

After doing a backup, I said to myself that nothing can go wrong. Nevertheless, the price to pay If the upgrade would not succeed was high because I would need to spend time reinstalling things and configuring all the tools, and put all my workflow on hold for a day or so. I finally gathered enough courage to click on the upgrade button. After the lengthy process has finished, the moment of truth came: rebooting. Unfortunately, the upgrade went wrong again and the screen was showing a black screen with a stacktrace. The message was mentionning something about a kernel crash or panic. What happened?

Kernel issue again:

The message I was seeing on start up looks like the following (it’s not the one I got myself as I did not take any picture at the time of the incident, but it’s very similar):

kernel-panic

After looking up the message, I found out that I was not the only person who encountered this issue. Because I was in a “nothing to lose” situation, I decided to give the below commands a shot even if I had no idea what they actually do (the stack exchange thread can be found here). Those commands were proposed in several other write-ups, like this Geeks Warrior blog post, which was a good indicator that it might eventually be the right fix.

sudo mount /dev/sda2 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
update-initramfs -u -k 5.15.0.78-generic
update-grub

To be able to execute those commands, I had to first go through the grub advanced options menu by pushing several times the escape button when the first splash screen appears after a boot up.

grub-advanced-options

As you can see, the menu allows booting Ubuntu with old kernel versions (in normal and recovery mode). Almost all the versions failed to boot up under both normal mode and recovery mode showing the same kernel crash error mentionned above. I was lucky to have only one of them boot under recovery mode.

recovery-mode

After choosing the “drop to shell prompt”, I was able to execute the commands above. I rebooted the computer and crossed the fingers again. I was relieved to see the crash message disapear and the Ubuntu splash screen appear again. To my surprise, nothing happened after the splash screen. I was seeing a black screen with a sort of cursor on the top left of the screen (like a full screen terminal but without any prompt). What on earth was going on again ?

Packages got broken:

It felt like it was going to be a bit more complicated to find a solution this time because there was no clear message, so I had no clue what to look up. I started thinking that there are chances that the computer may not be able to recover from this upgrade. After googling “ubunu black screen terminal after login”, I saw that there was a sort of consensus (like this blog post here and this StackExchange thread here) that this issue might be caused by a broken ubuntu-desktop package. I tried rebooting under recovery mode once again and attempted to run apt update && apt install ubuntu-desktop which failed with a long list of errors:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
[1mdpkg:[0m dependency problems prevent configuration of libpango-1.0-0:amd64:
 libpango-1.0-0:amd64 depends on fontconfig (>= 2.13.0); however:
  Package fontconfig is not configured yet.

[1mdpkg:[0m error processing package libpango-1.0-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5gui5:amd64:
 libqt5gui5:amd64 depends on fontconfig; however:
  Package fontconfig is not configured yet.

[1mdpkg:[0m error processing package libqt5gui5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of pango1.0-tools:
 pango1.0-tools depends on libpango-1.0-0 (= 1.50.6+ds-2ubuntu1); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package pango1.0-tools (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5quickcontrols2-5:amd64:
 libqt5quickcontrols2-5:amd64 depends on libqt5gui5 (>= 5.15.3+dfsg~) | libqt5gui5-gles (>= 5.15.3+dfsg~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5quickcontrols2-5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5svg5:amd64:
 libqt5svg5:amd64 depends on libqt5gui5 (>= 5.15.3+dfsg~) | libqt5gui5-gles (>= 5.15.3+dfsg~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5svg5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5purpose5:amd64:
 libkf5purpose5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libkf5purpose5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of qml-module-qtquick-window2:amd64:
 qml-module-qtquick-window2:amd64 depends on libqt5gui5 (>= 5.2.0) | libqt5gui5-gles (>= 5.2.0); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package qml-module-qtquick-window2:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of kded5:
 kded5 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package kded5 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5widgets5:amd64:
 libqt5widgets5:amd64 depends on libqt5gui5 (>= 5.15.1) | libqt5gui5-gles (>= 5.15.1); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5widgets5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libnux-4.0-0:
 libnux-4.0-0 depends on libpango-1.0-0 (>= 1.20.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libnux-4.0-0 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of qml-module-org-kde-people:amd64:
 qml-module-org-kde-people:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 qml-module-org-kde-people:amd64 depends on libqt5widgets5 (>= 5.15.2~); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package qml-module-org-kde-people:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqmobipocket2:amd64:
 libqmobipocket2:amd64 depends on libqt5gui5 (>= 5.4.0~) | libqt5gui5-gles (>= 5.4.0~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqmobipocket2:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5webkit5:amd64:
 libqt5webkit5:amd64 depends on libqt5gui5 (>= 5.14.1) | libqt5gui5-gles (>= 5.14.1); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libqt5webkit5:amd64 depends on libqt5widgets5 (>= 5.4.0); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libqt5webkit5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of unity-control-center:
 unity-control-center depends on libpango-1.0-0 (>= 1.18.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package unity-control-center (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5xmlgui5:amd64:
 libkf5xmlgui5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libkf5xmlgui5:amd64 depends on libqt5widgets5 (>= 5.15.2~); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libkf5xmlgui5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libadwaita-1-0:amd64:
 libadwaita-1-0:amd64 depends on libpango-1.0-0 (>= 1.14.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libadwaita-1-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libvte-2.91-0:amd64:
 libvte-2.91-0:amd64 depends on libpango-1.0-0 (>= 1.44.3); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libvte-2.91-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libayatana-ido3-0.4-0:amd64:
 libayatana-ido3-0.4-0:amd64 depends on libpango-1.0-0 (>= 1.20.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libayatana-ido3-0.4-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5textwidgets5:amd64:
 libkf5textwidgets5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libkf5textwidgets5:amd64 depends on libqt5widgets5 (>= 5.15.2~); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libkf5textwidgets5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of zenity:
 zenity depends on libpango-1.0-0 (>= 1.14.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package zenity (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libcogl-pango20:amd64:
 libcogl-pango20:amd64 depends on libpango-1.0-0 (>= 1.28.3-5); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libcogl-pango20:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of qt5-gtk-platformtheme:amd64:
 qt5-gtk-platformtheme:amd64 depends on libpango-1.0-0 (>= 1.14.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.
 qt5-gtk-platformtheme:amd64 depends on libqt5gui5 (>= 5.14.1) | libqt5gui5-gles (>= 5.14.1); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package qt5-gtk-platformtheme:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of qml-module-qtquick-layouts:amd64:
 qml-module-qtquick-layouts:amd64 depends on libqt5gui5 (>= 5.5.0) | libqt5gui5-gles (>= 5.5.0); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package qml-module-qtquick-layouts:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libwxgtk3.0-gtk3-0v5:amd64:
 libwxgtk3.0-gtk3-0v5:amd64 depends on libpango-1.0-0 (>= 1.14.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libwxgtk3.0-gtk3-0v5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5iconthemes-bin:
 libkf5iconthemes-bin depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libkf5iconthemes-bin (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5waylandclient5:amd64:
 libqt5waylandclient5:amd64 depends on libqt5gui5 (>= 5.15.3+dfsg~) | libqt5gui5-gles (>= 5.15.3+dfsg~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5waylandclient5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5multimedia5:amd64:
 libqt5multimedia5:amd64 depends on libqt5gui5 (>= 5.15.3+dfsg~) | libqt5gui5-gles (>= 5.15.3+dfsg~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5multimedia5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libgtksourceview-3.0-1:amd64:
 libgtksourceview-3.0-1:amd64 depends on libpango-1.0-0 (>= 1.18.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libgtksourceview-3.0-1:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5quickwidgets5:amd64:
 libqt5quickwidgets5:amd64 depends on libqt5gui5 (>= 5.10.0) | libqt5gui5-gles (>= 5.10.0); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libqt5quickwidgets5:amd64 depends on libqt5widgets5 (>= 5.14.1); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libqt5quickwidgets5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5waylandcompositor5:amd64:
 libqt5waylandcompositor5:amd64 depends on libqt5gui5 (>= 5.15.3+dfsg~) | libqt5gui5-gles (>= 5.15.3+dfsg~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5waylandcompositor5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of librsvg2-2:amd64:
 librsvg2-2:amd64 depends on libpango-1.0-0 (>= 1.45.5); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package librsvg2-2:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5printsupport5:amd64:
 libqt5printsupport5:amd64 depends on libqt5gui5 (>= 5.14.1) | libqt5gui5-gles (>= 5.14.1); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libqt5printsupport5:amd64 depends on libqt5widgets5 (>= 5.7.0); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libqt5printsupport5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of gnome-power-manager:
 gnome-power-manager depends on libpango-1.0-0 (>= 1.18.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package gnome-power-manager (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5kirigami2-5:
 libkf5kirigami2-5 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libkf5kirigami2-5 depends on libqt5quickcontrols2-5 (>= 5.15.2~); however:
  Package libqt5quickcontrols2-5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libkf5kirigami2-5 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libido3-0.1-0:amd64:
 libido3-0.1-0:amd64 depends on libpango-1.0-0 (>= 1.20.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libido3-0.1-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5configgui5:amd64:
 libkf5configgui5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libkf5configgui5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of aisleriot:
 aisleriot depends on librsvg2-2 (>= 2.32.0); however:
  Package librsvg2-2:amd64 is not configured yet.

[1mdpkg:[0m error processing package aisleriot (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5declarative5:amd64:
 libkf5declarative5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libkf5declarative5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libgail-3-0:amd64:
 libgail-3-0:amd64 depends on libpango-1.0-0 (>= 1.44.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libgail-3-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5kiofilewidgets5:amd64:
 libkf5kiofilewidgets5:amd64 depends on libkf5configgui5 (>= 5.92.0~); however:
  Package libkf5configgui5:amd64 is not configured yet.
 libkf5kiofilewidgets5:amd64 depends on libkf5xmlgui5 (>= 5.92.0~); however:
  Package libkf5xmlgui5:amd64 is not configured yet.
 libkf5kiofilewidgets5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libkf5kiofilewidgets5:amd64 depends on libqt5widgets5 (>= 5.15.2~); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libkf5kiofilewidgets5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5globalaccel5:amd64:
 libkf5globalaccel5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libkf5globalaccel5:amd64 depends on libqt5widgets5 (>= 5.15.2~); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libkf5globalaccel5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of gir1.2-pango-1.0:amd64:
 gir1.2-pango-1.0:amd64 depends on libpango-1.0-0 (= 1.50.6+ds-2ubuntu1); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package gir1.2-pango-1.0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5quickaddons5:amd64:
 libkf5quickaddons5:amd64 depends on libkf5configgui5 (>= 5.92.0~); however:
  Package libkf5configgui5:amd64 is not configured yet.
 libkf5quickaddons5:amd64 depends on libkf5declarative5 (>= 5.12.0); however:
  Package libkf5declarative5:amd64 is not configured yet.
 libkf5quickaddons5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libkf5quickaddons5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libgtksourceview-4-0:amd64:
 libgtksourceview-4-0:amd64 depends on libpango-1.0-0 (>= 1.18.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libgtksourceview-4-0:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libkf5kiogui5:amd64:
 libkf5kiogui5:amd64 depends on libqt5gui5 (>= 5.15.2~) | libqt5gui5-gles (>= 5.15.2~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libkf5kiogui5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libgnomekbd8:amd64:
 libgnomekbd8:amd64 depends on libpango-1.0-0 (>= 1.18.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package libgnomekbd8:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of transmission-gtk:
 transmission-gtk depends on libpango-1.0-0 (>= 1.14.0); however:
  Package libpango-1.0-0:amd64 is not configured yet.

[1mdpkg:[0m error processing package transmission-gtk (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of obs-plugins:
 obs-plugins depends on libqt5gui5 (>= 5.2.0~alpha1) | libqt5gui5-gles (>= 5.2.0~alpha1); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 obs-plugins depends on libqt5widgets5 (>= 5.14.1); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package obs-plugins (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libokular5core9:
 libokular5core9 depends on libkf5configgui5 (>= 5.68.0~); however:
  Package libkf5configgui5:amd64 is not configured yet.
 libokular5core9 depends on libqt5gui5 (>= 5.13.0~) | libqt5gui5-gles (>= 5.13.0~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.
 libokular5core9 depends on libqt5printsupport5 (>= 5.13.0~); however:
  Package libqt5printsupport5:amd64 is not configured yet.
 libokular5core9 depends on libqt5svg5 (>= 5.13.0~); however:
  Package libqt5svg5:amd64 is not configured yet.
 libokular5core9 depends on libqt5widgets5 (>= 5.13.0~); however:
  Package libqt5widgets5:amd64 is not configured yet.

[1mdpkg:[0m error processing package libokular5core9 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libqt5webengine5:amd64:
 libqt5webengine5:amd64 depends on libqt5gui5 (>= 5.15.3+dfsg~) | libqt5gui5-gles (>= 5.15.3+dfsg~); however:
  Package libqt5gui5:amd64 is not configured yet.
  Package libqt5gui5-gles:amd64 is not installed.

[1mdpkg:[0m error processing package libqt5webengine5:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m too many errors, stopping
Errors were encountered while processing:
 libpango-1.0-0:amd64
 libqt5gui5:amd64
 pango1.0-tools
 libqt5quickcontrols2-5:amd64
 libqt5svg5:amd64
 libkf5purpose5:amd64
 qml-module-qtquick-window2:amd64
 kded5
 libqt5widgets5:amd64
 libnux-4.0-0
 qml-module-org-kde-people:amd64
 libqmobipocket2:amd64
 libqt5webkit5:amd64
 unity-control-center
 libkf5xmlgui5:amd64
 libadwaita-1-0:amd64
 libvte-2.91-0:amd64
 libayatana-ido3-0.4-0:amd64
 libkf5textwidgets5:amd64
 zenity
 libcogl-pango20:amd64
 qt5-gtk-platformtheme:amd64
 qml-module-qtquick-layouts:amd64
 libwxgtk3.0-gtk3-0v5:amd64
 libkf5iconthemes-bin
 libqt5waylandclient5:amd64
 libqt5multimedia5:amd64
 libgtksourceview-3.0-1:amd64
 libqt5quickwidgets5:amd64
 libqt5waylandcompositor5:amd64
 librsvg2-2:amd64
 libqt5printsupport5:amd64
 gnome-power-manager
 libkf5kirigami2-5
 libido3-0.1-0:amd64
 libkf5configgui5:amd64
 aisleriot
 libkf5declarative5:amd64
 libgail-3-0:amd64
 libkf5kiofilewidgets5:amd64
 libkf5globalaccel5:amd64
 gir1.2-pango-1.0:amd64
 libkf5quickaddons5:amd64
 libgtksourceview-4-0:amd64
 libkf5kiogui5:amd64
 libgnomekbd8:amd64
 transmission-gtk
 obs-plugins
 libokular5core9
 libqt5webengine5:amd64
Processing was halted because there were too many errors.

 

Trying to make sens out of the long list of errors, I found out that all of the “is not installed” errors are related to the libqt5gui5-gles:amd64 package (the real name is without the :amd64 suffix). I decided to install it manually and I got an interesting message: error while loading shared libraries: libpng12.so.0. It seemed like libpng12, which is the old version of libpng, was missing, so the only thing left to do was to install it and this should presumably allow libqt5gui5-gles to install and unblock all the broken packages mess. However, things are not always easy as they seem. libpng12 was removed from the Ubuntu 22.04 (As a side note, libpng12 is still available in Fedora 38, which is the latest Fedora version as of the time this post is written) package repositories and therefore it cannot be installed intuitively using apt. After doing some research (this is the article that pointed me towards the right direction), I found out that it’s still possible to install libpng12 on Ubuntu 22 by grabing the .deb file manually (the link to download the deb can be found here) and installing it using dpkg:

 wget https://launchpad.net/~ubuntu-security/+archive/ubuntu/ppa/+build/15108504/+files/libpng12-dev_1.2.54-1ubuntu1.1_amd64.deb
 dkpg -i libpng12-dev_1.2.54-1ubuntu1.1_amd64.deb

After installing libpng12, I was able to install libqt5gui5-gles successfully, but apt update && apt install ubuntu-desktop was still failing with a different list of errors now:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
update-alternatives: error: /var/lib/dpkg/alternatives/mpi corrupt: slave link same as main link /usr/bin/mpicc
[1mdpkg:[0m error processing package openmpi-bin (--configure):
 installed openmpi-bin package post-installation script subprocess returned error exit status 2
[1mdpkg:[0m dependency problems prevent configuration of mpi-default-bin:
 mpi-default-bin depends on openmpi-bin; however:
  Package openmpi-bin is not configured yet.

[1mdpkg:[0m error processing package mpi-default-bin (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libcoarrays-openmpi-dev:amd64:
 libcoarrays-openmpi-dev:amd64 depends on openmpi-bin; however:
  Package openmpi-bin is not configured yet.

[1mdpkg:[0m error processing package libcoarrays-openmpi-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libopenmpi-dev:amd64:
 libopenmpi-dev:amd64 depends on openmpi-bin (>= 3.0.0-1); however:
  Package openmpi-bin is not configured yet.

[1mdpkg:[0m error processing package libopenmpi-dev:amd64 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libboost-mpi-python1.74.0:
 libboost-mpi-python1.74.0 depends on mpi-default-bin; however:
  Package mpi-default-bin is not configured yet.

[1mdpkg:[0m error processing package libboost-mpi-python1.74.0 (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libboost-mpi-python1.74-dev:
 libboost-mpi-python1.74-dev depends on libboost-mpi-python1.74.0 (= 1.74.0-14ubuntu3); however:
  Package libboost-mpi-python1.74.0 is not configured yet.

[1mdpkg:[0m error processing package libboost-mpi-python1.74-dev (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libboost-mpi-python-dev:
 libboost-mpi-python-dev depends on libboost-mpi-python1.74-dev; however:
  Package libboost-mpi-python1.74-dev is not configured yet.

[1mdpkg:[0m error processing package libboost-mpi-python-dev (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libboost-all-dev:
 libboost-all-dev depends on libboost-mpi-python-dev; however:
  Package libboost-mpi-python-dev is not configured yet.

[1mdpkg:[0m error processing package libboost-all-dev (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of mpi-default-dev:
 mpi-default-dev depends on libopenmpi-dev; however:
  Package libopenmpi-dev:amd64 is not configured yet.

[1mdpkg:[0m error processing package mpi-default-dev (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libboost-mpi1.74-dev:
 libboost-mpi1.74-dev depends on mpi-default-dev; however:
  Package mpi-default-dev is not configured yet.

[1mdpkg:[0m error processing package libboost-mpi1.74-dev (--configure):
 dependency problems - leaving unconfigured
[1mdpkg:[0m dependency problems prevent configuration of libboost-mpi-dev:
 libboost-mpi-dev depends on libboost-mpi1.74-dev; however:
  Package libboost-mpi1.74-dev is not configured yet.

[1mdpkg:[0m error processing package libboost-mpi-dev (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 openmpi-bin
 mpi-default-bin
 libcoarrays-openmpi-dev:amd64
 libopenmpi-dev:amd64
 libboost-mpi-python1.74.0
 libboost-mpi-python1.74-dev
 libboost-mpi-python-dev
 libboost-all-dev
 mpi-default-dev
 libboost-mpi1.74-dev
 libboost-mpi-dev

Once again, I had no idea what those errors mean, but with the help of this StackOverflow thread, I was able solve it by executing the following commands:

rm -f /etc/alternatives/mpi* /var/lib/dpkg/alternatives/mpi*
apt install openmpi-bin

Finally, apt update && apt install ubuntu-desktop finished successfully. I rebooted the computer and against all the odds, it showed the usual Ubuntu login. What a relief 😅

This was the second failed upgrade in a row. It realy got me thinking about the reliability of the whole Ubuntu upgrade process. It’s fascinating to see that a simple image library package with a size of 180KB made a whole OS go down. I am wondering if this would have happened with other mainstream Linux distros like Fedora (If anyone experienced such incidents when upgrading Fedora, I’d appreciate if you can share your story through a comment below ), which I am really willing to give a try.

This near miss taught me also to be better prepared and expect the worse when going through Linux (Ubuntu at least) upgrades. For example, I am currently working on an Ansible playbook that installs and configures all the tools and packages that I need in one shot. This would make the recovery from a failure less time and effort consuming.