Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update to Vim8 on Centos 7
################################################################################
# Method 1: Install using rpm packages (credit to DarkMukke)
#
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step
# make sure to at least run `yum install sudo`
yum -y remove vim-minimal vim-common vim-enhanced
yum -y --enablerepo=gf-plus install vim-enhanced sudo
# This script will stop here if you run this gist from the command line by
# curling to the **raw** gist: `bash <(curl -s https://gist.githubuser......)`
exit
################################################################################
# Method 2: Install by building from scratch - contains a lot ot dependancies
#
# Setup essential build environment
yum -y groupinstall "Development Tools"
yum -y install ncurses-devel git-core
# Get source
git clone https://github.com/vim/vim && cd vim
# OPTIONAL: configure to provide a comprehensive vim - You can skip this step
# and go straight to `make` which will configure, compile and link with
# defaults.
./configure --prefix=/usr --with-features=huge --enable-multibyte --with-python-config-dir=/usr/lib/python2.7/config --enable-pythoninterp=yes
# Build and install
make && sudo make install
################################################################################
# Final Check
#
# After installation check your setup with
vim --version
# You should see...
# VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Aug 2 2017 16:29:21)
# Included patches: 1-839
@liuliqiang

This comment has been minimized.

@bilalabdu

This comment has been minimized.

Copy link

bilalabdu commented Sep 3, 2018

Getting below error

[XXX~]# sudo yum update vim*
Loaded plugins: fastestmirror

File contains no section headers.
file: file:///etc/yum.repos.d/mcepl-vim8-epel-7.repo, line: 2
'<!doctype html>\n'
[XXX~]#

@ling32945

This comment has been minimized.

Copy link

ling32945 commented Sep 5, 2018

this yum resource has been removed

@SirStephanikus

This comment has been minimized.

Copy link

SirStephanikus commented Sep 10, 2018

Junk !
No repo found there.

@DarkMukke

This comment has been minimized.

Copy link

DarkMukke commented Sep 12, 2018

Not junk, this was the right solution until last week (used this for like half a year)

@DarkMukke

This comment has been minimized.

@DarkMukke

This comment has been minimized.

Copy link

DarkMukke commented Sep 12, 2018

So new install notes

rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
yum -y remove vim-minimal vim-common vim-enhanced sudo
yum -y --enablerepo=gf-plus install vim-enhanced sudo
@lmontigny

This comment has been minimized.

Copy link

lmontigny commented Sep 17, 2018

So new install notes

rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
yum -y remove vim-minimal vim-common vim-enhanced sudo
yum -y --enablerepo=gf-plus install vim-enhanced sudo

Hmm if you do that you are actually removing sudo on the 3rd line?!

I have the following issue:
Transaction check error:
file /usr/share/man/man1/vim.1.gz from install of vim-common-2:8.0.003-1.gf.el7.x86_64 conflicts with file from package vim-minimal-2:7.4.160-4.el7.x86_64

Error Summary

@lmontigny

This comment has been minimized.

Copy link

lmontigny commented Sep 17, 2018

I got it working by hand if it helps:
wget http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64/vim-enhanced-8.0.003-1.gf.el7.x86_64.rpm
wget http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64/vim-common-8.0.003-1.gf.el7.x86_64.rpm
wget http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64/vim-minimal-8.0.003-1.gf.el7.x86_64.rpm
sudo rpm -Uvh vim-minimal-8.0.003-1.gf.el7.x86_64.rpm
sudo rpm -Uvh vim-common-8.0.003-1.gf.el7.x86_64.rpm
sudo rpm -Uvh vim-enhanced-8.0.003-1.gf.el7.x86_64.rpm

@zhouyanlt

This comment has been minimized.

Copy link

zhouyanlt commented Sep 23, 2018

Just compile and install:

git clone https://github.com/vim/vim.git
cd vim
#make distclean  # if you build Vim before
make -j8
sudo make install
cp src/vim /usr/bin
@DarkMukke

This comment has been minimized.

Copy link

DarkMukke commented Sep 29, 2018

So new install notes

rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
yum -y remove vim-minimal vim-common vim-enhanced sudo
yum -y --enablerepo=gf-plus install vim-enhanced sudo

Hmm if you do that you are actually removing sudo on the 3rd line?!

I have the following issue:
Transaction check error:
file /usr/share/man/man1/vim.1.gz from install of vim-common-2:8.0.003-1.gf.el7.x86_64 conflicts with file from package vim-minimal-2:7.4.160-4.el7.x86_64

Error Summary

if you don't remove sudo you can't uninstall vim-minimal, as it is a dependency, that is what the conflict is about
don't worry as long as you don't close your session or are able to login as root, you don't actually need sudo, and you reinstall it with the upgraded vim, the line after

@ArmyCAC

This comment has been minimized.

Copy link

ArmyCAC commented Nov 19, 2018

Getting below error

[XXX~]# sudo yum update vim*
Loaded plugins: fastestmirror

File contains no section headers.
file: file:///etc/yum.repos.d/mcepl-vim8-epel-7.repo, line: 2
'<!doctype html>\n'
[XXX~]#

how to fix?

@42tg

This comment has been minimized.

Copy link

42tg commented Nov 22, 2018

how to fix?

remove the /etc/yum.repos.d/mcepl-vim8-epel-7.repo by hand and execute the steps from @DarkMukke

rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
yum -y remove vim-minimal vim-common vim-enhanced sudo
yum -y --enablerepo=gf-plus install vim-enhanced sudo

@xkdcc

This comment has been minimized.

Copy link

xkdcc commented Nov 27, 2018

Environment:

[root@localhost ~]# cat /etc/centos-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]#

After applying:

rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
yum -y remove vim-minimal vim-common vim-enhanced sudo
yum -y --enablerepo=gf-plus install vim-enhanced sudo

I found it left vim-filesystem on 7:

[root@localhost ~]# rpm -qa |grep vim
vim-filesystem-7.4.160-4.el7.x86_64
vim-minimal-8.0.003-1.gf.el7.x86_64
vim-enhanced-8.0.003-1.gf.el7.x86_64
vim-common-8.0.003-1.gf.el7.x86_64

So I suggest to append vim-filesystem into @DarkMukke's solution.

@boz14676

This comment has been minimized.

Copy link

boz14676 commented May 22, 2019

Getting below error

[XXX~]# sudo yum update vim*
Loaded plugins: fastestmirror

File contains no section headers.
file: file:///etc/yum.repos.d/mcepl-vim8-epel-7.repo, line: 2
'<!doctype html>\n'
[XXX~]#

some issue as well.

@dmakushin

This comment has been minimized.

Copy link

dmakushin commented May 31, 2019

So new install notes

rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
yum -y remove vim-minimal vim-common vim-enhanced sudo
yum -y --enablerepo=gf-plus install vim-enhanced sudo

Notice that you must perform this instructions sequentially under sudo su or as a single bash script.
Otherwise, you would occasionally uninstall sudo.

@kiril1976

This comment has been minimized.

Copy link

kiril1976 commented Jun 4, 2019

rm /etc/yum.repos.d/mcepl-vim8-epel-7.repo

@yevrah

This comment has been minimized.

Copy link
Owner Author

yevrah commented Jun 5, 2019

Thanks everyone for the discovery and feedback - I have added an update to the gist to fix the issue that the old repository listing is no longer available.

Notable mention goes to @dmakushin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.