Problem with yum/dnf after installing "Development Tools"
Problem with yum/dnf after installing "Development Tools"
Hi all,
So here's the thing: I have a perfectly running CentOS 8 installation on my computer.
I have been able to install hundreds of packages, both from the terminal and through the software manager GUI.
I just installed "Development Tools" using the command dnf groupinstall "Development Tools" (>100 packages were installed).
Right after executing that command I tried installing something else, but now it seems that I can't install anything, as I'm getting the error:
"Failed to synchronize cache for repo 'AppStream'"
I can't update neither (sudo dnf/yum update gives the same error)
I tried looking for a solution, but nothing I found on the forum fixes the problem:
I tried commenting mirrorlist and uncomment baseurl in the repo files, but still the same.
I tried clearing the cache (dnf -v clean all, rm -r /var/cache/dnf...), but same.
I tried to temporarily remove the AppStream repo, but all of them give me the same error (it just happens that AppStream is the first, and then yum stops there).
The network is working fine on the terminal, as I can ping and I receive the response.
I don't know whether installing "Development Tools" did something, or it is only a coincidence, but I'm running out of ideas.
Any suggestion?
Many thanks!
So here's the thing: I have a perfectly running CentOS 8 installation on my computer.
I have been able to install hundreds of packages, both from the terminal and through the software manager GUI.
I just installed "Development Tools" using the command dnf groupinstall "Development Tools" (>100 packages were installed).
Right after executing that command I tried installing something else, but now it seems that I can't install anything, as I'm getting the error:
"Failed to synchronize cache for repo 'AppStream'"
I can't update neither (sudo dnf/yum update gives the same error)
I tried looking for a solution, but nothing I found on the forum fixes the problem:
I tried commenting mirrorlist and uncomment baseurl in the repo files, but still the same.
I tried clearing the cache (dnf -v clean all, rm -r /var/cache/dnf...), but same.
I tried to temporarily remove the AppStream repo, but all of them give me the same error (it just happens that AppStream is the first, and then yum stops there).
The network is working fine on the terminal, as I can ping and I receive the response.
I don't know whether installing "Development Tools" did something, or it is only a coincidence, but I'm running out of ideas.
Any suggestion?
Many thanks!
Re: Problem with yum/dnf after installing "Development Tools"
My suggestion would be to try running dnf in verbose mode:
It won't fix the breakage, but additional info in the output may give you hints about what actually went wrong.
Code: Select all
dnf -v --refresh upgrade
Re: Problem with yum/dnf after installing "Development Tools"
Hi,
Thanks for your reply!
Here's the output:
I can't curl that URL neither (nor access it through the browser, but I don't know if I'm supposed to be able -- longtime user of Arch, but new to CentOS)
Invalid release/repo/arch combination
Same with baseurl instead of mirrorlist
Thanks for your reply!
Here's the output:
Code: Select all
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.0.9
cachedir: /var/cache/dnf
Unknown configuration option: autorefresh = 1 in /etc/yum.repos.d/elasticsearch.repo
Unknown configuration option: protect = 0 in /etc/yum.repos.d/nux-dextop.repo
Unknown configuration option: protect = 0 in /etc/yum.repos.d/nux-dextop.repo
repo: downloading from remote: AppStream
CentOS-8.0 - AppStream 33 B/s | 38 B 00:01
Cannot download 'http://mirrorlist.centos.org/?release=8.0&arch=x86_64&repo=AppStream&infra=stock': Cannot prepare internal mirrorlist: No URLs in mirrorlist.
Error: Failed to synchronize cache for repo 'AppStream'
Invalid release/repo/arch combination
Same with baseurl instead of mirrorlist
Code: Select all
Loaded plugins: builddep, changelog, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repodiff, repograph, repomanage, reposync
DNF version: 4.0.9
cachedir: /var/cache/dnf
Unknown configuration option: autorefresh = 1 in /etc/yum.repos.d/elasticsearch.repo
Unknown configuration option: protect = 0 in /etc/yum.repos.d/nux-dextop.repo
Unknown configuration option: protect = 0 in /etc/yum.repos.d/nux-dextop.repo
repo: downloading from remote: AppStream
CentOS-8.0 - AppStream 6.6 kB/s | 7.6 kB 00:01
Cannot download 'http://mirror.centos.org/centos/8.0/AppStream/x86_64/os/': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.
Error: Failed to synchronize cache for repo 'AppStream'
Re: Problem with yum/dnf after installing "Development Tools"
Well, I kind of found a workaround.
The problem comes from the variable 'releasever' in the repo files, as it resolves in 8.0 (for centOS 8)
As a result, yum tries to update from http://mirrorlist.centos.org/?release=8 ... a=stock%27
but this url doesn't exist
However, http://mirrorlist.centos.org/?release=8 ... a=stock%27 does exist (note the 8 instead of 8.0)
So, after looking where is the releasever variable specified, i could solve it by adding a new file:
And now everything works
The problem comes from the variable 'releasever' in the repo files, as it resolves in 8.0 (for centOS 8)
As a result, yum tries to update from http://mirrorlist.centos.org/?release=8 ... a=stock%27
but this url doesn't exist
However, http://mirrorlist.centos.org/?release=8 ... a=stock%27 does exist (note the 8 instead of 8.0)
So, after looking where is the releasever variable specified, i could solve it by adding a new file:
Code: Select all
sudo bash -c "echo 8 > /etc/yum/vars/releasever"
Re: Problem with yum/dnf after installing "Development Tools"
Fascinating. Any clues why installing the development tools changes the releasever? I could't find any files under /etc that had "releasever" or "8.0" (that weren't certs or binary files) so I'm curious how the dev tools could have changed the value for the releasever (I am not all that savvy with CentOS so that doesn't help much).
But anyway, thanks for finding how to address this.
But anyway, thanks for finding how to address this.
Re: Problem with yum/dnf after installing "Development Tools"
I don't believe that installing "Development tools" has anything to do with this. This is a known problem in the original 8.0 version of yum/dnf/rpm and the correct solution currently is to run yum --releasever=8 update yum\* dnf\* rpm\* first and then it just works correctly afterwards.
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
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
Re: Problem with yum/dnf after installing "Development Tools"
TrevorH,
I'm executing yum --releasever=8 update yum\* dnf\* rpm\*, and got the following :
I'm executing yum --releasever=8 update yum\* dnf\* rpm\*, and got the following :
Code: Select all
Traceback (most recent call last):
File "/usr/bin/yum", line 58, in <module>
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 193, in user_main
errcode = main(args)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main
return cli_run(cli, base)
File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run
cli.run()
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1124, in run
self._process_demands()
File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 828, in _process_demands
load_available_repos=self.demands.available_repos)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 400, in fill_sack
self._add_repo_to_sack(r)
File "/usr/lib/python3.6/site-packages/dnf/base.py", line 137, in _add_repo_to_sack
repo._repo.initHyRepo(hrepo)
File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 359, in <lambda>
__getattr__ = lambda self, name: _swig_getattr(self, Repo, name)
File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 80, in _swig_getattr
raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
AttributeError: 'Repo' object has no attribute 'initHyRepo'
Re: Problem with yum/dnf after installing "Development Tools"
Try globbing dnf and rpm on both sides plus updating python3-hawkey:
Code: Select all
yum --releasever=8 update yum\* \*dnf\* \*rpm\* python3-hawkey
-
- Posts: 1
- Joined: 2020/04/08 13:12:19
Re: Problem with yum/dnf after installing "Development Tools"
Python3 calls and consequently dnf/yum scripts have changed after dec 2019, so if you are trying to update now a CentOS8 system with last update done before that date, you could get issues (like yours, for instance) ...
Try to do this way:
Regards,
Gabo
Try to do this way:
- Become root (with root access, or by 'sudo -i'), so you can avoid to prefix 'sudo' on any command.
- create a temp dir and cd into:
Code: Select all
mkdir ~/tmp && cd ~/tmp
- manually download from repos all involved packages need for dependencies in the same dnf+yum+python3 process:
Code: Select all
wget http://centos.mirror.garr.it/centos/8.1.1911/BaseOS/x86_64/os/Packages/dnf-4.2.7-7.el8_1.noarch.rpm wget http://centos.mirror.garr.it/centos/8.1.1911/BaseOS/x86_64/os/Packages/dnf-plugins-core-4.0.8-3.el8.noarch.rpm wget http://centos.mirror.garr.it/centos/8.1.1911/BaseOS/x86_64/os/Packages/python3-dnf-4.2.7-7.el8_1.noarch.rpm wget http://centos.mirror.garr.it/centos/8.1.1911/BaseOS/x86_64/os/Packages/python3-dnf-plugins-core-4.0.8-3.el8.noarch.rpm wget http://centos.mirror.garr.it/centos/8.1.1911/BaseOS/x86_64/os/Packages/yum-4.2.7-7.el8_1.noarch.rpm
- upgrade all downloaded packages via rpm command:
Code: Select all
rpm -Uvh *
- now clean all dnf cache:
Code: Select all
dnf clean all
- now you can upgrade, with --skip-broken to skip broken dependencies: If last command still gets you some dependencies error, try to use --nobest parameter:
Code: Select all
dnf update --skip-broken
Code: Select all
dnf update --nobest
- wait for system upgrade.
- ...
- Reboot.
- Try to repeat a new upgrade
Regards,
Gabo
javajox wrote: ↑2020/02/08 13:01:51TrevorH,
I'm executing yum --releasever=8 update yum\* dnf\* rpm\*, and got the following :
Code: Select all
Traceback (most recent call last): File "/usr/bin/yum", line 58, in <module> main.user_main(sys.argv[1:], exit_code=True) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 193, in user_main errcode = main(args) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 64, in main return _main(base, args, cli_class, option_parser_class) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 99, in _main return cli_run(cli, base) File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run cli.run() File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1124, in run self._process_demands() File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 828, in _process_demands load_available_repos=self.demands.available_repos) File "/usr/lib/python3.6/site-packages/dnf/base.py", line 400, in fill_sack self._add_repo_to_sack(r) File "/usr/lib/python3.6/site-packages/dnf/base.py", line 137, in _add_repo_to_sack repo._repo.initHyRepo(hrepo) File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 359, in <lambda> __getattr__ = lambda self, name: _swig_getattr(self, Repo, name) File "/usr/lib64/python3.6/site-packages/libdnf/repo.py", line 80, in _swig_getattr raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name)) AttributeError: 'Repo' object has no attribute 'initHyRepo'