Delete the updates with:cd /var/lib/dpkg/updatessudo rm *
Tried to update and upgrade:sudo apt updatesudo apt upgrade
Still it says that:E: Could not get lock /var/lib/dpkg/lockThis means that some program is blocking the system or installing a new software.
Check if any programs is locking dpkg file:
ps aux | grep -i apt
try to see which are existing locks
sudo lsof /var/lib/dpkg/locksudo lsof /var/lib/apt/lists/locksudo lsof /var/cache/apt/archives/lock
Try to delete them using:
sudo rm /var/lib/apt/lists/locksudo rm /var/cache/apt/archives/locksudo rm /var/lib/dpkg/lockTry again:
sudo dpkg --configure -aIt should work.
Try again to installing with:
sudo apt updatesudo apt upgradeThis should resume the process and keep everything stable.
this way it resolved my issue of dbpkg is locked