Q. How do I list all installed kernel on Linux operating system? How do I find out current kernel version?
A. You can use standard package listing command to list installed kernels.
RedHat / CentOS / RHEL / Fedora Linux user
You need to use standard rpm command to list installed software. Type the following command at shell prompt:
$ rpm -qa kernel
To list / display current kernel
Type the following command:
$ uname -r
$ uname -mrs
Linux 2.6.18-8.1.14.el5 x86_64
Debian / Ubuntu Linux user
Use dpkg command to list all installed kernel, enter:
$ dpkg --list | grep linux-image
ii linux-image-2.6.20-15-generic 2.6.20-15.27 Linux kernel image for version 2.6.20 on x86/
ii linux-image-2.6.20-16-generic 2.6.20-16.32 Linux kernel image for version 2.6.20 on x86/
ii linux-image-generic 220.127.116.11.28.1 Generic Linux kernel image
need to provide a remote access to my Ubuntu Linux based server. How do I start / stop OR restart the ssh server under Ubuntu Linux operating system using command line options?
Q. How do I install Linux kernel source code and headers under RHEL 5 or CentOS 5 Linux operating system?
A. Both CentOS and RHEL 5 includes following packages:
a) Kernel-headers : It includes the C header files that specify the interface between the Linux kernel and userspace libraries and programs. The header files define structures and constants that are needed for building most standard programs and are also needed for rebuilding the glibc package.
b) kernel-devel : This package provides kernel headers and makefiles sufficient to build modules against the kernel package.
c) Actual kernel source code : You can always download actual source code here. Look for kernel*.rpm file.
Rhel / CentOS 5 install kernel headers
Use yum command as follows:
# yum install kernel-devel Kernel-headers
Install kernel source code
Type the command as follows:
# cd /tmp
# wget ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/kernel-2.6.18-8.1.8.el5.src.rpm
# rpm -ivh kernel-2.6.18-8.1.8.el5.src.rpm
Note change version number as per your current kernel.
For recompiling or adding a new module or device driver you just need kernel-devel and Kernel-headers packages. To rebuilt kernel rpm goto /usr/src/redhat/SPECS directory, modify kernel spec file and use rpmbuild command to rebuild rhel/centos kernel rpm.
Q. How do I backup files and database for the Red Hat Enterprise Linux / CentOS Linux? Currently Iâ€™ve MySQL server running on CentOS 5 and Web server and file server using RHEL 5. How do I backup all these servers?
A. Regular backup is an essential for Linux system. You can take backup on
=> NAS Server
=> Network server etc
Implementing a backup policy that includes rotating backup media and keeping copies of backup media offsite is the most reliable way of minimizing damage. See following resources on our site for more information including commands and shell scripts:
- Perform backups for the Linux operating system
- How to backup MySQL databases, web server files to a FTP server automatically
- Howto Backup PostgreSQL Databases
- All backup shell scripts