I want to use the old repository on Amazon Linux

table of contents
This is Sashihara from the System Solutions Department
These are notes from when I installed a slightly older version of the kernel on an Amazon Linux instance on AWS EC2 for verification purposes
overview
OS : Amazon Linux AMI release 2016.09
Old kernel : kernel-4.4.35-33.55.amzn1.x86_64
The kernel I want to install : kernel-4.4.51-40.67.amzn1.x86_64
Problems
I thought I could install it by specifying the version with yum install, but it didn't work
[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
The reason is that the latest version was referenced from Amazon's repository, and the relevant package did not exist
By the way, as of August 2, 2017, the latest kernel is 4.9.38-16.33.amzn1.x86_64
How to respond
The yum settings have a setting called releasever, which determines the repository to reference
By default it is set to latest, so change that
[root@ip-xx-xx-xx-xx ~]# vim /etc/yum.conf releasever=latest ↓ releasever=2016.09
Then run the yum command 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 was installed without any problems
The above method is also described in the AWS documentation
* Comment out the corresponding lines for the listed actions
This gives you the flexibility to install older versions if you want
That's all
0