Make install fails with /etc/alternatives/ex

29 views
Skip to first unread message

Devin Weaver

unread,
Jun 27, 2023, 8:29:27 PM6/27/23
to vim_dev
On a fresh Ubuntu install attempting to run “make install” has an error:

cd /usr/bin; ln -s vim ex
ln: failed to create symbolic link 'ex': File exists
make[1]: *** [Makefile:2687: /usr/bin/ex] Error 1
make[1]: Leaving directory '/home/suki/source/vim/src'
make: *** [Makefile:39: install] Error 2

ls /usr/bin/ex
lrwxrwxrwx 1 root root 20 Feb 17 17:24 /usr/bin/ex -> /etc/alternatives/ex*

I’m not so sure what to do about that. Hadn’t run into this before.

Christian Brabandt

unread,
Jun 28, 2023, 8:15:52 AM6/28/23
to vim...@googlegroups.com

On Di, 27 Jun 2023, Devin Weaver wrote:

> On a fresh Ubuntu install attempting to run “make install” has an error:
>
> cd /usr/bin; ln -s vim ex
> ln: failed to create symbolic link 'ex': File exists
> make[1]: *** [Makefile:2687: /usr/bin/ex] Error 1
> make[1]: Leaving directory '/home/suki/source/vim/src'
> make: *** [Makefile:39: install] Error 2
>
> ls /usr/bin/ex
> lrwxrwxrwx 1 root root 20 Feb 17 17:24 /usr/bin/ex -> /etc/alternatives/ex*
>
So you probably have a package installed, that provides `/usr/bin/ex`.
Try `dpkg -S $(realpath $(which ex))`

> I’m not so sure what to do about that. Hadn’t run into this before.

I would recommend, to use ./configure --prefix=$HOME/local/

to install into your local directory. Then you also do not need to use
sudo to run make install

Just make sure, to add $HOME/local/bin to your $PATH


Best,
Christian
--
Die Rechtschreibung bereitet dem Menschen sein ganzes Leben lang
Schwierigkeiten, sei denn, er ist Analphabet.

Bram Moolenaar

unread,
Jun 29, 2023, 12:40:01 PM6/29/23
to vim...@googlegroups.com, Christian Brabandt

Christian wrote:

> On Di, 27 Jun 2023, Devin Weaver wrote:
>
> > On a fresh Ubuntu install attempting to run “make install” has an error:
> >
> > cd /usr/bin; ln -s vim ex
> > ln: failed to create symbolic link 'ex': File exists
> > make[1]: *** [Makefile:2687: /usr/bin/ex] Error 1
> > make[1]: Leaving directory '/home/suki/source/vim/src'
> > make: *** [Makefile:39: install] Error 2
> >
> > ls /usr/bin/ex
> > lrwxrwxrwx 1 root root 20 Feb 17 17:24 /usr/bin/ex -> /etc/alternatives/ex*
> >
> So you probably have a package installed, that provides `/usr/bin/ex`.
> Try `dpkg -S $(realpath $(which ex))`

Mixing Vim packages installed with the regular installer interferes with
what you install manually. It's best to keep them separate to avoid
trouble.

For me:
% ls -l /etc/alternatives/ex
lrwxrwxrwx 1 root root 17 May 24 2020 /etc/alternatives/ex -> /usr/bin/vim.gtk3

> > I’m not so sure what to do about that. Hadn’t run into this before.
>
> I would recommend, to use ./configure --prefix=$HOME/local/
>
> to install into your local directory. Then you also do not need to use
> sudo to run make install
>
> Just make sure, to add $HOME/local/bin to your $PATH

The Makefile has a line that you can uncomment:

# Uncomment the next line to install Vim in your home directory.
#prefix = $(HOME)

No need to add "/local". Your path should include "$HOME/bin" then.

An alternative is to use "/usr/local". That should actually be the
default.

--
Hear about the guy who played a blank tape at full blast?
The mime next door went nuts.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages