How do I delete files in /usr?

6,887

Solution 1

Normally, it is advised to refrain from manipulating files in system folders by hand. Open Software Center, look for the games you want to get rid of and hit Remove.

Solution 2

I do understand you are queasy about the terminal, but if no commands are mistyped, this will be quite easy. Wait for the something@somewhere ~$ prompt before typing the next command. Note that something and somewhere in the prompt may be different words--do not worry.

The default games installed are gnome-games. To remove them, open "Terminal" by searching it in the launcher, and type sudo apt-get remove gnome-games

It will prompt for a password, which will not be shown when typed(Not even *'s), and then will remove the package. If you are short on disk space, and do not use Libreoffice(An Open Source Office Suite), then you can remove all of Libreoffice from software center, or with sudo apt-get remove libreoffice-*.

Solution 3

The Terminal provides a text-based command-line interface and is very powerful and useful.

However, as Culumus007 has said, it may not be the best tool for this task. Graphical user interface tools like the Ubuntu Software Center or the Synaptic Package Manager make it easy to search through installed packages, figure out which ones you want to remove, and to remove them.

You can do the same thing from the command line, using commands like sudo apt-cache search ..., sudo apt-get remove ... (or sudo apt-get purge ...), and sudo apt-get autoremove (or sudo apt-get --purge autoremove).

What you should not do is to remove the files manually.

  • Even if the right files are removed, the system (specifically, the package manager) will still believe they're there, which can cause problems.
  • When a package is installed, its files are distributed throughout different subdirectories of /usr. It would be rather cumbersome and time consuming to find and delete them all manually, even if you worked from the lists of files provided by the packages you want to remove.
  • It's possible to remove the files manually, using either the Terminal or the file browser Nautilus. But for the reasons explained above, this is not a very good idea.
  • If the files are removed, launchers to them will malfunction instead of being also removed, unless the Unity Launcher entries are also removed manually, causing a difficult process.

I've posted this as community-wiki (easier for others to edit, and I get no rep from it) because there are already good answers, and this is more of a guide to them than a separate answer. But I didn't want to try to cram this information into comments.

Share:
6,887

Related videos on Youtube

georgielello
Author by

georgielello

Updated on September 18, 2022

Comments

  • georgielello
    georgielello almost 2 years

    I have filled my disk but can see games in /usr that I could delete but can't see how to do it. I am not a computer buff and have no idea what a terminal is.

  • ImaginaryRobots
    ImaginaryRobots almost 12 years
    This is especially true if you don't know what the files are for or what will break when you delete them! Software center is the way to go for managing what's installed.
  • Eliah Kagan
    Eliah Kagan almost 12 years
    This does indeed have all the same problems as manually removing the files in the Terminal.
  • Geppettvs D'Constanzo
    Geppettvs D'Constanzo almost 12 years
    BTW I upvoted you as your answer, like mine, gives a true answer to the question. The user said: "How do I delete files from the /usr folder", not "I want to UNINSTALL games" which are different issues.
  • Rafał Cieślak
    Rafał Cieślak almost 12 years
    If you want such answers not to be downwoted, be sure to add a clear warning to them. The OP says he does not know what terminal is, so it's very likely he is not aware why it may be dangerous to mess up with files in /usr. Also, the OP is not the only one who reads this question, a lot of people may get here from Google or anything else, then they also should be warned about potential hazards, and a way to eliminate them (e.g. using USC). When helping others it is good to make sure they won't end up with greater problems then they already have, even if that's beyond the scope of question.
  • all4naija
    all4naija almost 12 years
    Actually, not all games can be removed through the Software Center. Most especially, those installed through wine.
  • Eliah Kagan
    Eliah Kagan almost 12 years
    @GeppettvsD'Constanzo Uninstalling the software deletes the files. Doing it manually isn't just dangerous, but you're unlikely to find all the files. In effect, removing the packages does what the OP asked and attempting to remove the files manually doesn't.
  • all4naija
    all4naija almost 12 years
    He doesn't know what terminal is but CTRL+ALT+T would do that just fine.However, this is the right way to remove the game files the original poster can see. It is clear and succint.
  • Admin
    Admin almost 12 years
    Wine games, however, are not installed in /usr.
  • nanofarad
    nanofarad almost 12 years
    Moving files to trash clears no disk space.