On Debian11/KDE when trying to upgrade packages (and earlier sudo apt-get update
as well) it displays the following error message:
Cannot get the exclusive lock on the package backend.
Please close any other legacy packaging tools that may be open.
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process {id} (unattended-upgr)
W: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
In the process manager (KSysguard) the process-tree is like this:
apt.systemd.dai->apt.systemd.dai->unattended-upgr->unattended-upgr->unattended-upgr
When I try to "End Process" in KSysGuard it just gets restarted (and that wouldn't be the solution anyway). The process finishes after a while but there are still security updates that haven't been implemented so I'm not sure what it does / how it's useful.
I also had this problem after a dist-upgrade.
How to abort unattended-upgrades or configure it so that it gets aborted automatically once apt-get is used to upgrade? I think it should be as easy as possible (by default) to update packages and something blocking the update could be a problem for people who just started using GNU/Linux or aren't interested in spending time to solve this problem of updating suddenly not working for unknown reasons. Some people recommend to manually (via commands) temporarily stop (even requiring a reboot) or permanently remove the unattended-upgr package.
Concerning permanently removing unattended-upgr I think that upgrading packages in the background would be useful but is unattended-upgr actually doing so?
In any case if this isn't a bug or a problem of Debian's default configuration of it, it currently seems to decrease user-friendliness / convenience / UX.