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

aptdpkgpackage-managementupdates

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

Best Answer