Is it possible to install ctags without root privs?

Solution 1:

Yes.

You will need to compile it yourself and install it in your home directory.

Download ctags source: http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz

In hour shell:

$ tar zxf ctags-5.8.tar.gz
$ cd ctags-5.8
$ ./configure --prefix=$HOME
$ make && make install

This will compile and install ctags in your home directory. The resulting binary will be: $HOME/bin/ctags

You will now have to modify your PATH environment variable prior to launching vim.

$ vim $HOME/.bashrc (or whichever shell you're using)

put this line in your .bashrc

export PATH="$HOME/bin:$PATH"

You will now need to resource your .bashrc (remember that .bashrc is normally only loaded from non-interactive shells. Make sure that you source .bashrc from .bash_profile)

If you need to, modify your .bash_profile and make sure it has a line like:

. $HOME/.bashrc

or

source $HOME/.bashrc

To continue without closing your shell, simply type:

$ . $HOME/.bashrc

You can now launch vim and ctags will be working.

Solution 2:

You don't have to compile anything. Ctags is just a single binary program, so you can download the appropriate package, unpack it and put the binary in your path. Like that:

cd
mkdir tmp
cd tmp 
wget http://mirrors.kernel.org/ubuntu/pool/main/e/exuberant-ctags/exuberant-ctags_5.5.4-1_i386.deb
dpkg -x exuberant-ctags_5.5.4-1_i386.deb .
mkdir ~/bin
cp usr/bin/ctags-exuberant ~/bin
cd ~/bin
ln -sf ctags-exuberant ctags
export PATH=$PATH:$HOME/bin

Solution 3:

You should be able to do it yourself if you compile and install your own copy of the editor. You're not going to be able to install a system-wide package like the ones it's asking for without being root.

Solution 4:

If you are the one who installed this Ubuntu machine, then you are the user with uid 1000 meaning that you can run commands requiring root via the sudo command, e.g.

sudo app-get install exuberant-ctags

You may need to precede this with

sudo apt-get update

to get fresh package information.

Solution 5:

Certainly, just install it in your home directory from source.

Go to http://ctags.sourceforge.net/ and download the latest version. Expand it, open a terminal and go to the directory where you expanded it, then do this:

./configure --prefix=`( cd ~ ; pwd ~ )`
make all
make install

Now, edit your PATH with this (assuming bash, which is probably what you are using if you don't know how to do this without help):

export PATH=$PATH:`( cd ~ ; pwd ~ )`/bin

You might want to add that last line into your .bashrc or .bash_profile file as well for that matter.