I am facing a problem with kernel installation. I installed two packages but the last one didn't. So I want to uninstall the first package. In this link I have described what was my problem. my problem
-
2Why do you post another question?– Pilot6May 26, 2016 at 7:04
-
@Pilot6 because it is two different question. I asked old question to fix that problem. It seems it can't be installed so I asked another question to undo changes.– CatCoderMay 26, 2016 at 7:12
-
You can remove the kernel packages.– Pilot6May 26, 2016 at 7:16
-
@Pilot6 How to do that?– CatCoderMay 26, 2016 at 7:16
1 Answer
To uninstall a package installed with dpkg
:
sudo dpkg -P name-of-package
or
sudo apt-get remove --purge name-of-package
sudo apt-get autoremove
To get the name of the package first:
dpkg -l | grep part-of-package-name
in your case
dpkg -l | grep linux-headers
which is what you installed. The actual kernel is the linux-image
package - the linux-headers
are minimal configuration kits to automatically build the kernel and its modules, so it is not really important to remove them as they won't do anything to your system by themselves & won't affect which kernel is used.
To find actual installed kernels to remove them, first check what kernel is running with uname -r
and do not remove it. Then run:
dpkg -l | grep linux-image
If you have removed an installed kernel you should run
sudo update-grub
afterwards, to remove it from the GRUB menu.
-
-
@Pilot6 According to the question the OP linked to they successfully installed the headers packages, but the image package failed, and they want to remove the 'first 2 packages' So I guess the question title should be edited since the image is the actual kernel. What to do? Move content from other question here, edit & delete the other question?– Zanna ♦May 26, 2016 at 10:57
-
The headers do not affect which kernel is used. So it is not really important to remove them. You can add some explanation about headers vs image and leave it as it is.– Pilot6May 26, 2016 at 11:01