如何停止/禁用自动启动无人值守升级?

Pan*_*dya 25 trisquel unattended-upgrades

我最近在我的台式电脑上安装了 Trisquel 8.0 LTS (Flidas),它在 Trisquel 7.0 上运行了 4 年。系统变得非常缓慢。当我检查 RAM 和 CPU 使用率时,我发现 CPU 几乎是 100% 我top调整看看出了什么问题,发现它unattended-upgr正在消耗整个 CPU。

在此处输入图片说明

我试图通过使用PID来杀死它,sudo kill 1803但过了一段时间,它又自动启动了。我知道无人值守升级旨在自动安装重要的安全更新,但是我需要禁用它自动启动。

我怎么做?

小智 36

您需要按如下方式停止自动更新程序:

运行以下命令

sudo dpkg-reconfigure -plow unattended-upgrades
Run Code Online (Sandbox Code Playgroud)

您将看到配置无人值守升级的提示:

在此处输入图片说明

选择禁用自动下载和安装更新,然后按 Enter。

这将更新配置文件/etc/apt/apt.conf.d/20auto-upgrades,设置APT::Periodic::Unattended-Upgrade"0".

  $ sudo dpkg-reconfigure -plow unattended-upgrades
  Replacing config file /etc/apt/apt.conf.d/20auto-upgrades with new version
  $ cat /etc/apt/apt.conf.d/20auto-upgrades
  APT::Periodic::Update-Package-Lists "0";
  APT::Periodic::Unattended-Upgrade "0";
Run Code Online (Sandbox Code Playgroud)

有关配置软件包的更多信息,请参阅man dpkg-reconfigure

--configure package...|-a|--pending
          Configure a package which has been unpacked but not yet  config?
          ured.   If  -a  or  --pending  is  given instead of package, all
          unpacked but unconfigured packages are configured.

          Configuring consists of the following steps:

          1.  Unpack  the  conffiles, and at the same time back up the old
          conffiles, so that they can be restored if something goes wrong.

          2. Run postinst script, if provided by the package

dpkg-reconfigure - reconfigure an already installed package

   -pvalue, --priority=value
       Specify the minimum priority of question that will be displayed.
       dpkg-reconfigure normally shows low priority questions no matter
       what your default priority is. See debconf(7) for a list.

   -a, --all
       Reconfigure all installed packages that use debconf. Warning: this
       may take a long time.

--no-reload
           Prevent dpkg-reconfigure from reloading templates. Use with caution; this will prevent
           dpkg-reconfigure from repairing broken templates databases.  However, it may be useful
           in constrained environments where rewriting the templates database is expensive.
Run Code Online (Sandbox Code Playgroud)

  • 我刚刚修改了答案以包含更多信息。 (4认同)