Multiple Problems while installing VMware Player with Kernel Headers

Sorry, pretty long problem

First some background: I was running Ubuntu 13.10 x64 in my laptop. I just upgraded to 14.04 few weeks back. The output of the uname -a currently on my system are

Linux ubuntu 3.11.0-19-generic #33-Ubuntu SMP Tue Mar 11 18:48:34 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Now, I downloaded the VMware-Player-6.0.2-1744117.x86_64.bundle and tried to install it on my Laptop running Ubuntu 14.04 x64. I installed VMWare-Player bundle usual way via

sudo sh VMware-Player-6.0.2-1744117.x86_64.bundle

After that, I tried to run the VMWare Player by searching through the search dock and clicking on its icon. I get this window Kernel Headers not found

I googled the problem and found many people had faced such similar problem but with many different solutions. Unfortunately, none worked for me.

One was to install the header via this command

sudo apt-get install build-essential linux-headers-$(uname -r)

I tried it and got the following output

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package linux-headers-3.11.0-19-generic is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'linux-headers-3.11.0-19-generic' has no installation candidate

This was scary.

Then I tried to another solution

sudo vmware-modconfig --console --install-all

again for no luck. Failed to setup build environment.

Then I tried this solution I was totally confused then because the terminal showed, the path /lib/modules/$(uname -r)/build/include/linux i.e.
/lib/modules/3.11.0-19-generic/build/include/linux didn't exists!

Then I executed the following commands to clear my doubt:

$ cd /lib/modules
$:/lib/modules$ ls
3.11.0-19-generic  3.13.0-24-generic
$:/lib/modules$ ls 3.11.0-19-generic 3.13.0-24-generic
3.11.0-19-generic:
initrd  modules.alias      modules.builtin      modules.dep      modules.devname  modules.softdep  modules.symbols.bin
kernel  modules.alias.bin  modules.builtin.bin  modules.dep.bin  modules.order    modules.symbols  updates

3.13.0-24-generic:
build

I am totally confused about whats wrong with my system and what should I do now? Thanks!


Solution 1:

The installed kernel was obsolete. Its headers is not any more in the repository. So the best thing to do is to update the kernel to last version in the repository.

To enable auto update for the kernel, install linux-generic which is a meta package to keep current version of the kernel & its headers:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install linux-generic

For some reason this meta wasn't installed while upgrade for you. If it didn't work, then use Synaptic to install its headers or upgrade/install to the last kernel release (search for "linux").