过时的包与孤立的包

Big*_*uge 19 apt

过时和孤立的软件包有什么区别?更具体地说,为什么会deborphan产生这个:

dave@ubuntu:~$ deborphan
libbind9-80
libllvm3.1
libgrail5
libpython3.2
libsvga1
libarchive12
libdirectfb-1.2-9
gcalctool
liblwres80
libqpdf8
libkms1
libnux-3.0-0
Run Code Online (Sandbox Code Playgroud)

...而aptitude search '~o'产生这个:

dave@ubuntu:~$ aptitude search '~o'
idA libarchive12                                 - Multi-format archive and compression library (shared li
i   libbind9-80                                  - BIND9 Shared Library used by BIND                      
i   libdns81                                     - DNS Shared Library used by BIND                        
i   libdrm-nouveau1a                             - Userspace interface to nouveau-specific kernel DRM serv
idA libgrail5                                    - Gesture Recognition And Instantiation Library          
i   libisc83                                     - ISC Shared Library used by BIND                        
i   libisccc80                                   - Command Channel Library used by BIND                   
i   libisccfg82                                  - Config File Handling Library used by BIND              
i   liblwres80                                   - Lightweight Resolver Library used by BIND              
idA libnux-3.0-0                                 - Visual rendering toolkit for real-time applications - s
idA libnux-3.0-common                            - Visual rendering toolkit for real-time applications - c
idA libpython3.2                                 - Shared Python runtime library (version 3.2)            
idA libqpdf8                                     - runtime library for PDF transformation/inspection softw
i   libudev0                                     - udev library                                           
i A linux-headers-3.5.0-27                       - Header files related to Linux kernel version 3.5.0     
i A linux-headers-3.5.0-27-generic               - Linux kernel headers for version 3.5.0 on 32 bit x86 SM
i   linux-image-3.5.0-27-generic                 - Linux kernel image for version 3.5.0 on 32 bit x86 SMP 
i   linux-image-extra-3.5.0-27-generic           - Linux kernel image for version 3.5.0 on 32 bit x86 SMP 
i   python3.2                                    - Interactive high-level object-oriented language (versio
i   python3.2-minimal                            - Minimal subset of the Python language (version 3.2)
Run Code Online (Sandbox Code Playgroud)

奖金问题:apt-get autoremove甚至更不同。为什么?

dave@ubuntu:~$ sudo apt-get --purge autoremove
[sudo] password for dave: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  gksu* libarchive12* libdirectfb-1.2-9* libgksu2-0* libgnome-menu2* libgrail5* libllvm3.1*
  libnux-3.0-0* libnux-3.0-common* libpython3.2* libqpdf8* libsvga1* libts-0.0-0* libx86-1*
  mobile-broadband-provider-info* python-imaging* python-imaging-compat* python-    oauth* tsconf*
0 upgraded, 0 newly installed, 19 to remove and 0 not upgraded.
After this operation, 33.8 MB disk space will be freed.
Do you want to continue [Y/n]? n
Abort.
Run Code Online (Sandbox Code Playgroud)

如果有人想知道,升级到 13.04 是促使这一点的原因。

Hen*_*eck 30

简而言之,过时的软件包不再位于您列表中的任何存储库中。孤立包是自动依赖项,其“依赖项”已全部卸载。并且apt-get autoremove只考虑apt为解决依赖关系而安装的孤立包。

过时的包

您可能知道,apt保留一个可以从中获取包的存储库列表。但有时,软件包会从存储库中删除。也许不再有人照顾(维护)该软件包,而(非常)旧的最后一个可用版本已成为安全风险。或者,程序可能已经更改了名称,相应地更改了包名称,并删除了旧名称下的旧包。从存储库中删除包还​​有其他可能的原因。

如果您的系统上安装了某个软件包,但在您apt的列表中的任何存储库中都找不到该软件包,则该软件包将被视为“已过时”。

孤立的包

您可能也知道,apt可以管理包之间的依赖关系。例如,一个名为“greatprogram”的程序需要一个名为“greatlibrary”的库才能工作。因此,可以将包含 greatlibrary 的包标记为包含 greatprogram 的包的自动依赖项。您将无法安装 greatprogram 包,除非已经安装了 greatlibrary(或将使用相同的命令安装)。

但是,如果您在晚些时候卸载了 greatprogram 并留下了 greatlibrary 怎么办?在那种情况下,曾经至少有一个其他包需要 Greatlibrary 作为依赖项,但现在没有其他包不再需要了。那些“遗留”的包被称为“孤立包”。

apt-get 自动删除

您可能知道的另一个事实是,它apt可以为您自动解决依赖关系。假设你想安装前面提到的greatprogram,但还没有安装greatlibrary。apt-get“通知”存在未满足的依赖项,并提供您安装 greatlibrary 的机会。

apt-get autoremove为您提供删除任何以这种方式安装的孤立包以解决依赖关系。以其他方式安装的孤立包不在 autoremove 的列表中。例如,如果您在安装 greatprogram 之前自己安装了 greatlibrary,并且在稍后卸载了 greatprogram,则 greatlibrary 仍将是孤立的。但是 autoremove 不会处理它,因为由于已解析的依赖项,它还没有自动安装。

  • 感谢您的精彩解释。不过很好奇:为什么`deborphan` 不处理`autoremove` 的所有功能?我明白为什么它不能反过来工作。 (2认同)