Install Claude Code on Fedora Linux with dnf (zsh)
Published 18 July 2026
- date
- env
- linux Fedora Workstation 41–44 (x86_64 or aarch64), zsh — Claude Code 2.1.205 macos N/A
- tags
Install Claude Code on Fedora from Anthropic’s signed dnf repository — the recommended method on Fedora/RHEL — configure it for zsh, and handle the two things that trip people up: migrating off a curl | bash native install, and the misleading “Update available!” banner. Verified 2026-07-18 on Fedora 44 with Claude Code 2.1.205.
1. Prerequisites
- 4 GB+ RAM, x64 or ARM64
- A Claude Pro, Max, Team, Enterprise or Console account — the free plan does not include Claude Code
- Internet access
- No Node.js required: the package ships a native binary
Anthropic’s officially tested Linux targets are Ubuntu 20.04+, Debian 10+ and Alpine 3.19+, but a signed RPM repository for Fedora/RHEL is published and supported. That is the method documented here.
Why dnf over the curl | bash native installer on Fedora:
| dnf | native installer | |
|---|---|---|
| Install scope | system-wide (/usr/bin/claude) | per-user (~/.local/bin/claude) |
| Signature verification | automatic, on every update | manual, via signed manifest |
| Updates | your normal dnf upgrade workflow | background auto-update |
| Requires sudo | yes | no |
Pick one. See §4 if you already ran the native installer.
2. Install
sudo tee /etc/yum.repos.d/claude-code.repo <<'EOF'[claude-code]name=Claude Codebaseurl=https://downloads.claude.ai/claude-code/rpm/stableenabled=1gpgcheck=1gpgkey=https://downloads.claude.ai/keys/claude-code.ascEOFsudo dnf install claude-codeOn first install, dnf downloads the signing key and asks you to confirm the fingerprint. Verify it matches before accepting:
31DD DE24 DDFA B679 F42D 7BD2 BAA9 29FF 1A7E CACEChannels
| Channel | baseurl | Behaviour |
|---|---|---|
stable (default above) | https://downloads.claude.ai/claude-code/rpm/stable | roughly one week behind, skips releases with major regressions |
latest | https://downloads.claude.ai/claude-code/rpm/latest | every release as soon as it ships |
Switch channel at any time:
sudo sed -i 's|/rpm/stable|/rpm/latest|' /etc/yum.repos.d/claude-code.reposudo dnf clean metadata && sudo dnf upgrade claude-codeOn a workstation you control, latest is usually the better trade — security and permission fixes reach you sooner. Keep stable on machines where an unexpected regression costs you a working day.
Upgrading
sudo dnf upgrade claude-codePackage-manager installs never auto-update. See §5 — this is the single most confusing part of the dnf method.
3. zsh configuration
3.1 PATH
The package installs to /usr/bin/claude, already on PATH. Nothing to configure.
(Only the native installer needs ~/.local/bin on PATH. Fedora’s /etc/zprofile sources /etc/profile, which normally adds it for login shells anyway.)
3.2 Refresh the command hash table
zsh caches command locations. After any install, upgrade or removal, if claude isn’t found or you get a stale binary:
rehash3.3 Optional aliases
cat >> ~/.zshrc <<'EOF'alias cc='claude'alias ccc='claude --continue'alias ccd='claude doctor'EOFCheck with command -v before choosing a name, to avoid shadowing a real binary.
4. Migrating from a curl | bash native install
If you already ran curl -fsSL https://claude.ai/install.sh | bash, remove it before installing the RPM, or the two launchers will shadow each other.
Identify what you have:
which -a claudeclaude doctorRemove the native install:
rm -f ~/.local/bin/clauderm -rf ~/.local/share/claudeDo not delete ~/.claude or ~/.claude.json — those hold your OAuth token, settings, MCP configuration and session history. The RPM picks them straight up, so you will not have to log in again.
Check whether the installer touched your shell files:
grep -n "claude" ~/.zshrc ~/.zprofile ~/.zshenv 2>/dev/nullRemove any alias or PATH line it added. Keeping ~/.local/bin on PATH is harmless and useful for other tools.
Confirm it’s gone, then install per §2:
rehash && command -v claudeA leftover global npm install can also shadow the RPM:
npm uninstall -g @anthropic-ai/claude-code5. The misleading “Update available!” message
Symptom. The status bar at the bottom of a session shows:
Update available! Run: your package manager update command…but sudo dnf upgrade claude-code answers Nothing to do., even after sudo dnf clean metadata and with the Claude Code repository loading correctly.
This is not a broken install. Two separate things are going on:
a) The message is a literal placeholder. Claude Code detects it was installed by a package manager and, rather than printing the concrete command, emits the generic string “your package manager update command”. It is cosmetic. On Fedora the command is always:
sudo dnf upgrade claude-codeb) The version check tracks latest, your repo tracks stable. The in-session notice compares your build against Anthropic’s release feed, which follows the latest channel. If your repo is configured for stable — roughly a week behind by design — a newer version genuinely exists upstream but is not yet in your repository. dnf is correct to report Nothing to do., and the banner will keep showing until stable catches up.
The docs also note a related timing issue: Claude Code may announce an update slightly before it lands in the package repository, on either channel.
Confirm what your repository actually offers:
dnf list --showduplicates claude-coderpm -q claude-codeIf the highest version listed equals your installed version, there is nothing to install. Ignore the banner.
Resolution — pick one
Option 1 — switch to the latest channel (recommended on a personal workstation):
sudo sed -i 's|/rpm/stable|/rpm/latest|' /etc/yum.repos.d/claude-code.reposudo dnf clean metadata && sudo dnf upgrade claude-codeOption 2 — stay on stable and silence the check. Add DISABLE_AUTOUPDATER to ~/.claude/settings.json (see §6). This stops only the background version check; dnf upgrade continues to work normally.
Option 3 — do nothing. The banner is informational and does not affect the session.
What does not work on Fedora
CLAUDE_CODE_PACKAGE_MANAGER_AUTO_UPDATE=1 makes Claude Code run the upgrade for you — but only for Homebrew and WinGet. apt, dnf and apk are deliberately excluded because those commands require elevated privileges. There is no supported way to have Claude Code run sudo dnf upgrade on your behalf.
6. Settings
User settings live in ~/.claude/settings.json, project settings in <project>/.claude/settings.json.
Working example:
{ "env": { "DISABLE_AUTOUPDATER": "1" }, "theme": "dark"}env holds environment variables; everything else sits at the top level.
Watch for trailing commas — strict JSON forbids them, and a trailing comma after the last key is the most common reason Claude Code rejects the file. Validate before restarting:
python3 -m json.tool ~/.claude/settings.jsonclaude doctorclaude doctor reports settings-file validation errors explicitly.
Note that /config inside a session also writes theme, so changing it there overwrites the value above.
DISABLE_AUTOUPDATER stops only the background check. To block every update path including claude update, use DISABLE_UPDATES instead.
7. Authenticate and verify
claudeA browser opens for OAuth login. If the localhost callback is blocked (headless, SSH, restrictive firewall), copy the printed URL into any browser and paste the returned code back into the terminal.
If ANTHROPIC_API_KEY is exported, Claude Code prompts once to approve that key instead of opening a browser. Unset it beforehand if you want the interactive login.
claude --versionclaude doctorclaude doctor gives read-only diagnostics — install type, install health, settings validation, last update result. Run it first whenever something misbehaves.
8. Other Fedora gotchas
SELinux — Fedora’s default targeted policy does not interfere. If you suspect denials:
sudo ausearch -m avc -ts recentripgrep — bundled with the binary. If in-session search fails, install the system one and disable the builtin:
sudo dnf install ripgrep{ "env": { "USE_BUILTIN_RIPGREP": "0" }}9. First useful action
cd ~/Projects/your-projectclaudeRun /init in the session. It generates a CLAUDE.md describing the project so later sessions start with real context instead of rediscovering the architecture. Commit that file.
10. Uninstall
sudo dnf remove claude-codesudo rm /etc/yum.repos.d/claude-code.repoConfiguration and history (destructive — settings, MCP config, session history):
rm -rf ~/.clauderm -f ~/.claude.json~/.claude/ is also written by the VS Code extension, the JetBrains plugin and the Desktop app. Uninstall those first or the directory reappears.
Sources
- Setup: https://code.claude.com/docs/en/setup
- Troubleshoot install: https://code.claude.com/docs/en/troubleshoot-install
- Settings reference: https://code.claude.com/docs/en/settings
- Environment variables: https://code.claude.com/docs/en/env-vars
Changelog
- 2026-07-18 — Reworked around dnf as the primary method. Added §4 (migrating from the native installer) and §5 (the misleading “Update available!” message). Verified on Fedora 44 / Claude Code 2.1.205.