Mastodon

Fixing repo issue with CentOS Stream 8 Docker container

Until CentoOS rolls out official CentOS Stream 9 docker container, if you create use centos:latest as tag then you will end up getting centos stream 8 container.

This container as broken repo info and therefore when you perform dnf update or yum update, it gives an error. Below commands fixes the broken repo links –

sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
dnf update -y

This fixes and broken repo links and makes updates or installation of new packages possible.