Playwright cannot install the Linux libraries its browsers need on Ubuntu 24.04
Fix it fast
Most common cause, 1 of 3Playwright older than 1.45 asks apt for the Ubuntu 22.04 package names
Upgrade the package, then let the new CLI install browsers and libraries together.
npm install -D @playwright/test@latest
npx playwright install --with-deps
# Python projects
pip install -U playwright
playwright install --with-depsShort answer
On Ubuntu 24.04, playwright install --with-deps or install-deps fails when Playwright is older than 1.45, because it still requests the Ubuntu 22.04 package list, with names like libasound2 and libicu70 that noble renamed. Upgrade to Playwright 1.65 through npm or pip and run install --with-deps again. Behind a proxy, start it as root with HTTPS_PROXY on the same line.
Which cause do you have?
Print the Playwright version the project uses and the Ubuntu release of the machine. A version below 1.45 on 24.04 is cause 1. A current version that still complains at test time is cause 2, and one that fails while apt downloads behind a proxy is cause 3.
npx playwright --version
grep -E '^(VERSION_ID|VERSION_CODENAME)=' /etc/os-releaseThen find the line you see in this list and open its fix:
- 1Playwright older than 1.45 asks apt for the Ubuntu 22.04 package names
npx playwright --version prints 1.44 or lower, and apt aborts on libasound2, libicu70 or another jammy-era name - 2Browsers were downloaded, but the system libraries never were
Installation looked fine; the first test run stops with Host system is missing dependencies to run browsers and a list of packages - 3A normal user runs install-deps behind a proxy
The output shows Switching to root user to install dependencies..., then apt cannot reach its mirror
What does the error look like?
Host system is missing dependencies to run browsers.sudo npx playwright install-depsSwitching to root user to install dependencies...
Cause 1 of 3
Playwright older than 1.45 asks apt for the Ubuntu 22.04 package names
You seenpx playwright --version prints 1.44 or lower, and apt aborts on libasound2, libicu70 or another jammy-era name
Check
Install-deps fails on noble because older Playwright releases do not know Ubuntu 24.04. Their host detection maps every Ubuntu newer than 21 to the 22.04 profile, so the dependency step requests jammy packages. The release notes add Ubuntu 24.04 support in 1.45, whose list uses the renamed libasound2t64 and libicu74.
npm ls @playwright/test playwrightFix
Upgrade the package, then let the new CLI install browsers and libraries together. For Python, upgrade with pip and run the same install from the playwright command.
npm install -D @playwright/test@latest
npx playwright install --with-deps
# Python projects
pip install -U playwright
playwright install --with-depsVerify
The install ends without an apt error, and the suite starts its browsers.
npx playwright testConfirmed by playwright.dev
Cause 2 of 3
Browsers were downloaded, but the system libraries never were
You seeInstallation looked fine; the first test run stops with Host system is missing dependencies to run browsers and a list of packages
Check
A plain npx playwright install fetches only the browser builds. The shared libraries they load come from install-deps, or from the --with-deps flag that does both jobs at once, and a fresh 24.04 server or slim image lacks most of them.
npx playwright test 2>&1 | grep -A15 "Host system is missing"Fix
Run Playwright's dependency installer, which calls apt for you. Naming one browser keeps the download smaller.
sudo npx playwright install-deps chromium
# or browsers and libraries in one step
npx playwright install --with-deps chromiumVerify
The next test run starts Chromium with no missing-dependencies block in the output.
npx playwright testConfirmed by playwright.dev
Cause 3 of 3
A normal user runs install-deps behind a proxy
You seeThe output shows Switching to root user to install dependencies..., then apt cannot reach its mirror
Check
Started without root, Playwright raises itself to root to call the package manager, and on that hop variables such as HTTPS_PROXY are not passed along. On a network where only the proxy can reach the internet, apt then fails to download.
env | grep -i _proxyFix
Start the command as root yourself and set the proxy on the same line, so apt sees it.
sudo HTTPS_PROXY=https://192.0.2.1 npx playwright install-depsVerify
apt fetches the packages through the proxy and the command exits cleanly.
npx playwright testConfirmed by playwright.dev
How do I stop it coming back?
- Pin @playwright/test (or the pip package) and upgrade it before moving runners to a newer Ubuntu; 24.04 needs 1.45 or later, and 26.04 support came in 1.61.
- Install browsers and libraries during the image build or CI setup step, as root, never inside the test command.
- Build test images FROM mcr.microsoft.com/playwright with the tag that matches your package version, so the libraries are already inside.
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.
Which stack is behind this page?
Projects of mine on the same stack: TaxiDex, Workforce, stegnor.com.