Package (un)installation on a Debian system is horribly slow, partly because it works with a whole bunch of (small) files. Short of getting faster storage, how do I speed it up? I'm thinking maybe loading some highly-accessed directory onto RAM as one solution, but how do I do that? Is there a 'better' solution?
For this solution you are going to need a version of dpkg of at least 18.104.22.168.
Since that version of dpkg, there is a new
If you have an older version of dpkg you can alternatively use eatmydata.
And remember both of these solutions are unsafe and probably will lead to data loss if there is a power failure while or shortly after dpkg is running.