How to downgrade vim

, ,

recently my vim always startup with errors, I know this is caused by indentLine plugin, but not know how to fix it, you can see the issue in github, because my vim config works well before, what change lately is that I update my system so vim update too, hence I want to revert vim to previous version , but failed.

sudo dnf downgrade vim-enhanced
Last metadata expiration check: 0:48:21 ago on Thu 17 Mar 2022 05:35:34 PM CST.
 Problem: problem with installed package vim-data-2:8.2.4529-1.fc35.noarch
  - package vim-data-2:8.2.4529-1.fc35.noarch conflicts with vim-common < 2:8.2.3642-2 provided by vim-common-2:8.2.3404-1.fc35.x86_64
  - package vim-enhanced-2:8.2.3404-1.fc35.x86_64 requires vim-common = 2:8.2.3404-1.fc35, but none of the providers can be installed
  - conflicting requests
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)


dnf --showduplicates list vim-data
Last metadata expiration check: 0:01:19 ago on Thu 17 Mar 2022 06:26:30 PM CST.
Installed Packages
vim-data.noarch                                                          2:8.2.4529-1.fc35                                                           @updates
Available Packages
vim-data.noarch                                                          2:8.2.4529-1.fc35  

vim-data has no downgrade package but vim-enhanced and vim-common has downgrade package. I am wondering how fedora decide a package can be dowgraded, why some can ,some not. in my situation, how to downgrade vim?

Hi, you could download previous version from After that remove current installed vim and install downloaded version.

Your error message said you should try the --allowerasing option with the downgrade command. Did you try that?

Also, as mentioned you could try removing those 3 packages then reinstall them with the specific version you want.

1 Like

Could be an issue with the cached metadata. Try running sudo dnf clean all and then try the downgrade again.

I just use sudo dnf downgrade vim-enhanced --allowerasing to downgrade vim
8.2.4579 to vim 8.2.3404, from this page, I find vim 8.2.3404 have no packages vim-data, so it seems vim-data is a new dependence for a newer vim, the conflict for vim-data not matter, after that my vim works well

To downgrade to old versions, the fedora-repos-archive package is helpful.

It defines a repo named updates-archive:

# This is a repo that contains all the old update packages from the
# Fedora updates yum repository (i.e. the packages that have made it
# to "stable"). This repo is needed for OSTree based systems where users
# may be trying to layer packages on top of a base layer that doesn't
# have the latest stable content. Since base layer content is locked
# the package layering operation will fail unless there are older versions
# of packages available.
# This repo is given a high cost in order to prefer the normal Fedora
# yum repositories, which means only packages that can't be found
# elsewhere will be downloaded from here.
name=Fedora $releasever - $basearch - Updates Archive
cost=10000 # default is 1000

Note: it is enabled by default. (In previous Fedora releases it was disabled by default.)

The benefit is that it saves you the trouble of finding an old package on koji and downloading it.

sudo dnf install fedora-repos-archive
sudo dnf list --showduplicates --all vim-enhanced
sudo dnf downgrade --allowerasing vim-enhanced-2:8.2.3404-1.fc35

Edit: Another benefit is that the package will be signed. Packages downloaded from koji are not signed.