将 ctags 替换为 exuberant-ctags

将 ctags 替换为 exuberant-ctags

我正在尝试exuberant-ctags在 Linux Mint 上安装该软件包。为此,我跑了:

$ sudo apt-get install exuberant-ctags

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

最后一行建议ctags-exuberant使用 来代替ctags

但是,当我重新启动 bash 并运行时,ctags -e出现错误:

ctags: invalid option -- 'e'

虽然该-e选项在exuberant-ctags.

怎么还没exuberant-ctagsctags

$ command -v ctags

/usr/local/bin/ctags

这不是我想要的

$ ls -l /usr/bin/ctags

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

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

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

答案1

您的安装可能只是exuberant-ctags作为替代选项添加的。

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

如果它指向错误的版本,您可以手动设置替代版本

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

但是,在您的情况下(根据您的问题更新),在打包版本之前,您的 PATH ( )中ctags有一个非打包版本,因此首先调用它。/usr/local/bin/ctagsctags-exuberantalternatives

您需要删除该版本,修改您的版本$PATH或将符号链接添加到/usr/bin/ctags路径中的较早位置(也许$HOME/bin),以便您运行您想要运行的版本。

相关内容