Posts

Add old repositories on an Amazon Linux instance



This document is for an older version of the kernel installed.


Overview


OS: Amazon Linux AMI release 2016.09

Old kernel: kernel-4.4.35-33.55.amzn1.x86_64

New kernel : kernel-4.4.51-40.67.amzn1.x86_64


First, let's try to install by specifying the version with yum install.

[root@ip-xx-xx-xx-xx ~]# yum install kernel-4.4.51-40.67.amzn1.x86_64
Loaded plugins: priorities, update-motd, upgrade-helper
No package kernel-4.4.51-40.67.amzn1.x86_64 available.
Error: Nothing to do

Problem

This verification did not work.

This is because the package we wanted to install does not exist because it is referenced to the latest version in the Amazon repository.


The latest kernel version is 5.10.102-99.473.amzn2.x86_64 (2022-04-29)


Troubleshooting


There is a setting item called "releasever" in the yum configuration, which determines the repository to be referenced.


The default setting is ”latest” so that must be changed.

[root@ip-xx-xx-xx-xx ~]# vim /etc/yum.conf
releasever=latest
↓
releasever=2016.09

Change the above settings and re-execute the yum that failed earlier.

[root@ip-xx-xx-xx-xx ~]# yum install kernel-4.4.51-40.67.amzn1.x86_64
.
.
.
Installed:
 kernel.x86_64 0:4.4.51-40.67.amzn1
 
Complete!

After restarting the server, check the kernel information.

[root@ip-xx-xx-xx-xx ~]# uname -r
 
4.4.51-40.67.amzn1.x86_64

The specified kernel has been installed.

Incidentally, the above method is also described in the AWS documentation.

In this way, if you want to install an older version, you can do so flexibly.


This blog post is translated from a blog post written on our Japanese website

Beyond Co..


8 views