I did this:
Code:
root@rayday:~# wget https://raw.githubusercontent.com/jabarihunt/Ubuntu-Cleanup-Script/master/clean.sh
--2020-09-29 09:26:12-- https://raw.githubusercontent.com/jabarihunt/Ubuntu-Cleanup-Script/master/clean.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 199.232.76.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|199.232.76.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1200 (1.2K) [text/plain]
Saving to: ‘clean.sh.2’
clean.sh.2 100%[=======================================================>] 1.17K --.-KB/s in 0s
2020-09-29 09:26:13 (29.1 MB/s) - ‘clean.sh.2’ saved [1200/1200]
root@rayday:~#
The file at clean.sh looks like this:
Code:
#!/bin/bash
###############################################################################
# This script removes unneeded files and libraries, including log files and snaps.
# I originally created it to combat the /var directory filling up (when on a
# seperate partition). I know there is redundency with apt vs apt-get commands,
# but I alsways seem to have more drive space after running both!
#
# I created this for Ubuntu 18.04 (Desktop), but it should run on other distros
# based on Ubuntu without issue.
#
# To run this script from anywhere, place it in your /usr/local/bin directory
#
# To list your partition sizes run: df -Th | sort
###############################################################################
# Remove apt / apt-get files
sudo apt clean
sudo apt -s clean
sudo apt clean all
sudo apt autoremove
sudo apt-get clean
sudo apt-get -s clean
sudo apt-get clean all
sudo apt-get autoclean
#Remove Old Log Files
sudo rm -f /var/log/*gz
# Remove Thumbnail Cache
rm -rf ~/.cache/thumbnails/*
# Remove old snaps
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision; do
sudo snap remove "$snapname" --revision="$revision"
done
How do I edit that?
Then the next command you said to do looked like this:
Code:
root@rayday:~# bash clean.sh
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/lib/apt/lists/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Del /var/cache/apt/archives/* /var/cache/apt/archives/partial/*
Del /var/lib/apt/lists/partial/*
Del /var/cache/apt/pkgcache.bin /var/cache/apt/srcpkgcache.bin
Reading package lists... Done
Building dependency tree
Reading state information... Done
clean.sh: line 34: snap: command not found
root@rayday:~#
Then this code still says 100% full:
Code:
root@rayday:~# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/ubuntu--vg-ubuntu--lv 196G 186G 656M 100% /
root@rayday:~#
-Raymond Day
Bookmarks