How to fix “ waiting for unattended-upgr to exit ” error?

Sometimes when you log in to your Linux computer and try to update you may find an error “waiting for unattended-upgr to exit”. This prevents your system from downloading further updates. So what should you do in this situation?

Here we will try to fix this problem by using a few commands in our terminal.

What exactly this error is?

Once you log in to your system and run the following command –

sudo apt update

It will display the given output in your terminal –

Or if you run the software updater it will show –

Why this error is caused

This is caused because there might be some process actually updating packages in the background.

So you should wait for a few minutes and then try again to update your system.

You can check the background processes updating packages and using the lock by using –

  • sudo ps -eaf | grep -i apt
  • sudo lsof /var/lib/dpkg/lock-frontend

Steps to fix the problem

If the error is not fixed after waiting sometimes then you should follow the steps given below –

1. The first step is to stop the automatic updater by using –

sudo dpkg-reconfigure -plow unattended-upgrades

At the first prompt choose not to download and install updates. Once done make a system reboot.

2. Make sure packages are in a clean state and are installed correctly –

sudo dpkg --configure -a

3. Now run the system update commands-

sudo apt update && sudo apt full-upgrade

4. Turn on the automatic updater again by using –

sudo dpkg-reconfigure -plow unattended-upgrades

And select the package unattended-upgrades again.

Leave a Comment