By default, the version of vim on centos7 is 7.4. I want to update it to vim 8. There are some questions with 'https://copr.fedorainfracloud.org/coprs/mcepl/vim8/repo/epel-7/mcepl-vim8-epel-7.repo -o /etc/yum.repos.d/mcepl-vim8-epel-7.repo'. So, how can I to update it?
That repo is no longer available. Instead, use this (source: https://gist.github.com/yevrah/21cdccc1dc65efd2a4712781815159fb)
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 yum -y --enablerepo=gf-plus install vim-enhanced sudo
otter.pro's answer is helpful but be aware that it will remove sudo with
vim-minimal in the yum remove step because sudo depends upon vim-minimal. If running as root, no problem. But if you're running with sudo, you can find yourself stuck without root access anymore after sudo gets removed.
I followed his steps, but used
rpm to do a targeted removal of just vim-minimal so that sudo would not be removed in the process (thanks to a tip from https://superuser.com/a/1307216):
sudo rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm sudo rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7 sudo yum -y remove vim-common vim-enhanced vim-filesystem # Don't 'yum remove' vim-minimal because that will remove sudo: sudo rpm -e --nodeps vim-minimal sudo yum -y --enablerepo=gf-plus install vim-enhanced