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.
VS Code: wiring Microsoft’s repo
Section titled “VS Code: wiring Microsoft’s repo”Three steps — the same pattern for any third-party repo:
# 1. import the signing keysudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
# 2. write the repo filesudo tee /etc/yum.repos.d/vscode.repo <<'EOF'[code]name=Visual Studio Codebaseurl=https://packages.microsoft.com/yumrepos/vscodeenabled=1gpgcheck=1repo_gpgcheck=1gpgkey=https://packages.microsoft.com/keys/microsoft.ascEOF
# 3. installsudo dnf install -y codeMeasured: repomd.xml returns 200 and installation proceeds cleanly. Updates ride dnf upgrade.
Safety rules for third-party repos
Section titled “Safety rules for third-party repos”gpgcheck=1is non-negotiable: an unsigned repository is arbitrary code entering as rootrepo_gpgcheck=1is stricter: verifies the repository metadata itself (Microsoft’s repo supports it)- a third-party repo left
enabled=1slows every dnf run: setenabled=0for rarely-updated repos and use--enablerepo=codeon demand name=must not collide with other repositories
Remote-SSH / Dev Containers
Section titled “Remote-SSH / Dev Containers”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).
gh CLI: straight from the Fedora repos
Section titled “gh CLI: straight from the Fedora repos”sudo dnf install -y ghgh --versionMeasured 2.97.0 — no GitHub repo needed. Login and basics:
gh auth login # choose HTTPS + browser authorizationgh repo clone owner/repogh pr list && gh pr checkout 123gh 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.
Common traps
Section titled “Common traps”| Symptom | Cause |
|---|---|
dnf install code finds no package | repo file wrong (a trailing slash on baseurl is fine, but the repo name must be unique) |
| GPG verification fails | key not imported or expired; re-run rpm --import |
| Remote-SSH connection timeout | remote downloading vscode-server slowly; place it manually or proxy |
gh auth login cannot open a browser | SSH environment — use a token: gh auth login --with-token < token.txt |
code CLI errors after launch | Flatpak and rpm versions mixed; check with which code |
Related pages
Section titled “Related pages”- Neovim as an IDE — the alternative if you skip VS Code
- Git, fully — signed commits for the Verified badge
- compose compatibility — the container backend for Dev Containers
- Upstream: VS Code on Linux