由于 dpkg 被另一个进程使用,升级无法进行

由于 dpkg 被另一个进程使用,升级无法进行

我无法在 Ubuntu 20.04 上安装任何东西。原因如下 dpkg:错误:dpkg 前端锁已被另一个进程锁定. 这是用于以下 root 进程 /usr/bin/python3 /usr/bin/无人值守升级。我还尝试终止该进程,但出现以下错误:bash:kill:(9006)-操作不允许.不确定我能做什么。有人可以帮我吗?

答案1

Oldfred 的清洁和修复命令列表

#houseclean
sudo apt-get autoclean # only removes files that cannot be downloaded anymore (obsolete)
sudo apt-get clean

#refresh
sudo apt-get update #resync package index
sudo apt-get upgrade #newest versions of all packages, update must be run first

#would upgrade you to the latest kernel in the repositories
#dist-upgrade is also able to remove existing packages if required
sudo apt-get dist-upgrade

# fix Broken packages -f 
sudo apt-get -f install
sudo dpkg --configure -a

# Remove lock
# If you are absolutely sure you do not have another upgrade process running.
# Locked dpkg - only if sure you are not running another update.

sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a 

# added zika's tip for problems with hash sum mismatch

sudo rm /var/lib/apt/lists/*
sudo apt-get update

# added 2F4U's tips for Package Manager & Update Manager problems
#Does executing these commands help?

cd /var/lib/apt
sudo mv lists lists.old
sudo mkdir -p lists/partial
sudo apt-get update
# This will rebuild the cache.

如果这些命令都没有帮助,这个 Ubuntu 论坛主题还有其他建议:

http://ubuntuforums.org/showthread.php?t=1869890

相关内容