For workaround #1, you need to perform the command as root.
It will create the file "/etc/apt/apt.conf.d/99weakkey-warning" and write...:
APT::Key::Assert-Pubkey-Algo ">=rsa2048,ed25519,ed448,dsa1024";
... into it.
You can do the same with nano or vi or any other editor if you prefer.
To...