I want to use old repositories on Amazon Linux
This is Sashihara from the System Solutions Department.
For verification purposes, this is a memo from when I installed a slightly older version of the kernel on an Amazon Linux instance on AWS EC2.
overview
OS : Amazon Linux AMI release 2016.09
Old kernel : kernel-4.4.35-33.55.amzn1.x86_64
Kernel you want to put in : kernel-4.4.51-40.67.amzn1.x86_64
Trouble
I thought I could install it by specifying the version with yum install, but that 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 was that the corresponding package did not exist because I was referring to the latest version in Amazon's repository.
By the way, the latest kernel as of August 2, 2017 is 4.9.38-16.33.amzn1.x86_64.
How to deal with it
There is a setting item called releasever in the yum settings, which determines the repository to refer to.
The default is latest, so change that.
[root@ip-xx-xx-xx-xx ~]# vim /etc/yum.conf releasever=latest ↓ releasever=2016.09
Then execute yum, which 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.
By the way, the above method is also described in the AWS documentation
*For the listed responses, comment out the relevant line.
This gives you flexibility if you want to install an older version.
That's it.