What exactly does gcc-multilib mean on Ubuntu?

gcc-multilib is useful for cross-compiling, that is, compiling a program to run on a different processor architecture. For example, you would need gcc-multilib if you are running on 64-bit Ubuntu and want to compile a program to run on 32-bit Ubuntu (or on ARM etc. you get the idea).


Is this actually Apple's "fat binaries" or "universal binaries" model ported to Linux?

No.

Multilib is a mechanism to support building and running code for different ABIs for the same CPU family on a given system. Most commonly it was/is used to support 32-bit code on 64-bit systems and 64-bit code on 32-bit systems with a 64-bit kernel. It was also used at one stage to provide support for soft-float arm binaries on hard-float arm systems.

It has been around for a long time. Since at least Debian lenny, but it never had specific support in the packaging tools making library support awkward. Also on arm upstream treats the 64-bit and 32-bit architectures as completely separate architectures rather than variants of the same architecture, so you can't use multilib there.

In terms of running code on Debian and Ubuntu systems, multilib has been mostly replaced by multiarch, which is a more general mechanism allowing installation of packages from potentially any combination of architectures on the same system (though actually running those binaries may require installing emulation layers).

In terms of building code Debian/Ubuntu now offer proper cross-compiler packages, which are more flexible than multilib in that they in principle allow you to build for anything on anything (though in practice Debian doesn't offer the full set of combinations).

So I think multilib is mostly legacy at this time, it sticks around though because important packages still nedd it to build.