Skip to content
Search Fedora

    Browse this documentation

    VS Code and the gh CLI: third-party repos done properly

    VS Code is not in Fedora’s repos (licensing), so it uses Microsoft’s official yum repo. The gh CLI, in contrast, ships in Fedora’s own repos. Both measured.

    Three steps — the same pattern for any third-party repo:

    Terminal window
    # 1. import the signing key
    sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
    # 2. write the repo file
    sudo tee /etc/yum.repos.d/vscode.repo <<'EOF'
    [code]
    name=Visual Studio Code
    baseurl=https://packages.microsoft.com/yumrepos/vscode
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://packages.microsoft.com/keys/microsoft.asc
    EOF
    # 3. install
    sudo dnf install -y code

    Measured: repomd.xml returns 200 and installation proceeds cleanly. Updates ride dnf upgrade.

    • gpgcheck=1 is non-negotiable: an unsigned repository is arbitrary code entering as root
    • repo_gpgcheck=1 is stricter: verifies the repository metadata itself (Microsoft’s repo supports it)
    • a third-party repo left enabled=1 slows every dnf run: set enabled=0 for rarely-updated repos and use --enablerepo=code on demand
    • name= must not collide with other repositories

    The Remote-SSH extension needs the remote Fedora machine to install vscode-server (auto-downloaded to ~/.vscode-server). Slow downloads on CN servers: download the server package manually into place, or set a temporary proxy on the remote.

    Dev Containers needs podman/docker on the remote — installing the podman-docker shim is enough (see compose compatibility).

    Terminal window
    sudo dnf install -y gh
    gh --version

    Measured 2.97.0 — no GitHub repo needed. Login and basics:

    Terminal window
    gh auth login # choose HTTPS + browser authorization
    gh repo clone owner/repo
    gh pr list && gh pr checkout 123
    gh issue create -t "title" -b "body"

    The browser flow completes on your local machine; on a pure SSH box choose the token route and paste a personal access token.

    SymptomCause
    dnf install code finds no packagerepo file wrong (a trailing slash on baseurl is fine, but the repo name must be unique)
    GPG verification failskey not imported or expired; re-run rpm --import
    Remote-SSH connection timeoutremote downloading vscode-server slowly; place it manually or proxy
    gh auth login cannot open a browserSSH environment — use a token: gh auth login --with-token < token.txt
    code CLI errors after launchFlatpak and rpm versions mixed; check with which code