使用 apt 工具生成替代包列表

使用 apt 工具生成替代包列表

给定一个包,我如何列出可以替代该包的所有可能的包?在替代方案中,我如何判断是否安装了某个软件包或其替代方案之一?

当然,使用 apt 系列工具中的一些东西。

答案1

例如,如果您想列出所有要nano运行的替代方案:

apt-cache showpkg nano

以确定它提供了editor虚拟包。

然后运行:

aptitude search "?provides(editor)" | grep -v ":"

列出所有替代方案

p   deutex                          - composition tool for doom-style WAD files 
p   edbrowse                        - /bin/ed-alike webbrowser written in C     
p   emacs24                         - GNU Emacs editor (with GTK+ GUI support)  
p   emacs24-lucid                   - GNU Emacs editor (with Lucid GUI support) 
p   emacs24-nox                     - GNU Emacs editor (without GUI support)     
p   fte-console                     - Text editor for programmers - console edit
p   fte-terminal                    - Text editor for programmers - version for 
p   fte-xwindow                     - Text editor for programmers - X Window Sys 
p   jed                             - editor for programmers (textmode version) 
p   jove                            - Jonathan's Own Version of Emacs - a compac
p   jupp                            - user friendly full screen text editor     
p   le                              - Text editor with block and binary operatio
p   ledit                           - line editor for interactive programs      
p   levee                           - very small vi clone                       
p   mg                              - microscopic GNU Emacs-style editor        
i   nano                            - small, friendly text editor inspired by Pi
p   nano-tiny                       - small, friendly text editor inspired by Pi
p   ne                              - easy-to-use and powerful text editor      
p   pluma                           - official text editor of the MATE desktop e
p   rlfe                            - Front-end using readline to "cook" input l
p   rlwrap                          - readline feature command line wrapper     
p   scite                           - Lightweight GTK-based Programming Editor  
p   vigor                           - nvi with the evil paperclip               
p   vile                            - VI Like Emacs - vi work-alike             
i   vim                             - Vi IMproved - enhanced vi editor            
p   vim-athena                      - Vi IMproved - enhanced vi editor - with At
p   vim-gnome                       - Vi IMproved - enhanced vi editor - with GN
p   vim-gtk                         - Vi IMproved - enhanced vi editor - with GT
i   vim-nox                         - Vi IMproved - enhanced vi editor - with sc 
i   vim-tiny                        - Vi IMproved - enhanced vi editor - compact
p   xjed                            - editor for programmers (x11 version)      
p   xul-ext-password-editor         - edit password manager entries in Mozilla a
p   xvile                           - VI Like Emacs - vi work-alike (X11) 

grep -v ":"在这里过滤架构特定的包。

openbox另请注意,因为某些软件包通过示例提供了多个虚拟软件包x-window-managerx-session-manager。因此,如果要替换给定的包,则替换包必须提供原始包的所有虚拟包。

相关内容