Fix Ubuntu That Won't Boot or Has a Broken Desktop After an Update
Hold Shift or tap Esc at boot, choose Advanced options for Ubuntu and boot the previous kernel. If the desktop still does not start, press Ctrl+Alt+F3, log in and finish the interrupted update:
sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt update
sudo apt full-upgrade
sudo reboot
Identify your case
Different breakages need different fixes. Find yours, then follow the steps in order; most systems are fixed by step 3.
| What happens | Likely cause | Go to |
|---|---|---|
| Boot stops with a kernel panic or hangs before the logo | New kernel or initramfs broken | Steps 1 and 5 |
| Black screen or blinking cursor instead of the login screen | Graphics driver not built for the new kernel (often NVIDIA) | Step 1, then NVIDIA black screen fix |
| Update was interrupted (power loss, closed terminal) | Half-configured packages | Steps 2 and 3 |
| Login screen loops back after the password | Broken desktop packages, full disk, or a user config problem | Steps 3, 4 and 6 |
| Desktop loads but no top bar, no apps, or "Oh no! Something has gone wrong" | Missing desktop packages or broken GNOME extensions | Steps 4 and 6 |
grub rescue> prompt | Bootloader problem | GRUB rescue guide |
| "You are in emergency mode" | Filesystem or fstab error | Emergency mode fix |
| Boots, but takes minutes | A service waiting on timeout | Ubuntu slow boot |
Repair step by step
Step 1: Boot the previous kernel
Updates often bring a new kernel. If that kernel or a module built for it fails, the old kernel still works.
- Reboot. Hold Shift (BIOS) or tap Esc once (UEFI) right after the firmware logo to show GRUB.
- Choose Advanced options for Ubuntu.
- Pick the second-newest entry that does not say recovery mode.
If the system works on the old kernel, the update itself is fine and only the new kernel or a module for it is the problem. Check which kernel you are on and whether DKMS modules built for the new one:
uname -r
dpkg --list 'linux-image-*' | grep ^ii
dkms status
A DKMS entry showing added or built but not installed for the new kernel means the driver failed to build. Reinstalling the headers and rebuilding usually fixes it:
sudo apt install --reinstall linux-headers-generic
sudo dkms autoinstall -k <new-kernel-version>
Step 2: Get a working shell
If no kernel brings up a desktop, get a terminal one of these ways:
- Text console: press
Ctrl+Alt+F3(try F2 to F6) at the black screen or login screen and log in. - Recovery mode: in Advanced options choose an entry ending in (recovery mode). Select network first to enable networking and remount the disk read-write, then root for a root shell.
- Text-only boot: edit the entry with e and add
systemd.unit=multi-user.targetto thelinuxline (see kernel parameters).
The recovery menu's dpkg option runs the repair from Step 3 for you.
Step 3: Finish the interrupted update
Packages left half-installed are the most common reason Ubuntu breaks after an update.
sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt update
sudo apt full-upgrade
dpkg --configure -a runs the configuration scripts that never ran; --fix-broken fills in missing dependencies. Check for anything still not fully installed:
sudo dpkg --audit
dpkg -l | grep -vE '^(ii|rc)' | tail -n +6
Any line starting with iU, iF or iH is a package stuck mid-install. If dpkg itself reports a lock or an error, see dpkg was interrupted and dpkg returned an error code (1).
Check free space at the same time. A full root or /boot partition makes updates fail halfway:
df -h / /boot
sudo apt autoremove --purge
sudo apt clean
If / is at 100%, follow No space left on device before anything else.
Check the filesystem
If the update was interrupted by a power loss, the filesystem itself may have errors, which shows up as "Read-only file system" when apt tries to write. In recovery mode, the fsck entry checks all filesystems before they are mounted read-write. From a live USB you can run it by hand on the unmounted root partition:
lsblk -f
sudo fsck -f /dev/nvme0n1p2
Never run fsck on a mounted filesystem; it can cause the damage it is meant to fix. Use recovery mode's menu entry or a live USB.
Step 4: Reinstall the desktop
If the system boots to a login screen that loops, or to a desktop with missing parts, reinstall the desktop metapackage and the display manager. This does not touch your files:
sudo apt install --reinstall ubuntu-desktop gdm3 gnome-shell
sudo systemctl restart gdm3
On flavours, use their metapackage: kubuntu-desktop with sddm, xubuntu-desktop with lightdm. If ubuntu-desktop was removed by an earlier dependency conflict, apt reinstalls everything it pulls in. Check the display manager's log for the actual error:
journalctl -b -u gdm3 --no-pager | tail -40
journalctl -b -p err --no-pager | tail -40
Step 5: Find out what the update changed
APT logs every transaction. The last entries show exactly what was upgraded or removed:
less /var/log/apt/history.log
grep -A4 'Start-Date' /var/log/apt/history.log | tail -40
Look for Remove: lines with packages you did not mean to remove, which happens when a PPA conflicts with official packages. If one package update is to blame, downgrade it to the version from the log and hold it:
apt policy package-name
sudo apt install package-name=1.2.3-0ubuntu1
sudo apt-mark hold package-name
Remember to sudo apt-mark unhold package-name once a fixed version appears. Third-party PPAs are a frequent cause; sudo apt install ppa-purge then sudo ppa-purge ppa:owner/name reverts a PPA's packages to the official versions.
If a new kernel is the culprit and you want GRUB to stop booting it, remove only that kernel:
Check uname -r first and make sure at least one other working kernel stays installed. Removing the running or the only kernel leaves the system unbootable.
uname -r
sudo apt remove linux-image-<bad-version>-generic
To always see the GRUB menu while you test, set GRUB_TIMEOUT_STYLE=menu and GRUB_TIMEOUT=5 in /etc/default/grub, then run sudo update-grub.
Step 6: Rule out your user configuration
If a new test user can log in but your account cannot, the system is fine and something in your home directory breaks the session.
sudo adduser testuser
# log in as testuser from the login screen
Common causes for your own account:
- GNOME extensions incompatible with the updated GNOME Shell. Disable all of them from a text console:
gsettings set org.gnome.shell disable-user-extensions true(run as your user, inside the session, or remove extensions from~/.local/share/gnome-shell/extensions/). - Files owned by root in your home after running graphical apps with sudo:
find ~ -maxdepth 2 -user root, then fix ownership withsudo chown -R $USER:$USER ~/.config ~/.cache ~/.local. - Stale session cache: move
~/.cacheaside; it is regenerated on login.
Prevent the next breakage
- Run updates from a terminal with
sudo apt update && sudo apt full-upgradeinstead of closing the Software Updater halfway; the terminal shows errors as they happen. - Do not shut down while
unattended-upgradesis running. Check withsystemctl status unattended-upgradesor look forunattended-upgradeinps aux. - Keep
/bootand/below about 80% full and remove old kernels withsudo apt autoremove --purge. - Limit PPAs to the few you really need; they are the most common source of dependency conflicts on update.
Distro notes
- Ubuntu 26.04: uses Dracut instead of initramfs-tools. If a kernel boots to an initramfs shell, reinstalling the kernel package regenerates its image:
sudo apt install --reinstall linux-image-$(uname -r). GNOME 50 has no X11 session, so "use Xorg instead" workarounds from older guides do not apply. - Ubuntu 24.04: regenerate the initramfs with
sudo update-initramfs -u -k all. The X11 session is still available on the login screen's gear icon if Wayland fails. - Snap apps broken by a refresh can be rolled back individually:
sudo snap revert firefox. - Linux Mint: the same apt steps apply. Update Manager → View → Linux kernels lets you remove or reinstall kernels, and Timeshift is set up at first boot.
- After a release upgrade (for example 24.04 to 26.04) rather than a normal update, also check the Ubuntu upgrade guide for disabled third-party sources.
Last resort: roll back or reinstall
- Timeshift or another snapshot: if you have a snapshot from before the update, restore it from the running system with
sudo timeshift --listandsudo timeshift --restore, or boot a live USB, install Timeshift there and restore. Setting this up before the next update is covered in Timeshift snapshots. - Back up first: from a live USB, copy your home directory to an external disk before trying anything drastic. The rsync backup script does this safely.
- Reinstall keeping /home: if
/homeis a separate partition, the installer's manual partitioning lets you reuse it without formatting. Otherwise reinstall and restore your backup.
More Ubuntu-specific problems are collected in Ubuntu troubleshooting.
Frequently asked questions
How do I boot an older kernel in Ubuntu?
Show the GRUB menu by holding Shift (BIOS) or tapping Esc (UEFI) during boot, choose Advanced options for Ubuntu, and pick the previous kernel version. Ubuntu keeps at least one older kernel installed for this reason.
Will reinstalling ubuntu-desktop delete my files?
No. sudo apt install --reinstall ubuntu-desktop reinstalls system packages only. Your home directory and settings are not touched.
What does recovery mode do in Ubuntu?
It boots a minimal system without the graphical desktop and offers a menu: repair broken packages (dpkg), check filesystems (fsck), enable networking and open a root shell. It is the safest place to finish an interrupted update.
Can I undo an Ubuntu update?
Not with a single apt command. You can boot the previous kernel, downgrade a specific package with apt install package=version, or restore a Timeshift snapshot taken before the update, which rolls back the whole system.
Spotted a mistake or a command that no longer works? Send a correction — pages are re-checked when reports come in.