Monday, April 10, 2023

How to fix "E: You don't have enough free space in /var/cache/apt/archives/."

If the root directory is tight and

apt-upgrade 

is giving you:

E: You don't have enough free space in /var/cache/apt/archives/

then you can move apt's cache somewhere else:

mv /var/cache/apt/ /home
ln -s /home/apt/ /var/cache/apt
 

later undo with:

rm /var/cache/apt
mv /home/apt /var/cache

--------------------------------------------------------

various housekeeping things

apt clean 

apt autoremove

journalctl --rotate

journalctl --vacuum-time=1s 

remove old logs

find /var/log -mtime +2 -type f -delete

rm /var/cache/locate/locatedb

-------------------------------------------------------

other things that may help actually squeeze the root filesystem 


find all the files larger than 50M on the / partition (ignoring sub-mounts!)
find / -mount -type f -size +50M -exec du -h {} \; | sort -n
 
find installed packages in size order 
dpkg-query --show --showformat='${Package;-50}\t${Installed-Size}\n' | sort -k 2 -n | grep -v deinstall | awk '{printf "%.3f MB \t %s\n", $2/(1024), $1}'


Tuesday, February 14, 2023

How to Change the Default Browser in Debian Linux

xdg-open https://lichess.org/training/kAngL

xdg-settings get default-web-browser

xdg-settings set default-web-browser firefox.desktop

xdg-open https://lichess.org/training/kAngL

xdg-settings set default-web-browser debian-sensible-browser.desktop



Thursday, January 19, 2023

To Move the Most Recent Files

This command will move the five most recent files in the ~/Downloads directory to the current directory

 

find ~/Downloads -maxdepth 1 -type f -printf '%T@ %p\n' | sort -rn | cut -d' ' -f2- | head -n 5 | xargs -I{} echo mv {} .

 

to do a dry run! remove echo to actually do it.