░█▀▀░█▀█░█▀█░█▀█░░░█▀▀░█░░░█▀▀░█▀█░█▀█░█▀▀░█▀▄
░▀▀█░█░█░█▀█░█▀▀░░░█░░░█░░░█▀▀░█▀█░█░█░█▀▀░█▀▄
░▀▀▀░▀░▀░▀░▀░▀░░░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀
@sakibulalikhan.
A simple Bash script to remove old revisions of Snap packages and clear the Snap cache. This script is designed for Ubuntu and other Linux distributions ( Arch, Fedora, Debian, etc) that use Snap packages, ensuring you free up disk space by deleting unnecessary Snap package revisions and caches.
- Clear Snap Cache: Removes all files from the Snap cache directory.
- Remove Old Snap Revisions: Deletes old revisions of installed Snap packages that are no longer in use.
- User Confirmation: Prompts for user confirmation before performing any actions.
-
Close All Snap Applications: Before running the script, make sure all Snap applications are closed.
-
Run the Script:
./snap-cleaner.sh
-
Follow the Prompts: The script will ask for your confirmation before clearing the Snap cache and removing old Snap revisions.
- Snap Package Manager: Ensure that Snap is installed on your system.
- Root Privileges: The script requires root privileges to remove cache files and old Snap revisions.
- Linux Distribution: The script is intended for Ubuntu and any other Linux distributions ( Arch, Fedora, Debian, etc) that use Snap packages.
Clone this repository to your local machine:
git clone https://github.com/sakibulalikhan/snap-cleaner.git
cd snap-cleaner
Make the script executable:
chmod +x snap-cleaner.sh
Run the script:
./snap-cleaner.sh
This script is released under the MIT License. Some parts of the code were inspired by a tutorial from It's FOSS.
Author: Sakibul Ali Khan
Follow: @sakibulalikhan