piframe/docs/apt_cache_tmpfs.md

19 lines
582 B
Markdown

# tmpfs apt cache
**Please Note: this will use 512M RAM for the tmpfs (it'll usually be smaller) and can cause apt automatic updates to fail. You'll need/want to watch your logs and automatic updates if using this setup.**
The below commands will enable tmpfs (in memory filesystem) for ```/var/cache/apt``` which has heavy disk write turnover due to automatic updates.
``` sh
sudo -sHu root
rm -r /var/cache/apt/*
cat >> /etc/fstab <<EOF
tmpfs /var/cache/apt tmpfs size=512M,defaults,noatime,nodiratime 0 1
EOF
mount /var/cache/apt
df -h /var/cache/apt
```