In some cases, you got an error occurs when executing the Linux command on CentOS 8.
# dnf update epel-release
Repository epel is listed more than once in the configuration
Last metadata expiration check: 2:24:16 ago on Mon 25 Apr 2022 07:27:51 AM CST.
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Dependencies resolved.
Nothing to do.
Complete!
To fix it, you need to disable the best option in the /etc/dnf/dnf.conf and /etc/yum.conf by changing it from True to False.
# cat /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
# cat /etc/yum.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
skip_if_unavailable=False
You can use any text editor to open these files then change that option. Alternatively, let’s simple run the following commands to change it automatically.
sudo sed -i 's/best=True/best=False/g' /etc/yum.conf
sudo sed -i 's/best=True/best=False/g' /etc/dnf/dnf.conf
# cat /etc/yum.conf | grep best
best=False
# cat /etc/dnf/dnf.conf | grep best
best=False
ADVERTISEMENT
5/5 - (1 vote)