Claude Code 中文文档

create: 2026-07-08
update: 2026-07-31
author: thinkycx
title: 【译】Linux 桌面版
description: Claude 桌面应用 Linux 版的安装、更新和卸载指南。支持 Ubuntu 22.04+ 和 Debian 12+,通过 apt 仓库获取更新。
category: translation
tags: claude-code, translation

Claude Desktop Linux 版(beta)

在 Ubuntu 和 Debian 上安装和更新 Claude 桌面应用

Linux 桌面应用目前为 beta 阶段。 Chat、Cowork 和 Code 标签页均可用。

Linux 桌面应用提供与 macOS 和 Windows 相同的体验: 并行会话、可视化 diff 审查、内置终端和编辑器、实时应用预览。完整功能参见 Use Claude Code Desktop

系统要求

要求 说明
系统 Ubuntu 22.04 或更高,或 Debian 12 或更高
架构 x86_64 或 arm64

其他满足条件的 Debian 系发行版可能可用,但未经官方测试。

安装

推荐通过 Anthropic 的 apt 仓库安装,以便通过系统包管理器获取更新。

步骤 1:添加 Anthropic apt 仓库

此步骤使用 curl 下载签名密钥并用 gpg 验证,全新的 Debian 和 Ubuntu 安装可能不包含它们。如果任一命令报 command not found,先安装:

sudo apt install curl gnupg

下载 Anthropic 签名密钥:

sudo curl -fsSLo /usr/share/keyrings/claude-desktop-archive-keyring.asc https://downloads.claude.ai/claude-desktop/key.asc

如果此下载失败,后续 apt update 会报 NO_PUBKEY BAA929FF1A7ECACE。继续前确认密钥已下载且属于 Anthropic:

gpg --show-keys /usr/share/keyrings/claude-desktop-archive-keyring.asc

gpg 输出的指纹应为 31DDDE24DDFAB679F42D7BD2BAA929FF1A7ECACE。如果 gpg 报告文件无法打开或不含有效 OpenPGP 数据,说明下载失败或返回了错误内容:确认网络能到达 downloads.claude.ai,然后重新运行下载命令。

注册仓库:

echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/claude-desktop-archive-keyring.asc] https://downloads.claude.ai/claude-desktop/apt/stable stable main" | sudo tee /etc/apt/sources.list.d/claude-desktop.list

步骤 2:安装

sudo apt update && sudo apt install claude-desktop

步骤 3:启动并登录

从应用启动器打开 Claude,或在终端运行 claude-desktop,然后用 Anthropic 账号登录。

Linux 应用的登录方式与 macOS 和 Windows 相同:使用 claude.ai 订阅或组织的 SSO。桌面版不直接接受 Claude Console API key;API key 认证请使用 CLI。企业部署路由至 Google Cloud Agent Platform 或 LLM gateway 的配置,参见 Claude Desktop on 3P网络配置

从下载文件安装

如果无法使用 apt 仓库,直接从仓库的包池下载 .deb 包。此命令在仓库索引中查找你架构的最新包并下载到当前目录:

curl -fLO "https://downloads.claude.ai/claude-desktop/apt/stable/$(curl -s "https://downloads.claude.ai/claude-desktop/apt/stable/dists/stable/main/binary-$(dpkg --print-architecture)/Packages" | grep '^Filename: pool/main/c/claude-desktop/claude-desktop_' | sort -V | tail -n 1 | cut -d' ' -f2)"

如果命令失败报 Remote file name has no length,说明查找未返回包路径。可能是仓库索引无法获取(如网络阻止 downloads.claude.ai),或你的架构无可用包。确认网络能到达 downloads.claude.aidpkg --print-architecture 输出 amd64arm64(仓库不发布其他架构的包)。

然后用软件安装器打开,或通过 apt 安装:

sudo apt install ./claude-desktop_*.deb

如果 apt 报 E: Unsupported file ./claude-desktop_*.deb given on commandline,说明当前目录下没有匹配的 .deb 文件。确认下载完成后,在包所在目录重新执行命令。

通过此方式安装的 .deb 不会自动更新。 要通过 apt 获取更新,按上方添加 Anthropic apt 仓库步骤注册仓库。包也会写入注释掉的仓库条目到 /etc/apt/sources.list.d/claude-desktop.list;取消注释其 deb 行等效。

更新

桌面应用在 Linux 上不会自动更新。 更新随系统常规包更新到达:

sudo apt update && sudo apt upgrade

发行版的图形软件更新器也会提示新版本。

卸载

sudo apt remove claude-desktop

这会同时移除签名密钥。如果安装时添加了仓库条目,也需删除:

sudo rm /etc/apt/sources.list.d/claude-desktop.list

故障排除

Unable to locate package claude-desktop

如果 sudo apt install claude-desktop 失败报 E: Unable to locate package claude-desktop,apt 未找到你添加的仓库。检查以下:

  • 确认仓库条目已写入。cat /etc/apt/sources.list.d/claude-desktop.list 应显示添加 Anthropic apt 仓库步骤中的 deb 行。如果文件为空或缺失,重新执行该步骤。
  • 确认架构受支持。dpkg --print-architecture 应输出 amd64arm64。仓库不发布其他架构的包。
  • 重新运行 sudo apt update 并检查输出中与 downloads.claude.ai 相关的错误。网络或密钥错误表示仓库已添加但无法到达或验证。

如果仓库就位且可达但仍找不到包,改为从下载文件安装

Linux beta 尚未支持的功能

功能 状态
Computer Use 应用和屏幕控制在 Linux 上不可用
语音输入 Linux 桌面应用不支持。可在 CLI 中使用语音听写
Quick Entry 全局快捷键 X11 下正常工作。原生 Wayland 需要桌面环境的 GlobalShortcuts portal
Fedora 和 RHEL 目前仅支持 Debian 系发行版。未来会增加更多发行版支持

对于桌面应用尚未提供的功能,CLI 运行相同的 Claude Code 引擎且支持更多 Linux 发行版;详见系统要求