Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"rpm -q kernel" shows what Redhat Package Manager (RPM) packages were installed named "kernel". What you see after kernel is version and architecture information. If the command only shows the two 3.x kernels it would indicate the other kernel directories you see were NOT installed with rpm.
You could run "rpm -qa |grep kernel" to see if there are other kernel rpms installed.
For any file you see you can run "rpm -qf <pathto/file>" to see what rpm installed it. For example in my /boot I have:
-rwxr-xr-x. 1 root root 5027872 Jul 22 2015 vmlinuz-3.10.0-229.11.1.el7.x86_64
-rwxr-xr-x. 1 root root 5027648 Aug 25 2015 vmlinuz-3.10.0-229.14.1.el7.x86_64
-rwxr-xr-x. 1 root root 5152928 Nov 20 2015 vmlinuz-3.10.0-327.3.1.el7.x86_64
Running the command on each of those with outputs shown:
#rpm -qf /boot/vmlinuz-3.10.0-229.11.1.el7.x86_64
kernel-3.10.0-229.11.1.el7.x86_64
It is possible to install software by installing from a tar file, configuring and making files from source or simply by copying in binaries. None of those methods will add it to the rpm database. Since RHEL7 is based on 3.x kernel I think someone was trying to install 4.x kernels manually. My guess is rpm -qf won't show you anything on the three 4.x kernels you list.
The main point in the cleanup tool is to modify your grub configuration. If someone manually installed those 4.x kernels it is possible they also manually edited the grub configuration. You'd want to undo that but you're showing you actually booted from a 4.x kernel.
Last edited by MensaWater; 07-08-2019 at 01:22 PM.
el7 suggests RHEL7 (or a derivative like CentOS7). The el7uek is suggestive. When I looked that up I found it is kernels provided by OEL (Oracle Unbreakable Linux). Either the OP has OEL or he has installed kernels built by Oracle on his RHEL7 or CentOS7 system. I haven't looked in a while but I know Oracle did provide their kernel "enhancements" for use on RHEL or CentOS. I never used their kernels on RHEL because Oracle wouldn't support it if it wasn't a full OEL install and RedHat wouldn't support it if it was a RHEL install but used a foreign kernel from Oracle.
I found other posts earlier indicating Fedora's EPEL had 4.x kernels for RHEL7/CentOS7 but RedHat doesn't support those on RHEL7. Since RHEL8 is in general release if the OP is using RHEL7 he might want to upgrade to RHEL8 to get the 4.x kernels that are officially supported by RedHat. If he is on OEL it seems he'd be able to contact Oracle support. Since CentOS7 is not a supported product one can put whatever they want on it. I don't think CentOS8 is available yet.
However, if they got them from OEL or RHEL they didn't use rpm (or yum) to install them (unless the name is more than just "kernel" followed by the dash, version and architecture - doing the rpm with grep I suggested might be informative).
What do "cat /etc/issue" and "cat /etc/redhat-release" show on the server? The output might help to determine the actual distro in use.
Last edited by MensaWater; 07-09-2019 at 08:04 AM.
[root@plsekatlastst01 boot]# cat /etc/issue
\S
Kernel \r on an \m
[root@plsekatlastst01 boot]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
Sorry, but I do not understand your statements about RHEL7 and RHEL8. How do those answer my questions?
Since you're running the 4.x kernel (version 4.1.12-124.28.1) you could probably remove the other 2 of the 3.x kernels with yum remove as well. It appears the cleanup tool only works for the kernel packages (3.x in this case) provided by RedHat and doesn't recognize those 4.x kernels possibly because of the uek in the names.
Quote:
Sorry, but I do not understand your statements about RHEL7 and RHEL8. How do those answer my questions?
They don't - I was musing on whether having foreign 4.x kernels on RHEL7 was a good idea. It essentially means RedHat won't support you. Since we don't know why you have those kernels we can't tell if you need them.
As mentioned earlier, though, RedHat doesn't support 4.x kernels on RHEL7. Are you running Oracle products on this server that require a 4.x kernel? You might want to consider moving on to RHEL8 so you have a supported platform (or even OEL7 if that uses 4.x kernel). If you're willing to give up support you might want to move to CentOS7 and add the 4.x kernel to save money on subscriptions.
Last edited by MensaWater; 07-09-2019 at 08:09 AM.
I have RHEL 7.6 machines but none are showing 4.x kernels (even when I try to do yum update).
As I noted yesterday. there is no official support for 4.x kernels in RHEL7 so one wouldn't have them on RHEL7 unless they came from somewhere else (e.g. Fedora EPEL or Oracle's site). My read yesterday only mentioned uek in relation to Oracle.
As I noted yesterday. there is no official support for 4.x kernels in RHEL7 so one wouldn't have them on RHEL7 unless they came from somewhere else (e.g. Fedora EPEL or Oracle's site). My read yesterday only mentioned uek in relation to Oracle.
Understood, I was mostly curious about where the 4.x kernels came from, and the OPs last response contains that info. Thanks for the explanation!
Thanks - "yum remove" cleaned-up the /boot, so I'm good. Apparently it was all about naming the packages as "kernel-uek" instead of just "kernel" that package-cleanup does not "see".
I had no other reasons to upgrade than that I think it is generally good to keep the OS up-to-date. I will be updating with yum and manually removing old kernels if needed, then.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.