How to install VIM on Linux when I don't have root permissions?

22

10

I've got some troubles when I try to install Vim on Linux while I don't have a root account. The error information is shown below:

errorinfo

How can I solve this? Can I install it in another directory other than /usr/local/bin/vim?

SpawnST

Posted 2010-07-12T09:04:37.710

Reputation: 1 891

Answers

18

make install DESTDIR=~/.local, then make a symlink in ~/bin to ~/.local/bin/vim.

Ignacio Vazquez-Abrams

Posted 2010-07-12T09:04:37.710

Reputation: 100 516

Do I need to create a fold named .local or it's just a normal name? – SpawnST – 2010-07-12T09:24:05.377

1It is safest to create the destination directory yourself. – Ignacio Vazquez-Abrams – 2010-07-12T09:31:40.667

1I got a vim diretory like /home/apache/.local/usr/local/share/vim/vim72 after finish the two steps.Anything wrong? – SpawnST – 2010-07-12T09:36:40.310

You'll need to pass a different --prefix option to configure as well then. – Ignacio Vazquez-Abrams – 2010-07-12T09:38:24.347

4it would be greatly appreciated if you can write all steps down in the answer. – SpawnST – 2010-07-12T09:44:44.317

4./configure --prefix=~/.local && make install – akira – 2010-07-12T10:33:44.107

17

I often install things with ./configure --prefix=$HOME/.local && make && make install where I'm not root. That's the way to proceed.

This works with most software. Vim is in no way different here.

Note that in vim case, I actually configure with the following options (as well) --disable-perlinterp --enable-rubyinterp --enable-multibyte --enable-pythoninterp --with-features=huge as I like my version of Vim to be quite complete.

Luc Hermitte

Posted 2010-07-12T09:04:37.710

Reputation: 1 575

1

  1. Create local user path:

    mkdir -p ~/usr/local
    
  2. Downloaded latest version of ncurses from here: http://ftp.gnu.org/pub/gnu/ncurses/

  3. Install ncurses:

    cd <path_to_ncurses_downloaded_folder>
    tar -xzvf <ncurses>.tar.gz
    cd <ncurses_extracted_folder>
    ./configure --prefix=$HOME/usr/local
    make
    make install
    
  4. Clone vim-repo with

    git clone https://github.com/vim/vim.git
    
  5. Install vim with:

    cd vim/src
    LDFLAGS=-L$HOME/usr/local/lib ./configure --prefix=$HOME/usr/local
    make
    make install
    
  6. Set PATH with

    export PATH=$PATH:$HOME/usr/local/bin
    

veeru dumpala

Posted 2010-07-12T09:04:37.710

Reputation: 11

0

step 1: make install DESTDIR=~/.local (make your local dir if it is not present)

step 2: export PATH=$PATH:/remote/users/yourusername/.local/bin

user3059007

Posted 2010-07-12T09:04:37.710

Reputation: 1