apt cannot install libasound2 and similar libraries on Ubuntu 24.04 or Debian 13
Fix it fast
Most common cause, 1 of 3The release renamed the library to libasound2t64
Install the t64 package.
sudo apt-get update
sudo apt-get install -y libasound2t64
# other common renames on noble: libgtk-3-0t64, libatk1.0-0t64, libcups2t64Short answer
Ubuntu 24.04 and Debian 13 rebuilt many C libraries for the 64-bit time_t change and renamed the packages with a t64 suffix. On those releases libasound2 is only a virtual name, so apt has nothing to install. Install libasound2t64 instead, and do the same for the other renamed libraries in your list, such as libgtk-3-0t64.
Which cause do you have?
Check which release the machine or base image runs, and ask apt for the real package names behind the old one.
grep -E '^(ID|VERSION_CODENAME)=' /etc/os-release
apt-cache search --names-only '^libasound2'Then find the line you see in this list and open its fix:
- 1The release renamed the library to libasound2t64
VERSION_CODENAME is noble (Ubuntu 24.04) or trixie (Debian 13) - 2One script has to work on old and new releases
The same Dockerfile, CI job or buildpack runs on 22.04 and 24.04 - 3The base image moved to a newer release under you
The Dockerfile did not change, yet the build started failing
What does the error look like?
E: Package 'libasound2' has no installation candidatePackage libasound2 is a virtual package provided by:
Cause 1 of 3
The release renamed the library to libasound2t64
You seeVERSION_CODENAME is noble (Ubuntu 24.04) or trixie (Debian 13)
Check
packages.ubuntu.com lists libasound2 as a virtual package in noble and a separate libasound2t64 package from the same alsa-lib source. In jammy, libasound2 is still a normal package. The Ubuntu 24.04 release notes describe the time_t change from 32 to 64 bits that caused these renames.
apt-cache policy libasound2t64Fix
Install the t64 package. Other names from guides written for 22.04 often need the same suffix.
sudo apt-get update
sudo apt-get install -y libasound2t64
# other common renames on noble: libgtk-3-0t64, libatk1.0-0t64, libcups2t64Verify
apt reports the package as installed and the program that needed it starts.
dpkg -l libasound2t64 | tail -1Confirmed by packages.ubuntu.com
Cause 2 of 3
One script has to work on old and new releases
You seeThe same Dockerfile, CI job or buildpack runs on 22.04 and 24.04
Check
A fixed list of names breaks on one release or the other. The package exists under one name per release, so the script has to choose.
grep -rn "libasound2" Dockerfile* .github/workflows ci 2>/dev/nullFix
Pick the name that apt knows about, then install it.
if apt-cache show libasound2t64 >/dev/null 2>&1; then
ALSA=libasound2t64
else
ALSA=libasound2
fi
apt-get install -y --no-install-recommends "$ALSA"Verify
The same script succeeds in a jammy and a noble container.
docker run --rm -v "$PWD/install.sh:/i.sh" ubuntu:22.04 sh -c 'apt-get update -qq && sh /i.sh'
docker run --rm -v "$PWD/install.sh:/i.sh" ubuntu:24.04 sh -c 'apt-get update -qq && sh /i.sh'Confirmed by packages.ubuntu.com
Cause 3 of 3
The base image moved to a newer release under you
You seeThe Dockerfile did not change, yet the build started failing
Check
Docker's build guide warns that image tags are mutable and recommends pinning base image versions. A loose tag can start pointing at a release that uses the new package names.
grep -n '^FROM' DockerfileFix
Pin the base image to an explicit release (or a digest), and move to a newer one deliberately along with the renamed packages.
# Dockerfile
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends libasound2t64 \
&& rm -rf /var/lib/apt/lists/*Verify
docker build passes, and rebuilding later with --pull still uses the same release.
docker build --pull -t app:test .Confirmed by docs.docker.com
How do I stop it coming back?
- Pin base images to a release, not a floating tag.
- Install libraries through the program's own dependency list where it has one (for example Playwright's install-deps).
- Test install scripts on every Ubuntu or Debian release you support.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.