无法运行 apt update,因为 apt-config 正在后台运行

无法运行 apt update,因为 apt-config 正在后台运行

我无法再更新我的系统,因为 apt-config 的一些变体正在后台运行。'ps aux | grep apt' 显示以下两个程序之一在后台不断运行。此外,我无法终止这些程序,因为 PID 不断变化。另外,请注意,一个名为“_apt”的用户似乎正在运行这些程序。任何帮助都将不胜感激!

apt-config shell MASTER_KEYRING APT::Key::MasterKeyring
apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d

答案1

man apt-config页面:

   apt-config is an internal program used by various portions of the APT suite to provide
   consistent configurability. It accesses the main configuration file /etc/apt/apt.conf in a
   manner that is easy to use for scripted applications.

因此,应该找出每个apt-config进程的父进程。

for i in $( pgrep apt-config ) ; do ps -fp$i; done

并查看该PPID列。

答案2

unattended-upgrades运行apt-dailyapt-daily运行apt-config。您可以通过运行以下命令来禁用自动更新:

sudo sed -i 's/1/0/g' /etc/apt/apt.conf.d/20auto-upgrades
sudo sed -i 's/1/0/g' /etc/apt/apt.conf.d/10perodic

来源:

wiki.debian.org/UnattendedUpgrades

在 Debian 上,周期性文件不一样:

sudo sed -i 's/1/0/g' /etc/apt/apt.conf.d/02perodic

相关内容