How To Fix Could not get lock var /lib/dpkg/lock Error in Ubuntu Linux

preview_player
Показать описание
If you are getting this error message while doing apt upgrade and apt update.

Could not get lock var /lib/dpkg/lock

It means that some other process in the Ubuntu Linux is running the apt update and apt upgrade.

Check if apt process running in background using the following command.
ps aux | grep -i apt

Set the value to zero as shown below.
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";

Originally it would be all 1 (ones).
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

Set the value to zero as shown below.
APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Unattended-Upgrade "0";

UnattendedUpgrades
The purpose of unattended-upgrades is to keep the computer current with the latest security (and other) updates automatically.

I hope it helps!

Command Summary

1) SSH into Linux box
ssh #USERNAME#@#IP ADDRESS OF LINUX MACINE#

2) Login as super user
sudo su

3) Upgrade and update Ubuntu
sudo apt update && sudo apt upgrade -y

4) Check apt process running in background
ps aux | grep -i apt

5) Edit automatic upgrades

YOUTUBE

#ubuntu #linux #apt
Рекомендации по теме
Комментарии
Автор

Please how can I fix this error dpkg --configure -a in Ubuntu

Sarah-ldnw