Can't install gvim

I’m trying to install vim 8 and gvim on my Ubuntu laptop. Previously vim 7.4 with gvim (vim-gtk) were installed on this system. Homebrew is recommended as the method for upgrading to vim 8.

Prior to upgrading I removed the old versions of vim and gvim. Vim installs correctly and runs in the console. Gvim does not install.

I have searched the issues board and have not found a solution.

Grateful for any suggestions.

Why does it not install?

I honestly don’t know why it doesn’t install and I couldn’t find any specific directions for installing gvim.

I use the command brew install vim, and there are no errors.

system "./configure", "--prefix=#{HOMEBREW_PREFIX}",
                      "--mandir=#{man}",
                      "--enable-multibyte",
                      "--with-tlib=ncurses",
                      "--enable-cscope",
                      "--enable-terminal",
                      "--with-compiledby=Homebrew",
                      "--enable-perlinterp",
                      "--enable-rubyinterp",
                      "--enable-python3interp",
                      "--enable-gui=gtk3",
                      "--with-x",
                      "--enable-luainterp",
                      "--with-lua-prefix=#{Formula["lua"].opt_prefix}"
 system "make"

What am I missing?

Okay, what are you running to install gvim and what is the output it produces?

vim has a precompiled binary package (bottle) for Linux. See https://github.com/Homebrew/linuxbrew-core/blob/d637658d97a90e6269a55387932f8f71fffd6e99/Formula/vim.rb#L13

Consider installing Linuxbrew in /home/linuxbrew/.linuxbrew/ if possible so that you can use precompiled binary packages (known as bottles) for non-relocatable formula like util-linux.
Another possible workaround for you is brew install --force-bottle util-linux, but no promises.

If it’s an option for you, you could open a ticket with your information systems department to ask that they create a linuxbrew role account with home directory /home/linuxbrew.

The precompiled binary bottles of non-relocatable bottles can only be used if you install in /home/linuxbrew/.linuxbrew, otherwise they have to be built from source. See the documentation below. On macOS the default installation directory is /usr/local. On Linux the default installation directory is /home/linuxbrew/.linuxbrew.

I am installing into /home/linuxbrew/.linuxbrew/.

The command I used was brew install vim.
Now which vim gives me /home/linuxbrew/.linuxbrew/bin/vim. By contrast which gvim returns nothing, and in fact it is not installed.

The util-linux and vim packages are both installed and up to date. I ran the install command both with and without the --force-bottle option. There are no error messages, and homebrew informs me that the binaries were already downloaded.

Is this the way to install precompiled binary packages? Are there other options I need to pass to the install command so that gvim will be installed?

$ ls /home/linuxbrew/.linuxbrew/Cellar/vim/8.1.2100/bin 
ex  rview  rvim  vi  view  vim  vimdiff  vimtutor  xxd

Looks like vim doesn’t install gvim, as you’re seeing. I suggest reporting the issue on GitHub, or even better, if you’re able to fix the issue your self (see brew edit vim), open a PR.

This might be related: