Saturday, April 12, 2014

Upgrading Ubuntu's kernel


Upgrading Ubuntu Quantal/Precise 64 bit kernel 3.2.0 to 3.14.0 kernel level/version

Method 1


We upgrade just the kernel version/release.

We have:
root@suricata:~/kernel-upgrade# uname -a
Linux suricata 3.2.0-60-generic #91-Ubuntu SMP Wed Feb 19 03:54:44 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
root@suricata:~/kernel-upgrade#

Make sure you have the latest updates:
 apt-get update && apt-get upgrade
 apt-get dist-upgrade

 Download the new kernel image and headers:
 wget  http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14-trusty/linux-headers-3.14.0-031400-generic_3.14.0-031400.201403310035_amd64.deb

 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14-trusty/linux-headers-3.14.0-031400_3.14.0-031400.201403310035_all.deb

 wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.14-trusty/linux-image-3.14.0-031400-generic_3.14.0-031400.201403310035_amd64.deb

 Install the packages and reboot:
 dpkg -i linux-headers-3.14.0-*.deb linux-image-3.14.0-*.deb
 reboot

 log in and update/upgrade:
 apt-get update && apt-get upgrade

 Let's see:
root@suricata:~# uname -a
Linux suricata 3.14.0-031400-generic #201403310035 SMP Mon Mar 31 04:36:23 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
root@suricata:~#

Done.


Method 2


We upgrade the whole release (including the kernel) from Precise to Trusty. This will also update the /etc/apt/ repo lists and more.

 apt-get update && apt-get upgrade
 apt-get dist-upgrade
 do-release-upgrade -d
 reboot

Done.





Sunday, April 6, 2014

Upgrading Debian Wheezy's kernel



Upgrade form Debian Wheezy 64 bit (with GDM3/xfce) 3.2.0 to 3.14.0 kernel level/version.
(
you might also want to take a look at this tutorial as well if you are interested in creating kernel.xx.xxx.deb ready for installation packages-
http://pevma.blogspot.se/2014/07/kernel-upgrade-for-debian.html
)
First we need some tools:
apt-get install gcc libncurses5-dev bc ca-certificates pkg-config make flex bison build-essential autoconf automake
Make sure everything is updated/upgraded:
 apt-get update && apt-get upgrade
 apt-get dist-upgrade
 Just to get read of some cached space:
 apt-get clean

 Download and build the kernel:
 wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.tar.xz
 tar xvfJ linux-3.14.tar.xz -C /usr/src
 cd /usr/src/linux-3.14/
 yes "" | make oldconfig


 This could take 20 min:
 make
Make and install the modules and the kernel
 make modules_install install
Verify:
root@debian64:~# ls -lh /boot
total 149M
-rw-r--r-- 1 root root 129K Apr  5 19:28 config-3.14.0
-rw-r--r-- 1 root root 127K Feb  1 20:16 config-3.2.0-4-amd64
drwxr-xr-x 3 root root  12K Apr  5 19:30 grub
-rw-r--r-- 1 root root 129M Apr  5 19:30 initrd.img-3.14.0
-rw-r--r-- 1 root root  10M Mar 11 09:26 initrd.img-3.2.0-4-amd64
-rw-r--r-- 1 root root 2.3M Apr  5 19:28 System.map-3.14.0
-rw-r--r-- 1 root root 2.1M Feb  1 20:16 System.map-3.2.0-4-amd64
-rw-r--r-- 1 root root 3.1M Apr  5 19:28 vmlinuz-3.14.0
-rw-r--r-- 1 root root 2.8M Feb  1 19:51 vmlinuz-3.2.0-4-amd64
root@debian64:~#

 your /boot/grub/grub.cfg should have a similar section (notice the new 3.14.0) :



 Make sure you have at least one non root user
 reboot


 If you want to log into the Desktop Manager as root:
 log in with the non root user.

 su root
 vim  /etc/pam.d/gdm3

 comment out (like shown)
 #auth   required    pam_succeed_if.so user != root quiet_success
 save the file

 change the root password
 passwd root
 reboot

 You can log in as root if you want to.
 Make sure you are with running the latest packages:
 apt-get update && apt-get upgrade
root@debian64:~# uname -a
Linux debian64 3.14.0 #1 SMP Sat Apr 5 19:19:46 EDT 2014 x86_64 GNU/Linux
root@debian64:~#

 Done.