Packages missing in Ubuntu that worked in Debian

Mon, 26/11/2018 - 11:03 -- James Oakley
Moving from Debian to Ubuntu

I've set up lots of servers that run the Debian flavour of Linux. It's light-weight (works on little RAM, if installed in a minmal configuration) and extremely stable.

But for a particular purpose I recently needed to run a server using Ubuntu 18.04 LTS.

I hit a newbie gotcha that had me stumped for a while, but once I'd solve it, it was really simple.

Packages missing

Trying to install well-known packages that I'd install on any Debian server, I was hitting errors that suprised me. They all seemed to be basically the same type of error: Some package was not able to be installed. But the errors were divided into three kinds:

Unable to locate package expat

Package ntp is not available, but is referred to by another package

Package 'makedev' has no installation candidate

Quite a few packages were unavailable in this way, including munin-node.

Main and Universe

What I hadn't realised is that Canonical split the package repository for each major Ubuntu release into four groups: main packages, universe packages, restricted packages, and multiverse packages. This is explained at https://help.ubuntu.com/community/Repositories/Ubuntu

My problem was because of the distinction between Main and Universe. From that webpage:

  • Main - Canonical-supported free and open-source software.
  • Universe - Community-maintained free and open-source software.

(The other two are all to do with proprietary software, and may be relevant for someone reading this, but they weren't where my problem came from.)

Both groups of packages are free and open source. Main just contains software that Canonical itself will support, whereas Universe is not supported by them. This is a difference from Debian, where the main set of packages contains both kinds, because they don't really have a concept of "Debian-supported": This is an extra layer of support that Canonical adds to Ubuntu.

Sources List

Here was my version of /etc/apt/sources.list after installing Ubuntu 18.04 server from the CD ISO:

deb http://archive.ubuntu.com/ubuntu bionic main
deb http://archive.ubuntu.com/ubuntu bionic-security main
deb http://archive.ubuntu.com/ubuntu bionic-updates main

http://archive.ubuntu.com/ubuntu tells you which mirror to use, bionic tells you which Ubuntu version to use (bionic is the codename for 18.04), and main tells you which group(s) of packages are to be made available.

All I had to do was change main to main universe, and all those other packages become available. Either do this by hand or run:

# sed -Ei 's/^(.*ubuntu.* main)$/\1 universe/' /etc/apt/sources.list

After that, you simply run apt-get update, and all those missing packages are available.

As I say, this was a complete newbie error: Someone schooled in the Ubuntu way of thinking would never have fallen flat at this point. But for such an elementary conceptual shift, it took a surprising number of web searches before I figured out what I'd missed. I hope this helps!

Blog Category: 

Add new comment

Additional Terms