Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

At my company, there are several linux boxes, each with various versions of VIM installed. On one box is version 7, the other is Tiny VIM 6.

Tiny VIM doesn't have color and it annoys the heck out of me. I have root access but I am very new to bash and terminal commands, therefore I don't want to break anything.

Is there some easy way for me to just copy VIM 7 from one box over to the other just for my local use? Is VIM that portable?

Thanks

share|improve this question

migrated from stackoverflow.com Oct 14 '09 at 12:09

This question came from our site for professional and enthusiast programmers.

3 Answers 3

Rather than copy, you should use a package manager (installer), eg. rpm or apt-get. Although you normally use these tools to install for everyone, you can usually specify a directory to install them in. This could be local to you.

What Linux distro are you running? Then we can be more specific.

share|improve this answer
    
Linux version 2.6.9-34.ELsmp –  Gary H Oct 13 '09 at 21:38
    
Red Hat 3.4.5-2 –  Gary H Oct 13 '09 at 21:39
    
Therefore investigate the RedHat Package Manager (rpm). You can use it to download and install vim for you. –  dave Oct 13 '09 at 22:26

On Linux the best way is to recompile binaries on specific box.

If you don't want to break anything you could try recompiling and installing into your own home directory.

Make sure you don't do that as root.

Usually it's just:

mkdir /home/yourusername/local
mkdir /home/yourusername/local/src
download vim source to local/src directory
cd /home/yourusername/local/src
tar -zxvf <yourdownloadedvimsource.tar.gz>
cd vim72        <-- or whatever the unpacked directory is
./configure --prefix=/home/yourusername/local
make
make install

This will install vim into /home/yourusername/local/bin

share|improve this answer
    
Also update your path for the non-privileged user to include /home/yourusername/local/bin before the system bin files to pick up the new version of vim in preference to the old version. –  David Harris Oct 13 '09 at 21:20
    
I modified the prefix and got to the make install process. It bombed out with a big screen dump. Tail end of the dump... link.sh: Linked fine with a few libraries removed if test -f /home/gary /bin/vim; then \ mv -f /home/gary /bin/vim /home/gary /bin/vim.rm; \ rm -f /home/gary /bin/vim.rm; \ fi /bin/sh: line 0: test: /home/gary: binary operator expected cp vim /home/gary /bin cp: cannot create regular file /bin/vim': Permission denied cp: omitting directory /home/gary' make: *** [installvimbin] Error 1 Once installed, can I tar up this directory and move it to the other box for use? –  Gary H Oct 13 '09 at 21:49
    
It's a bit hard to tell from the dump, but it appears the directory you specificied "/home/gary" is not being used by the install script correctly. For example, "test -f /home/gary /bin/vim", should probably be "test -f "/home/gary/bin/vim", ie. the space is removed. A few other instances of the same issue appear. If you can resolve that, you might have more luck. –  dave Oct 13 '09 at 22:25
    
Did you have write access to the directory where you pointed with 'prefix'? In example above I try to point to directory under user home directory as you wanted to try install for only one user (I assume that user is not root ... which should not be a problem anyway ...). –  stefanB Oct 13 '09 at 23:05

You can download the sources and compile yourself - it's not that hard once you try.

If it's okay to change VIM for all the users of the machine, by all means install it through the package manager instead.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.