apt-get clean

This commit is contained in:
Aleksandr Chebotov
2020-04-21 18:23:33 +03:00
parent 8e8fbb4f76
commit 9109037d4e
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
#!/bin/bash
# before cleanup
before=$(df / -Pm | awk 'NR==2{print $4}')
# clears out the local repository of retrieved package files
# It removes everything but the lock file from /var/cache/apt/archives/ and /var/cache/apt/archives/partial
apt-get clean
# after cleanup
after=$(df / -Pm | awk 'NR==2{print $4}')
# display size
echo "Before: $before MB"
echo "After : $after MB"
echo "Delta : $(($after-$before)) MB"