Linux - How to remove a package/folder/file?

April 2018


I recently installed the package kubuntu-desktop with the terminal as follows:
sudo apt-get install kubuntu-desktop

I would now like to delete but when I use the 'rm' command, the following message appears:

xxxx@xxxx-laptop:~$ sudo rm kubuntu-desktop 
rm: can not remove 'kubuntu-desktop':.....


You must understand the use apt-get or rm.
  • apt-get allows you to manage packages and dependencies. It is accompanied by a wide range of command him to do his job.
  • To uninstall a package, we use apt-get:
  • sudo => to do as administrator
  • apt-get => ask for apt-get to do
  • remove => remove
  • kubuntu-desktop => the package to remove
    • sudo apt-get remove kubuntu-desktop
  • rm is a command to delete files or folders. For example I want to delete the test.txt file stored at the root of my personal file:
    • rm /home/username/test.txt
  • to delete the xxx file in the same location:
    • rm -r /home/username/xxx

Thanks to Akkenar for this tip.
Published by jak58. Latest update on June 10, 2010 at 01:04 PM by jak58.
This document, titled "Linux - How to remove a package/folder/file?," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
Linux - Localhost does not work under Chrome in offline mode
Linux - Delete pending print jobs.