How to switch to stable Yum repo?

My target OS is Amazon Linux 2, which uses Yum. For some reason, the /redhat-stable Yum repo URL stopped working a while back, so we have been on weekly builds with just the /redhat URL. This has not caused any problems so far, but it is worrisome to be on the bleeding edge in production. Here is what I’ve tried.

Following the RedHat/CentOS instructions on a machine with Jenkins already present, I run the following.

sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Next, I attempt to update Jenkins via

sudo yum update jenkins -y

From here, I get the following error output.

jenkins-2.332-1.1.noarch.rpm   FAILED                                          
http://pkg.jenkins.io/redhat-stable/jenkins-2.332-1.1.noarch.rpm: [Errno 14] HTTPS Error 404

Error downloading packages:
  jenkins-2.332-1.1.noarch: [Errno 256] No more mirrors to try.

I can’t imagine this URL being broken for everyone, because otherwise, I’d think it’d have been fixed by now. How can I successfully get us from /redhat to /redhat-stable ?

so according to LTS Changelog, the latest version is 2.319.3 so I’m not sure why your system is trying to install 2.332 (which is a weekly, 2 decimal is weekly, 3 is stable)

Do you maybe have the old weekly repo still installed? Maybe you need to clean some headers

The Reddit post is from a while ago. Good pointer on the numbering. All I’ve done to switch repos is modify the URL in /etc/yum.repos.d/jenkins.repo, then try to update. Is there a proper procedure to switch URLs? Like should I change the URL and run yum clean all before updating or similar?

Feel free to link it back it you want, I wanted to avoid people having to click multiple times to try and help.

I don’t use Yum myself, I tend to use docker, so you’ve hit my limit of knowledge. I think you can yum info Jenkins and see which repo it’s coming from. I think the key is to make sure the old repo is no longer in /etc/yum/repos.d (or whatever the dir is)

Find and fix whatever problem is causing that issue. It could be an outdated certificates package. It could be other issues.

We regularly install from the redhat-stable package to an Almalinux image and we test weekly package installers on many different Linux variants, including Amazon Linux 2.