Moving Temporary Files to Memory (a good idea if you’re using a ssd)
Before starting this process it’s a good idea to backup the fstab file
sudo cp /etc/fstab /etc/fstab.bak
The next step is to edit the fstab file either
gksudo gedit /etc/fstab
In either case add one or more of the following lines to the bottom of the file:
tmpfs /tmp tmpfs defaults,noatime,size=1G,mode=1777 0 0 tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0 tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0 tmpfs /var/log/apt tmpfs defaults,noatime 0 0
The first line mounts /tmp in memory with a size limit of 1 gig. This may be larger than you need. If you exceed this limit the swap area will be used.
The second line mounts /var/tmp into memory. The third mounts the logfiles in /var/log–note this means that a reboot will clear your log files which may not be what you want. The fourth line mounts the temporary files associated with apt into memory.
The new mount points will become active on your next reboot.