Troubles in updating system

Ubuntu Version:
25.10

Desktop Environment (if applicable):
GNOME

Problem Description:
I had a crash of my machine, an Ubuntu Desktop 25.10. And now when I try to update from terminal with :

sudo apt update && sudo apt upgrade

I get this error:

**3 packages can be upgraded. Run 'apt list --upgradable' to see them.**
**Error:** **Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)**
**Error:** **Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?**

then I tried to see if there were some locking process with:

sudo lsof /var/lib/dpkg/lock-frontend

but it didn’t return me any process but just a list of warning "can’t stat … "

then I did, anyway:
sudo rm /var/lib/dpkg/lock-frontend

but the error is still there.
How can I solve it?

Btw, should I check the ext4 boot disc? Can I check it from recovery in Ubuntu and how?

Thanks in advance for the answers! :slight_smile:

Should be
$ sudo apt update && sudo apt upgrade

Or if you want to save a few keystrokes
$ sudo apt upgrade --update

1 Like

Sorry I re-wrote too fast … it was actually:

sudo apt update && apt upgrade

so the error is still the matter…

As stated above, you are missing the sudo from apt upgrade, so you are running it as your non-root UserID.

As stated above it was a typo error of mine.

Heh. Ok do it this way then.

$ sudo apt update
$ sudo apt upgrade