I will not give explanations of why or what will be installed, if you plan to upgrade to kernel 4.0 is because you know what you want, otherwise you wear not experience, it is clear that this installing on Ubuntu 15.04 Vivid Verted, so get to work! (applies to 64-bit systems) in the case of Ubuntu 32 Bits https://wiki.ubuntu.com/Kernel/MainlineBuilds#Installing_upstream_kernels
mkdir kernel4
cd kernel4
wget wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0.1-vivid/linux-headers-4.0.1-040001_4.0.1-040001.201504290935_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0.1-vivid/linux-headers-4.0.1-040001-generic_4.0.1-040001.201504290935_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.0.1-vivid/linux-image-4.0.1-040001-generic_4.0.1-040001.201504290935_amd64.deb
sudo apt-get update && sudo apt-get dist-upgrade
sudo dpkg -i *.deb
When this process is complete you should have a new entry in the boot menu representing the new kernel. This will appear as an entry like this:
Ubuntu Vivid, kernel 4.0.1-040001-generic
The headers-<kernelname>_<architecture>.deb and headers-<kernelname>_all.deb packages allow one to build external modules.
:~$ uname -a
Linux Acer 4.0.1-040001-generic #201504290935 SMP Wed Apr 29 09:36:55 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux