![]() Next, make the script executable using the chmod command: chmod +x Free_snaps.shĪnd finally, execute the script. Save changes and exit from the nano text editor. Snap remove "$snapname" -revision="$revision" To remove the previous versions, you can use the script developed by Alan Pope who himself is a part of the Snapcraft team at Canonical.įirst, create and open a file named Free_snaps.sh using the following: nano Free_snaps.sh To check how much space is occupied by the snaps, you can use the du command as shown: du -h /var/lib/snapd/snaps ![]() In case you don't know, snap by default, keeps two previous versions as if something wrong happens, you can roll back to the previous version.īut snaps take up a lot of space! And when combined with the previous iterations, the number gets bigger. Remove previous versions of snap packages I would recommend clearing logs older than 3 days using the following: sudo journalctl -vacuum-time=3dĪnd that should do the job! 4. In my case, it was around 1.8GB: :~$ journalctl -disk-usageĪrchived and active journals take up 1.8G in the file system. ![]() To check how much space is taken by systemd logs, you can use the following command: journalctl -disk-usage The journal logs of the systemd contain various kinds of information such as logging data, log messages, standard input, output errors, and a lot more.Īnd over time, these logs can take a large amount of data. I do understand that some of the shown packages are not installed by the user but it includes all the packages installed by the user and the pre-installed packages can be ignored easily.įrom here, you can remove packages using the apt remove command: sudo apt remove 3. So in that case, you can use the apt-mark command in the following manner to list packages that were manually installed by the user: apt-mark showmanual Sure, you can use the apt-list, but it will list everything that came pre-installed too! We often forget the packages that were installed and are no longer in use and will consume a large chunk of the disk. The apt autoremove command also deleted older Linux kernel versions that are not needed anymore. In my case, the size is around 547 MB and to remove it, all you have to do is hit enter as it will trigger the default option and in this case, its Y. You list the unnecessary dependencies with total size using: sudo apt autoremove When you install a tool in your system, in most cases, it heavily relies on some other packages but once you uninstall that package, those dependencies will still be there.Īnd in most cases, those dependencies will be in hundreds of MBs or even GBs.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |