Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Given a package how can I list all possible packages that are alternatives to this package? In the alternate, how can I tell if a package or one of it's alternates is installed?

Using something in the apt family of tools, of course.

share|improve this question
    
you mean alternatives, as in /etc/altrnatives, or just functionally similar –  Dārayavahuš tdi Feb 19 at 12:40

1 Answer 1

For example, if you want to list all the alternatives to nano run:

apt-cache showpkg nano

to determine that it provides the editor virtual package.

Then run:

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

to list all alternatives

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 ":" is here to filter architecture specific packages.

Also beware because some packages provides multiple virtual packages by example openbox provides x-window-manager and x-session-manager. So if you want to replace a given package, the replacement package has to provide all the virtual packages of the original one.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.