Skip to content

[Bug]: playwright install-deps fails on Rocky Linux 9 due to apt-get fallback and OS misdetection #3087

@nsnake

Description

@nsnake

Version

1.59.0

Steps to reproduce

  1. Install Playwright 1.59.0 on a fresh Rocky Linux 9 system.

  2. Run the following command:

    playwright install-deps chromium

  3. The CLI outputs a warning that the OS is not officially supported and attempts to use Ubuntu 24.04 as a fallback:

    BEWARE: your OS is not officially supported by Playwright; installing dependencies for ubuntu24.04-x64 as a fallback.
    Installing dependencies...
    sh: line 1: apt-get: command not found
    Failed to install browser dependencies
    Error: Installation process exited with code: 127

  4. The install-deps command fails because apt-get is not present on Rocky Linux 9 (which uses dnf/yum instead).

Expected behavior

Playwright should correctly detect Rocky Linux (or RHEL-based distros) and use dnf or yum to install browser dependencies, or provide clear guidance for manual installation. The tool should not fallback to an incompatible OS and package manager.

Actual behavior

On Rocky Linux 9, running 'playwright install-deps chromium' fails because Playwright attempts to use 'apt-get' to install browser dependencies, selecting Ubuntu 24.04 as a fallback OS. Rocky Linux does not have 'apt-get', so the process fails with 'sh: line 1: apt-get: command not found'. This prevents browser dependencies from being installed automatically.

Additional context

Reference: https://github.com/microsoft/playwright-python/blob/main/setup.py
Issue encountered on a server environment; Rocky Linux is widely used as a RHEL-compatible distribution. Other RHEL-derived distributions might face similar issues. Manual installation of dependencies via dnf/yum works, but official handling would improve user experience.

Environment

- Operating System: Rocky Linux 9
- CPU: x86_64
- Browser: Chromium
- Python Version: 3.9
- Other info: Observed on clean Rocky Linux 9 virtual machine

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions