free up space on ubuntu
Posted: Thu Aug 30, 2018 7:27 pm
https://www.omgubuntu.co.uk/2016/08/5-w ... -on-ubuntu
comment by gabdub •
I use this small script in all my machines. I called it "uac" = Update And Clean.
This removes old kernels but keep the last one to go back if something goes wrong with the update.
comment by gabdub •
I use this small script in all my machines. I called it "uac" = Update And Clean.
This removes old kernels but keep the last one to go back if something goes wrong with the update.
Code: Select all
#!/bin/bash
sudo apt update
sudo apt upgrade
sudo apt-get clean
sudo apt-get autoclean
sudo apt-get autoremove
dpkg -l | grep '^rc' | awk '{print $2}' > config_list.txt
if [ -s config_list.txt ]
then
sudo xargs dpkg --purge < config_list.txt
fi
if [ -f /var/run/reboot-required ]; then
echo '**** reboot required ****'
fi