Posts tagged ‘centos7’
How to properly update kernel in RHEL/CentOS 7/8 Linux
When you perform a yum update in CentOS 7 or higher , you will notice the newer kernel version is not reflected. You can use the below commands to verify the current version.
#uname -r
#hostnamectl
You can confirm whether the new kernel is installed successfully or not by using the command below;
#yum list kernel
#grep saved /boot/grub2/grubenv
In order to apply the kernel you need to restart the server.
In some instances you need to manually set the correct kernel version to boot by using the below commands;
#awk -F\’ ‘$1==”menuentry ” {print i++ ” : ” $2}’ /etc/grub2.cfg
(If you have multiple versions installed all of them will be listed with 0 , 1 & etc. In the example the newer version is 0,)
#sudo grub2-set-default 0
Source1: https://www.howtoforge.com/
Source2: https://www.golinuxcloud.com/
How to use the RHEL / CentOS Media as the Repository.
When you don’t have an active subscription with RHN , you will not be ale to install any packages via yum command. In that case the only way to overcome this situation is to use your installation CD or the binary CD you have downloaded from the RHEL website.
1.
#mount /dev/sr0 /mnt
2.Copy the media.repo
file from the root of the mounted directory to /etc/yum.repos.d/
and set the permissions to something sane,
#cp /mnt/media.repo /etc/yum.repos.d/rhel7dvd.repo
#chmod 644 /etc/yum.repos.d/rhel7dvd.repo
3.Edit the new repo file, changing the gpgcheck=0
setting to 1
and adding the following 3 lines
enabled=1
baseurl=file:///mnt/ –> Here provide the mount point you used in Step1—>
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
4.
# yum clean all
# subscription-manager clean
5. Once the above steps are completed you could begin with your familiar yum installation.
NOTE: I have not tried these steps in CentOS , but I believe it is portable and applicable.