My OS is RHEL 7.2
(minimal installation
version). To use some new kernel features (such as BPF
), I need to upgrade kernel to 4.x
.
(1) Register the system and apply a subscription:
# subscription-manager register --username <username> --password <password> --auto-attach
(2) Use yum install
to install the following software packages:
openssl-devel
ncurses-devel
bc
gcc
perl
BTW, when executing yum install perl
, it prompts errors, so I download the source code from perl official website, and build it form scratch:
./configure.gnu
make
make test
make install
(3) Download the stable kernel from kernel.org and extract it, then build it:
make menuconfig
make
make modules_install install
According to your requirement, maybe installing the header files is also need:
make INSTALL_HDR_PATH=/usr/local headers_install
(4) Reboot system, and select right kernel on boot time, enjoy it:
# uname -a
Linux localhost.localdomain 4.5.0 #1 SMP Mon Apr 11 09:56:46 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux
Support for a Berkeley Packet Filter (BPF) based traffic classifier has been added to Red Hat Enterprise Linux 7.1. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/7.1_release_notes/index