我有一个相当新鲜的Debian挤压安装在端口111打开rpc.statd。 我做了一个apt-get purge portmap,因为我想禁用rpc服务并closures我盒子上的开放端口; 我被提出以下几点:
Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libtirpc1 rpcbind Use 'apt-get autoremove' to remove them. The following extra packages will be installed: libtirpc1 rpcbind The following packages will be REMOVED: nfs-common* portmap* The following NEW packages will be installed: libtirpc1 rpcbind 0 upgraded, 2 newly installed, 2 to remove and 0 not upgraded. Need to get 127 kB of archives. After this operation, 438 kB disk space will be freed. Do you want to continue [Y/n]? n
长话短说,我能够通过首先执行apt-get purge nfs-common,然后是apt-get purge portmap来移除portmap,而无需安装额外的软件包。
谁能解释这种行为? 为什么apt-get尝试在第一种情况下尝试清除portmap时安装rpcbind和libtirpc1,而不是第二种? 从上面的输出结果可以看出,apt-get打算随着portmap一起去除nfs-common。 我唯一能find的其他相关细节是fam取决于portmap,但是这是一个远程服务器,fam和gui是不需要的。 这是一个错误,或者我错过了什么? 如果是的话,报告应该指向谁?
APT的目的不是给你一个破碎的系统。 它不知道你正在运行一个服务器,并不需要一些包或其他。
如果某些其他软件包取决于您要删除的软件包,则会在尝试删除软件包时看到类似的行为,但也可以使用其他软件包。 当你试图删除包,这取决于APT将提供安装替代。
如果您尝试清除邮件传输代理(邮件服务器),您将会经常看到这一点。 有大量的程序需要一个MTA,所以当你试图清除exim或postfix时,另一个将被安装。
只需在/ etc / default / portmap中执行以下操作即可停止portmap在外部接口上的侦听:
# If you want portmap to listen only to the loopback # interface, uncomment the following line (it will be # uncommented automatically if you configure this # through debconf). OPTIONS="-i 127.0.0.1"
然后做:
/etc/init.d/portmap restart
我认为这个问题很简单,但很棘手。 Apt不会安装rpcbind,因为您从输出中删除了portmap:
The following extra packages will be installed: libtirpc1 rpcbind
但是它也注意到rpcbind不再是必要的,因为nfs-common也将被删除。 从你的输出:
The following packages were automatically installed and are no longer required: libtirpc1 rpcbind Use 'apt-get autoremove' to remove them.
如果你的答案是“y”,那么apt会删除portmap和nfs-common,并安装libtirpc1和rpcbind。 然后,你将运行apt-get autoremove删除libtirpc1和rpcbind。
我认为这可能是在公司决策过程中的重要性。
即规则:移除portmap,然后安装rpcbind
比规则更重要:nfs-common被移除,所以我不需要rpcbind
第一条规则可能会被检查而不知道nfs-common被删除。 不再需要一个软件包,而不是依赖已经被打破。 之后通过运行“apt-get autoremove”很容易“修复”。
我不认为这是一个错误,只是apt的决策过程的结果。