Last active
September 15, 2025 16:05
-
-
Save danpawlik/6aea14a359fffe179469439cb85da996 to your computer and use it in GitHub Desktop.
Replace sometimes broken metalink with baseurl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried | |
| # on Centos 9 stream, just do: | |
| sudo sed -i 's@metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http@baseurl=http://mirror.stream.centos.org/9-stream/BaseOS/$basearch/os/@g' /etc/yum.repos.d/centos.repo | |
| sudo sed -i 's@metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http@baseurl=http://mirror.stream.centos.org/9-stream/AppStream/$basearch/os/@g' /etc/yum.repos.d/centos.repo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment