Fixing Broken Updates
Your update went sideways. Take a breath — this is one of the most common Linux hiccups, and it's almost always fixable.
Don't panic
A broken update can look scary. Maybe your terminal spat out a wall of red text, or maybe your system won't even boot. Either way, this is not the end of the world. Linux gives you all the tools you need to recover, and people fix this kind of thing every single day.
Read through the section that matches your situation, follow the steps, and you'll be back up and running.
Common symptoms
- You can't install or update anything — every attempt throws errors
- Error messages during an update — the update started but didn't finish cleanly
- Your system won't boot after an update — you see a black screen, a blinking cursor, or get dropped into a recovery prompt
Find the section below that matches your distro and error message.
APT problems (Ubuntu, Linux Mint, Debian)
APT is the package manager used on Ubuntu, Linux Mint, Debian, Pop!_OS, and many others. Here are the errors you'll run into most often.
"Could not get lock /var/lib/dpkg/lock"
What it means: Another program is already running an update. Only one thing can install or update packages at a time. This is totally normal.
What to do:
- Wait. If you recently opened your software updater or another terminal is running
apt, just let it finish. This is the most common cause. - Check if something is actually running:
If it shows a process, that's your update — let it finish.sudo lsof /var/lib/dpkg/lock-frontend - If you're sure nothing is running (for example, your computer crashed during an update), you can remove the lock:
Only do this if you're certain no update is in progress. Removing the lock while something is running can break things.sudo rm /var/lib/dpkg/lock-frontend sudo rm /var/lib/dpkg/lock sudo dpkg --configure -a
"Unmet dependencies"
What it means: Some packages need other packages to work, and something got tangled up. Maybe an install was interrupted, or you mixed package sources.
What to do:
sudo apt --fix-broken install
This tells APT to figure out what's missing and install it. It works the vast majority of the time. After it finishes, try your update again:
sudo apt update && sudo apt upgrade
"Hash sum mismatch"
What it means: A file downloaded during the update got corrupted. This can happen if your internet hiccupped, or if a mirror (the server your distro downloads from) is temporarily out of sync.
What to do: Clear the downloaded files and try again:
sudo apt clean
sudo apt update
If it keeps happening, you might be hitting a bad mirror. You can switch to a different one in your Software Sources settings (usually found in your system settings or by searching "Software & Updates").
"dpkg was interrupted"
What it means: A previous install or update was cut short (maybe the power went out, or you closed the terminal mid-update). The package system is stuck halfway through setting something up.
What to do:
sudo dpkg --configure -a
This tells dpkg to finish configuring any packages that were left in limbo. Once it's done, follow up with:
sudo apt --fix-broken install
sudo apt update && sudo apt upgrade
Held packages
What it means: Some packages have been "held back" — the system is intentionally skipping them during updates. You'll see a message like The following packages have been kept back.
This usually happens because upgrading those packages would require installing new packages or removing existing ones, and APT is being cautious about it.
What to do:
- Most of the time, it's fine to leave them. They'll sort themselves out in a future update.
- If you want to force the upgrade:
This lets APT install new dependencies and remove old ones as needed.sudo apt full-upgrade - To see exactly which packages are held:
If you intentionally held a package and want to release it:apt-mark showholdsudo apt-mark unhold package-name
DNF problems (Fedora)
DNF is Fedora's package manager. It's generally good at resolving problems on its own, but here's what to do when it can't.
Package conflicts
What it means: Two packages are fighting over the same file, or different versions are clashing. This sometimes happens after adding third-party repos.
What to do:
sudo dnf distro-sync
This synchronizes all your packages to the versions your repos say you should have. It's like telling DNF: "Just make everything match what it's supposed to be."
Broken dependencies
What it means: A package needs something that can't be installed, or installing it would break something else.
What to do:
sudo dnf --best --allowerasing update
Here's what those flags mean:
--besttells DNF to aim for the newest versions and show you a clear error if it can't--allowerasinglets DNF remove conflicting packages if that's the only way forward
Read the output before pressing Y. DNF will show you exactly what it plans to remove. Make sure nothing important is on that list.
pacman problems (Arch Linux, Manjaro, EndeavourOS)
Arch-based distros use pacman. Because Arch is a rolling release (updates come continuously rather than in big batches), you'll run into a different set of issues.
Keyring issues
What it means: pacman verifies that packages are legit using cryptographic keys. If your keyring is out of date, you'll see errors about invalid or corrupted packages, even though the packages are fine.
What to do: Refresh the keyring:
sudo pacman -Sy archlinux-keyring
sudo pacman -Su
On Manjaro, use manjaro-keyring instead. On EndeavourOS, use endeavouros-keyring.
Partial upgrades — never do this
This is important: On Arch-based systems, never run sudo pacman -Sy without -u. Here's why:
pacman -Syrefreshes your package database (the list of what's available)- But it doesn't actually upgrade anything
- Now your system thinks newer versions exist, but you're still running old ones
- If you install something new, it might need the newer libraries that you haven't actually installed yet — and things break
Always use:
sudo pacman -Syu
This refreshes the database and upgrades everything in one go. That's the safe way.
"file exists in filesystem"
What it means: pacman wants to install a file, but that file already exists and belongs to a different package (or was put there manually). pacman won't overwrite it without your say-so.
What to do:
- First, figure out which package owns the conflicting file:
pacman -Qo /path/to/the/file - If the file belongs to another package, you may need to update or remove that package first.
- If the file is an orphan (nothing owns it) and you're comfortable overwriting it:
You can also use a glob pattern if multiple files conflict:sudo pacman -Syu --overwrite '/path/to/the/file'sudo pacman -Syu --overwrite '/usr/lib/some-package/*'
Don't blindly overwrite everything. Check what the conflicting file is first. If it's from an AUR package or something you installed manually, deal with that package before forcing the overwrite.
My system won't boot after an update
This is the scary one, but you still have options. Here's how to get back in.
Boot into an older kernel version
When your computer starts up, there's a bootloader called GRUB that picks which version of Linux to load. If a kernel update broke things, you can boot into the previous (working) kernel.
- Restart your computer.
- Hold Shift (for BIOS systems) or press Esc repeatedly (for UEFI systems) right as the computer starts up. You need to catch it before Linux begins loading.
- You should see the GRUB menu — a text menu with a list of options.
- Select "Advanced options" and pick an older kernel from the list.
- If the older kernel boots fine, you can remove the broken kernel once you're logged in, or simply wait for the next kernel update to fix it.
Restore from Timeshift
If you set up Timeshift before things went wrong (good job!), you can roll back your entire system to a snapshot from before the broken update.
- Boot into the older kernel (see above) or use a live USB.
- Open Timeshift.
- Select a snapshot from before the update.
- Click Restore and follow the prompts.
- Reboot. Your system should be back to normal.
Chroot from a live USB
If you can't boot at all — not even into an older kernel — you can fix your system from outside using a live USB. This technique is called chroot (short for "change root"). It lets you pretend you're inside your installed system, even though you booted from the USB.
Step-by-step chroot instructions
You'll need a Linux live USB (the same one you used to install Linux works great).
- Boot from the live USB. Plug it in, restart your computer, and pick the USB from your boot menu (usually F12, F2, or Del at startup).
- Open a terminal once the live desktop loads.
- Find your Linux partition. Run:
Look for your main partition — it's usually the biggest one, something likelsblk/dev/sda2or/dev/nvme0n1p2. - Mount your partition:
Replacesudo mount /dev/sda2 /mnt/dev/sda2with your actual partition. - If you have a separate EFI partition (most modern systems do), mount that too:
sudo mount /dev/sda1 /mnt/boot/efi - Mount the special system directories:
sudo mount --bind /dev /mnt/dev sudo mount --bind /proc /mnt/proc sudo mount --bind /sys /mnt/sys sudo mount --bind /run /mnt/run - Chroot in:
Your terminal prompt will change. You're now "inside" your installed system.sudo chroot /mnt - Fix things. Now you can run the normal repair commands for your distro. For example:
# For Ubuntu/Mint/Debian: apt --fix-broken install dpkg --configure -a apt update && apt upgrade # For Fedora: dnf distro-sync # For Arch: pacman -Syu - Reinstall GRUB if the bootloader itself broke:
On Fedora, use# For UEFI systems: grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB update-grub # For legacy BIOS: grub-install /dev/sda update-grubgrub2-installandgrub2-mkconfig -o /boot/grub2/grub.cfginstead. - Exit and reboot:
exit sudo umount -R /mnt sudo reboot
Remove the USB drive as the system restarts. With any luck, you'll boot right back into your repaired system.
Preventing broken updates
A little bit of preparation goes a long way. Here's how to make sure a broken update is a minor annoyance rather than a crisis.
Use Timeshift
This is the single best thing you can do. Timeshift takes snapshots of your system that you can restore if something goes wrong. Think of it like System Restore on Windows, but better.
- Install it:
sudo apt install timeshift(Ubuntu/Mint) orsudo dnf install timeshift(Fedora) - Set it to take automatic snapshots (daily or weekly is a good starting point)
- Linux Mint includes Timeshift out of the box and reminds you to set it up — that's one reason Mint is great for newcomers
Don't interrupt updates
Seriously. If an update is running:
- Don't close the terminal
- Don't shut down or restart your computer
- Don't pull the power cable
An interrupted update is the number one cause of a broken package system. Let it finish, even if it's taking a while.
Update regularly
The longer you wait between updates, the bigger and riskier each update becomes. Updating once a week (or even once every couple of weeks) keeps things smooth. Waiting six months and then running a massive update is asking for trouble.
Read before you press Y
When your package manager tells you it's about to remove or replace something, read the list. If it wants to remove 200 packages to install one thing, something is probably wrong. Don't blindly confirm.