yum and dnf both failed to update system

Issues related to applications and software problems
Post Reply
User avatar
jarkky
Posts: 3
Joined: 2019/09/29 18:26:31

yum and dnf both failed to update system

Post by jarkky » 2023/04/05 01:09:09

1.) In case of yum response is as:
# yum update
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* epel: mirror-kr.misakamikoto.network
* extras: mirror.kakao.com
* updates: mirror.elice.io
Resolving Dependencies
--> Running transaction check
---> Package chromium.x86_64 0:110.0.5481.77-1.el7 will be updated
Error: Invalid version flag: or

2.) In case of dnf response is as;
# dnf update
Traceback (most recent call last):
File "/usr/bin/dnf", line 57, in <module>
from dnf.cli import main
File "/usr/lib/python2.7/site-packages/dnf/__init__.py", line 30, in <module>
import dnf.base
File "/usr/lib/python2.7/site-packages/dnf/base.py", line 29, in <module>
import libdnf.transaction
File "/usr/lib64/python2.7/site-packages/libdnf/__init__.py", line 3, in <module>
from . import conf
File "/usr/lib64/python2.7/site-packages/libdnf/conf.py", line 17, in <module>
_conf = swig_import_helper()
File "/usr/lib64/python2.7/site-packages/libdnf/conf.py", line 16, in swig_import_helper
return importlib.import_module('_conf')
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named _conf


I could not be sure about the meaning of the output messages, but it looks like some problem with the 'python' code.
How can yum be reinstalled now, when it can not accept operating at all?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum and dnf both failed to update system

Post by TrevorH » 2023/04/05 09:50:42

https://access.redhat.com/solutions/6102331

That basically says that you've added an el8 (or maybe el9 by now) repo to your config and that breaks it.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jarkky
Posts: 3
Joined: 2019/09/29 18:26:31

Re: yum and dnf both failed to update system

Post by jarkky » 2023/04/05 11:40:28

It could be possible.
I could not read the support page completely due to limitations.
The error I got was slightly different with 'flag: or' rather than 'if' -error.
I don't know how the centos8 or centos9 could been mixed there.
Maybe when using rpm rather than yum... (???)

User avatar
jarkky
Posts: 3
Joined: 2019/09/29 18:26:31

Re: yum and dnf both failed to update system

Post by jarkky » 2023/04/27 04:53:04

TrevorH wrote:
2023/04/05 09:50:42
https://access.redhat.com/solutions/6102331

That basically says that you've added an el8 (or maybe el9 by now) repo to your config and that breaks it.
If this is the case, how can I remove the el8 or el9 repo (if it is there)?
How to check where each repo belongs?

Below repos are found in the /etc/yum.repos.d -directory:
CentOS-Base.repo
CentOS-CR.repo
CentOS-Debuginfo.repo
CentOS-fasttrack.repo
CentOS-Media.repo
CentOS-Sources.repo
CentOS-Vault.repo
CentOS-x86_64-kernel.repo
epel.repo
epel-testing.repo
skype-stable.repo
teams.repo

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: yum and dnf both failed to update system

Post by TrevorH » 2023/04/27 09:07:48

Disable them all at the command line and add them back one by one:

yum --disablerepo=\* --enablerepo=baseos update
yum --disablerepo=\* --enablerepo=baseos,appstream update

When it stops working then you found the culprit I think.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: yum and dnf both failed to update system

Post by jlehtone » 2023/04/27 15:03:20

One can list whether repo definitions are from packages:

Code: Select all

rpm -qf /etc/yum.repos.d/*.repo
The package names might reveal distro for some of them.


Side-note: the 'teams.repo' is from Microsoft, for MS Teams packages, and
MS did wipe that repo empty earlier this year. They no longer distribute
even the packages that they released earlier. All gone.

There is some different MS Teams implementation that should work with Chrome
(but not with Firefox).

Anyway, that repo can be removed. At least:

Code: Select all

dnf config-manager --disable teams

Post Reply