AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 842115
Accepted
Rolf
Rolf
Asked: 2017-04-03 14:09:48 +0800 CST2017-04-03 14:09:48 +0800 CST 2017-04-03 14:09:48 +0800 CST

为什么“apt-get autoremove sendmail”会留下依赖关系?

  • 772

我注意到安装 sendmail,然后卸载它,使用 apt-get 会留下许多不需要的文件。

sudo apt-get install sendmail
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  liblockfile-bin liblockfile1 make procmail sendmail-base sendmail-bin
  sendmail-cf sensible-mda
Suggested packages:
  make-doc sendmail-doc rmail logcheck resolvconf sasl2-bin
Recommended packages:
  default-mta mail-transport-agent fetchmail
The following NEW packages will be installed:
      liblockfile-bin liblockfile1 make procmail sendmail sendmail-base
      sendmail-bin sendmail-cf sensible-mda
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 2256 kB of archives.
After this operation, 5263 kB of additional disk space will be used.
Do you want to continue? [Y/n] y

所以我们安装了 sendmail - 9 个新包和 5.2MB。
几分钟后,我改变了主意,想卸载它。没问题,apt-get 让我满意,对吧?我清除(删除包和包配置文件):

sudo apt-get purge sendmail
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  procmail sensible-mda
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  sendmail*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 219 kB disk space will be freed.
Do you want to continue? [Y/n] y

然后autoremove(删除自动安装的包依赖)

sudo apt-get autoremove sendmail
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'sendmail' is not installed, so not removed
The following packages will be REMOVED:
  procmail sensible-mda
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 550 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 24702 files and directories currently installed.)
Removing sensible-mda (8.14.4-8+deb8u1) ...
Removing procmail (3.22-24) ...
Processing triggers for man-db (2.7.0.2-5) ...

即 219 + 550 = 769KB 已恢复!我刚刚释放了 4.something MB 的空间吗?为了什么?

仔细查看输出后,似乎 apt-get 仅删除了之前自动安装的 3 个软件包。例如,软件包 sendmail-base 仍然存在:

sudo apt-get remove sendmail-base
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  sendmail-base sendmail-bin
0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
After this operation, 2464 kB disk space will be freed.
Do you want to continue? [Y/n]

所以我浪费了一些空间。但是为什么还安装了这些自动安装的依赖呢?

debian
  • 1 1 个回答
  • 691 Views

1 个回答

  • Voted
  1. Best Answer
    Gav
    2017-04-05T17:39:09+08:002017-04-05T17:39:09+08:00

    sendmail 是一个包含一组依赖项的元包。当您安装 sendmail 元包时,它会安装 sendmail-bin 等。这为 cron 提供了一个推荐的包,例如,但我相信在 sendmail 依赖链中也有一些其他的包推荐包。

    Autoremove 不会删除其他软件包推荐的自动软件包。例如,您可以通过添加此 apt 配置来更改此行为/etc/apt/apt.conf.d/99_norec

    APT::AutoRemove::RecommendsImportant "false";
    APT::AutoRemove::SuggestsImportant "false";
    

    然后运行apt-get remove --auto-remove sendmail​​,您应该会看到所有与 sendmail 相关的包都被标记为删除,以及一些其他不相关的东西,由于 apt 配置的整体变化,这些东西现在是删除的候选对象。

    不过,我认为不建议这样做(没有双关语)。如果您需要摆脱它们,您应该手动处理它们。

    • 7

相关问题

  • 关闭 FTP

  • 如何在同一台电脑上从 putty 连接 debian vmware

  • debian- 文件到包的映射

  • Debian Ubuntu 网络管理器错误 [关闭]

  • 为本地网络中的名称解析添加自定义 dns 条目

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve