Apt can't find packages on Ubuntu 20.04 arm64 (Raspberry Pi 4)

I began by trying to install xubuntu-desktop, and then tried xfce4, and other packages (like GIMP) on a freshly installed Ubuntu Server 20.04 on my Raspberry Pi 4 but apt reported that it couldn't find these packages. This is very similar to another report here: Apt can't find package libasound2-dev 20.04 arm64

I would add a comment to that post, but I don't yet have enough reputation to comment. But I figured it's important enough to share here again and bring up the question:

QUESTION: What could cause some of the files in /var/lib/apt/lists/ to be of zero size?

I suppose if I reset my RPI4 during the first couple minutes of the initial boot (display issues)... Could this cause unattended-upgrades to fail to complete or download package/repo data, for example?

To be clear, I also have all the default repositories enabled in /etc/apt/sources.list:

deb http://ports.ubuntu.com/ubuntu-ports focal main restricted
deb http://ports.ubuntu.com/ubuntu-ports focal-updates main restricted
deb http://ports.ubuntu.com/ubuntu-ports focal universe
deb http://ports.ubuntu.com/ubuntu-ports focal-updates universe
deb http://ports.ubuntu.com/ubuntu-ports focal multiverse
deb http://ports.ubuntu.com/ubuntu-ports focal-updates multiverse
deb http://ports.ubuntu.com/ubuntu-ports focal-backports main restricted universe multiverse
deb http://ports.ubuntu.com/ubuntu-ports focal-security main restricted
deb http://ports.ubuntu.com/ubuntu-ports focal-security universe
deb http://ports.ubuntu.com/ubuntu-ports focal-security multiverse

Ultimately, when I ran the following (deleting all the lists) and tried again as suggested, I was able to locate all the packages I desired:

sudo apt-get clean
sudo apt-get autoclean
sudo rm -rf /var/lib/apt/lists/
sudo apt update

Solution 1:

Yes, this is an ancient question, but the "got it to work" answer isn't correct.

sudo nano /etc/apt/sources.list

append these to the bottom of the file

deb [arch=arm64] http://ports.ubuntu.com/ focal main multiverse universe

deb [arch=arm64] http://ports.ubuntu.com/ focal-security main multiverse universe

deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main multiverse universe

deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main multiverse universe

Exit and save.

sudo dpkg --print-foreign-architectures

sudo dpkg --add-architecture arm64

sudo dpkg --print-foreign-architectures

You should now see arm64 in your list of foreign architectures

sudo apt-get update

You should see quite a few arm64 entries listed. There will be a few "404 not found" as repos move around. The problem is that many of the development packages for arm64 (notably libx11-dev) are in "ports"