Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
~$ locate tp_smapi

How to remove the 2 old Linux kernel modules from kernels 3.0.0-19 und 3.2.0-26?

~$ man dkms

"'dkms remove [module/module-version]' removes a module/version combination from a tree.'

What is a "[module/module-version]", please?

Please notice:

I do not want to remove old Linux kernel modules tp_smapi from a tree but I'd like to remove old Linux kernel modules from my Ubuntu 12.04.1 computer.

share|improve this question

marked as duplicate by Mitch, Basharat Sialvi, user68186, Luis Alvarado May 3 '13 at 14:13

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Why do you want to remove those modules? Which module-version is in use? You can see it with "modinfo tp_smapi" – BuZZ-dEE Sep 4 '12 at 9:04
'~$ modinfo tp-smapi filename: /lib/modules/3.2.0-29-generic/updates/dkms/tp_smapi.ko license: GPL version: 0.41 description: ThinkPad SMAPI Support author: Shem Multinymous srcversion: B6841670771B2FF5222BFFD depends: thinkpad_ec vermagic: 3.2.0-29-generic SMP mod_unload modversions parm: debug:Debug level (0=off, 1=on) (int)' – user43816 Sep 4 '12 at 11:59
1. To get less unwanted responses when I am grepping. -- 2. To save space on my hard disk. -- 3. To tidy up my hard disk. – user43816 Sep 4 '12 at 12:01

This has been tried on 10.04, 11.10, and 12.10. However ... I do not guarantee you if it will preserve your modules!

List your kernels with

dpkg --list | grep linux-image

Then just

sudo apt-get purge [image name(s) from the list]*

On older versions of Ubuntu (not 12.04 onwards), you need to say "hi" to GRUB:

sudo update-grub2
share|improve this answer
On my 12.04 system, grub was automatically re-run, so no need to do the third step (sudo update-grub2). – Fred Hamilton Sep 29 '12 at 23:00
some more cleanup: dpkg --list | grep linux-headers sudo apt-get purge [packagename from the list] – key_ Feb 19 '14 at 8:39

Actually an easier (for people who favor GUIs over command line) and apparently more thorough (it found and deleted header files "apt-get purge ..." missed) alternative is to just install Ubuntu Tweak.

Go to Janitor/System/Old Kernel, select it, and press "Clean".

share|improve this answer

Maybe you should see this link; it has good instruction except perhaps the grub update.

Or, more safely, open the Ubuntu Software Center then search for Linux Kernel Image. Make sure to show the technical terms (click on "Show Technical Terms" located on the lower left of the screen).

Then update grub with the command:

user#: sudo update-grub

(# - root or administrative privileges)

Cheers! :)

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.