Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 '15 at 12:40
Did you check if my answer is correct? – Ortomala Lokni Dec 9 '15 at 9:47

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


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.