Lazy speed up apt install on baremetal
On Ubuntu (Debian) installed on baremetal servers, the kernel upgrade might take tens of minutes or even hours to install.
The apt install might appear to be stuck, but in fact, it performs fsync() calls after each file.
Warning!: Make sure that when you perform the apt install, the server has a reliable power source, otherwise some files might not be persisted (synced) and you end up with a broken installation/upgrade.
This script has been tested on Ubuntu Server 18.04.
# just add force-unsafe-io to /etc/dpkg/dpkg.cfg echo "force-unsafe-io" >> "/etc/dpkg/dpkg.cfg"
That's all, folks!Tweet