1. Install dependencies

    sudo apt-get install git build-essential kernel-package fakeroot libncurses5-dev libfile-fcntllock-perl
    
  2. Compilation

    cd linux-4.2.0
    git checkout v4.2
    cp /boot/config-`uname -r` .config    
    make oldconfig (actually I used "make localmodconfig")
    make clean (only used when there is a problem or first time compile)
    make -j `getconf _NPROCESSORS_ONLN` deb-pkg LOCALVERSION=-custom
    cd ..
    
  3. Installation

    dpkg -i *.deb
    
    • If there are some strange problems, try
      • apt-get install bc
      • make clean; make mrproper (this actually clean everything exception source code and you need to re-compile the whole kernel)
  4. Reboot
    • reboot new kernel
    # /etc/grub/grub
    ...
    GRUB_DEFAULT="1>2"
    # 0 -> default
    # 1 -> submenu 'Advanced options for ...'  # /boot/grub/grub.cfg
    #    0 -> first submenu
    #    1 -> second submenu
    #    ...
    
    sudo update-grub
    
    or 
    # sudo grub-set-default ...
    # sudo grub-reboot ...
    ...
    
  5. How to remove old kernels in Debian and Ubuntu