Skip to content

Instantly share code, notes, and snippets.

@G-Square
Last active May 18, 2021 22:28
Show Gist options
  • Save G-Square/867677f287902f71fe5f9aad22bc525d to your computer and use it in GitHub Desktop.
Save G-Square/867677f287902f71fe5f9aad22bc525d to your computer and use it in GitHub Desktop.
Shrink Fedora, useful when running Fedora from ram. Script will free about 2GB from /dev/mapp.
#Shrink Fedora, usefull when running from ram
#Tested on Fedora 33:
#before :/dev/mapp total 7.9GB available 1.6GB used 6.3GB 80%
#after :/dev/mapp total 7.9GB available 3.6GB used 4.2GB 53%
#save current working path
pushd
#Remove unneeded packages
sudo dnf remove -y libreoffice\* flatpak\* gnome-boxes
#Remove all languages except the one you need.
cd /usr/share/locale; sudo rm -r `ls|grep -v en_US$`;
cd /usr/lib/locale; sudo rm -r `ls|grep -v en_US$\|^C`;
cd /usr/share/help; sudo rm -r `ls|grep -v en`;
#This font is abnormally huge, we don't need that.
cd /usr/share/fonts; sudo rm -rf google-noto-cjk;
#Whats all this firefox langpacks? lets keep the one we need.
cd /usr/lib64/firefox/langpacks; sudo rm -r `ls|grep -v 'en-GB'`;
#return to last working path
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment