Tente isto:
sudo apt-get install linux-headers-$(uname -r)
Eu corri dist-upgrade e acabei com esse erro:
Erro! Seus cabeçalhos de kernel para o kernel 3.5.0-25 genérico não podem ser encontrados.
Por favor, instale o pacote linux-headers-3.5.0-25-genérico,
ou use a opção --kernelsourcedir para informar ao DKMS onde ele está localizado
run-parts: executando o /etc/kernel/postinst.d/initramfs-tools 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic '
Eu tenho estes instalados dkms xserver-xorg xserver-xorg-core
Eu tentei estas perguntas
Não é possível instalar VirtualBox no Ubuntu 12.10: cabeçalhos de kernel não podem ser encontrados e
Erro: cabeçalhos do kernel não encontrados. (Mas eles estão no lugar) Mas não ajudou muito
Aqui está a saída abaixo:
suhaib@suhaib-sda8:~$ sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following NEW packages will be installed:
linux-image-3.5.0-25-generic linux-image-extra-3.5.0-25-generic
The following packages will be upgraded:
linux-image-generic
1 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 39.6 MB of archives.
After this operation, 153 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://ca.archive.ubuntu.com/ubuntu/ quantal-updates/main linux-image-3.5.0-25-generic amd64 3.5.0-25.39 [11.9 MB]
Get:2 http://ca.archive.ubuntu.com/ubuntu/ quantal-updates/main linux-image-extra-3.5.0-25-generic amd64 3.5.0-25.39 [27.7 MB]
Get:3 http://ca.archive.ubuntu.com/ubuntu/ quantal-updates/main linux-image-generic amd64 3.5.0.25.31 [2,442 B]
Fetched 39.6 MB in 13s (2,894 kB/s)
Selecting previously unselected package linux-image-3.5.0-25-generic.
(Reading database ... 142958 files and directories currently installed.)
Unpacking linux-image-3.5.0-25-generic (from .../linux-image-3.5.0-25-generic_3.5.0-25.39_amd64.deb) ...
Done.
Selecting previously unselected package linux-image-extra-3.5.0-25-generic.
Unpacking linux-image-extra-3.5.0-25-generic (from .../linux-image-extra-3.5.0-25-generic_3.5.0-25.39_amd64.deb) ...
Preparing to replace linux-image-generic 3.5.0.17.19 (using .../linux-image-generic_3.5.0.25.31_amd64.deb) ...
Unpacking replacement linux-image-generic ...
Setting up linux-image-3.5.0-25-generic (3.5.0-25.39) ...
Running depmod.
^[[1;3B^[[1;3Bupdate-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
**Error! Your kernel headers for kernel 3.5.0-25-generic cannot be found.
Please install the linux-headers-3.5.0-25-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic**
update-initramfs: Generating /boot/initrd.img-3.5.0-25-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.5.0-25-generic
Found initrd image: /boot/initrd.img-3.5.0-25-generic
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Ubuntu 12.10 (12.10) on /dev/sda6
Found Ubuntu 12.04.1 LTS (12.04) on /dev/sda7
done
Setting up linux-image-extra-3.5.0-25-generic (3.5.0-25.39) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/dkms 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
Error! Your kernel headers for kernel 3.5.0-25-generic cannot be found.
Please install the linux-headers-3.5.0-25-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
update-initramfs: Generating /boot/initrd.img-3.5.0-25-generic
run-parts: executing /etc/kernel/postinst.d/pm-utils 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 3.5.0-25-generic /boot/vmlinuz-3.5.0-25-generic
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-3.5.0-25-generic
Found initrd image: /boot/initrd.img-3.5.0-25-generic
Found linux image: /boot/vmlinuz-3.5.0-17-generic
Found initrd image: /boot/initrd.img-3.5.0-17-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Ubuntu 12.10 (12.10) on /dev/sda6
Found Ubuntu 12.04.1 LTS (12.04) on /dev/sda7
done
Setting up linux-image-generic (3.5.0.25.31) ...
Tente isto:
sudo apt-get install linux-headers-$(uname -r)