1

I am trying to install the exuberant-ctags package on Linux Mint. To do so I ran:

sudo apt-get install exuberant-ctags

The output is:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
exuberant-ctags
0 upgraded, 1 newly installed, 0 to remove and 81 not upgraded.
Need to get 0 B/120 kB of archives.
After this operation, 334 kB of additional disk space will be used.
Selecting previously unselected package exuberant-ctags.
(Reading database ... 339129 files and directories currently installed.)
Preparing to unpack .../exuberant-ctags_1%3a5.9~svn20110310-7ubuntu0.1_amd64.deb ...
Unpacking exuberant-ctags (1:5.9~svn20110310-7ubuntu0.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up exuberant-ctags (1:5.9~svn20110310-7ubuntu0.1) ...
update-alternatives: using /usr/bin/ctags-exuberant to provide /usr/bin/ctags (ctags) in auto mode

The last line suggests that ctags-exuberant is used instead of ctags.

When I, however, restart bash and run ctags -e I get the error:

ctags: invalid option -- 'e'

While the -e option is available in exuberant-ctags.

Why hasn't exuberant-ctags replaced ctags?

/edit

command -v ctags outputs:

/usr/local/bin/ctags

(This is not what I want :)).

ls -l /usr/bin/ctags outputs:

lrwxrwxrwx 1 root root 23 Dec 28 2015 /usr/bin/ctags -> /etc/alternatives/ctags

ls -l /etc/alternatives/ctags outputs:

lrwxrwxrwx 1 root root 24 Aug 9 21:22 /etc/alternatives/ctags -> /usr/bin/ctags-exuberant

and

ctags --version outputs:

ctags (GNU Emacs 24.5)
Copyright (C) 2015 Free Software Foundation, Inc.
This program is distributed under the terms in ETAGS.README

  • Please update the question with the output of command -v ctags and ls -l /usr/bin/ctags and ls -l /etc/alternatives/ctags and ctags --version – Stephen Harris Aug 9 '16 at 20:14
  • @StephenHarris done. – Erwin Rooijakkers Aug 9 '16 at 20:24
3

It's possible that your installation just added exuberant-ctags as an option for alternatives.

/usr/bin/update-alternatives --display ctags

If it is pointing to the wrong version you can manually set the alternative

sudo /usr/bin/update-alternatives --set ctags /usr/bin/ctags-exuberant

In your case, however (based on your question update) you have a non-packaged version of ctags in your PATH (/usr/local/bin/ctags) before the packaged ctags-exuberant and alternatives version, so this is being called first.

You either need to remove that version, modify your $PATH or add a symlink to /usr/bin/ctags earlier in your path (perhaps $HOME/bin) so that you're running the version you want to run.

  • Thanks. It is pointing to the correct version though. link currently points to /usr/bin/ctags-exuberant. – Erwin Rooijakkers Aug 9 '16 at 19:43
  • When I run /usr/bin/ctags-exuberant -e it does work. As a quick hack I can create an alias like so: alias ctags='/usr/bin/ctags-exuberant'. Edit: this does not work since emacs apparently uses another shell. – Erwin Rooijakkers Aug 9 '16 at 19:47
  • Thanks. Removing this local ctags version did the trick. Thank you very much for your help! Glad to have learned the command command. – Erwin Rooijakkers Aug 9 '16 at 20:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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