The sed was only modifying /etc/apt/sources.list but security.ubuntu.com and other sources in sources.list.d/ were also trying to fetch arm64 packages from repos that don't have them (404). Now: force [arch=amd64] on ALL .list files, arm64 exclusively from ports.ubuntu.com. cc