Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Remove Unnecessary Locales Fedora

Small guide that helps to free up space by removing unneccessary locales from Fedora
With some additional information on how to make more space on your system (advices in the end)
Tried on Fedora 34, but should work on other distros as well (RPM-Based?)

Step 0. Bonus step -- check available space before procedure:

df -lh

Step 1. Enter the locales directory

cd /usr/share/locale/

Step 2. Check that there is files to remove


Previous step should show a lot of directories.

Step 3. Create temporary storage for locales YOU NEED (we'll move away locales WE NEED)

mkdir /tmp/locales

Now, you need to decide which locales you need to save.
We'll move them to another place, so we don't delete them.
I decided to save all EN* locales as well as RU* (Russian)
Add locales you want to save to the command below (after en* and/or instead of ru*)

Step 4. Temporary move away the locales you want to save to another place

sudo mv en* ru* locale.alias /tmp/locales

Step 5. Remove all left-over locales that we don't need (be very careful with this command!)

This command removes all files in current directory.
sudo rm -rf ./*

Step 6. Move locales back (there is dot in the end of this command!)

sudo mv /tmp/locales/* .

Step 7. Bonus step -- check available space after procedure:

df -lh

Now you should have more space on your HDD/SSD!

Other advices

  • Additionally, it should be pretty safe to remove all files from /var/tmp/* as well as /tmp/*:
    rm -rf /var/tmp/* /tmp/*
  • If you have Docker installed, you can remove unused containers as well: docker system prune -a
  • You can clear additional space by removing older parts of system journal: sudo journalctl --vacuum-size=100M
  • Clean DNF packages with: sudo dnf clean packages
  • You can install additional GUI tool called bleachbit to clean up more space (however, check what you remove with it, it can remove some useful stuff too): sudo dnf install bleacnbit && sudo bleachbit
  • Very important tool to clean up some space is Baobab: sudo dnf install baobab && sudo baobab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment