Skip to content

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.

License

Notifications You must be signed in to change notification settings

sakibulalikhan/snap-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Snap Cleaner Script

░█▀▀░█▀█░█▀█░█▀█░░░█▀▀░█░░░█▀▀░█▀█░█▀█░█▀▀░█▀▄
░▀▀█░█░█░█▀█░█▀▀░░░█░░░█░░░█▀▀░█▀█░█░█░█▀▀░█▀▄
░▀▀▀░▀░▀░▀░▀░▀░░░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀
                              @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.

Features

  • 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.

Usage

  1. Close All Snap Applications: Before running the script, make sure all Snap applications are closed.

  2. Run the Script:

    ./snap-cleaner.sh
  3. Follow the Prompts: The script will ask for your confirmation before clearing the Snap cache and removing old Snap revisions.

Prerequisites

  • 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.

Installation

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

License and Credits

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

Support Me:

Buy Me A Coffee

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Languages