This script automates the process of cleaning up and maintaining a Fedora Linux system. It removes unnecessary packages, cleans caches, and performs other system maintenance tasks.
- Updates package list
- Removes unused packages and dependencies
- Cleans DNF cache
- Removes old kernels (keeps current and one previous version)
- Cleans user cache
- Cleans system journal
- Removes temporary files
- Removes orphaned packages
- Fedora Linux (tested on Fedora 40 with GNOME 46)
- Root or sudo access
- Save the script to a file (e.g.,
fedora_cleanup.sh
) - Make the script executable:
chmod +x fedora_cleanup.sh
- Run the script with sudo:
sudo ./fedora_cleanup.sh
This script removes files and packages from your system. While it's designed to be safe, it's recommended to review the script and understand its actions before running it. Consider backing up important data before executing system-wide cleanup operations.
You can modify the script to add or remove cleanup tasks according to your needs. Each task is clearly labeled with a descriptive message.
Feel free to fork this script and submit pull requests for any improvements or additional features you think would be beneficial.
This script is released under the MIT License. See the LICENSE file for details.