First install dependencies
sudo apt-get install mercurial python python-dev python3 python3-dev ruby ruby-dev libx11-dev libxt-dev libgtk2.0-dev libncurses5 ncurses-dev
Go to vim website download vim-8.1.tar.bz2
Uncompress tarball runing:
cd Downloads
tar xjf vim-8.1.tar.bz2
cd vim81
nano configure
Copy, paste and save these commands
--enable-perlinterp \
--enable-pythoninterp \
--enable-rubyinterp \
--enable-cscope \
--enable-gui=auto \
--enable-gtk2-check \
--enable-gnome-check \
--with-features=huge \
--enable-multibyte \
--with-x \
Run
./configure
Next run
make
sudo make install
Now it's sucessfully installed on your Ubuntu
To uninstall run
sudo make uninstall
For more details check site where I copied from.