< 自用文兒 在 Ubuntu 上安裝 Claude Code > 發現了“京東云 JDCloude” 有國內商業云中最低的網絡性能

Claude Code:

最近刷屏這個詞:Claude Code 以后叫 CC,它是?Anthropic 的一款智能編程工具,幾個特點:

  • 在終端運行?像使用命令行工具一樣,無需圖形用戶界面 GUI
  • 深度理解整個代碼庫?
  • 使用自然語言 讓其修復 bug、生成代碼、重構代碼、甚至運行測試。
  • 代理式編程工具?"Agentic Coding Tool"?提供代碼建議,還能直接在你的開發環境中編輯文件并執行命令,實現自動化編程

總而言之,CC 就是在你終端里工作的 AI 助手,能理解你的代碼,并依照你給出的自然語言指令,來幫助你完成編寫、修改以及調試代碼。

可憐的京東云用戶:

在準備安裝環境時,我還以為 京東云 輕量應用服務器 VPS?掉線了。看下面截圖:、

Apt 源都是清華,都是運行同樣的命令:

sudo apt update && sudo apt upgrade -y

這臺是 北京-騰訊云 4Mbps 帶寬 VPS:?2C2G50GB

這臺是 北京-京東云 帶寬?5Mbps,?VPS: 2C4G60GB

看看騰訊在小日本兒-京東?VPS:2C2G50GB 網絡 30Mbps

下面這個 VPS 在美國,1C1G10GB 網絡 50Mbps,不到?$13/yr 含一個公網IP

再看看從國外源的下載速度:

騰訊-北京云:

京東-北京云:

這就是我為什么開工單,要 “京東” 調整, 說好的 5Mbps 帶寬,到了國際出口就 100.8Kbps ,只有?1/50 性能

開個工單:

運行商信息:

供應商配置 帶寬每月-流量費用
京東-北京云2C4G60GB5Mbps雙向 500GB36個月:498/原價2459.16
騰訊-北京云2C2G50GB4Mbps單向 1024GB12個月:99元
騰訊-日本京東云2C2G50GB30Mbps單向 300GB12個月:99元
美國加州1C1G10GB50Mbps雙向 512GB12個月:不到 95元

注:C=CPU's core,G=內存,GB=硬盤

安裝 Claude Code

參考:Set up Claude Code - Anthropic??
????????? ?https://docs.anthropic.com/en/docs/claude-code/setup

1 確保 Ubuntu 24 是最新的系統

sudo apt update && sudo apt upgrade -y

2 安裝 Node.js 18以上的版本 與 npm?

sudo apt remove nodejs npm
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

校驗 Node.js / npm 安裝的版本:

node --version # Should show v20.x.x
npm --version  # Should show 10.x.x or higher

root@usw:~# sudo apt remove nodejs npm
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package 'nodejs' is not installed, so not removed
Package 'npm' is not installed, so not removed
The following packages were automatically installed and are no longer required:
? linux-image-6.8.0-35-generic linux-modules-6.8.0-35-generic linux-modules-extra-6.8.0-35-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2025-06-23 07:50:58 - Installing pre-requisites
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Get:2 https://pkgs.tailscale.com/stable/ubuntu noble InRelease ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu noble InRelease [256 kB] ? ? ? ? ? ? ? ? ? ? ? ??
Hit:4 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:5 http://nova.clouds.archive.ubuntu.com/ubuntu noble-backports InRelease
Fetched 262 kB in 2s (170 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apt-transport-https is already the newest version (2.8.3).
ca-certificates is already the newest version (20240203).
curl is already the newest version (8.5.0-2ubuntu10.6).
The following packages were automatically installed and are no longer required:
? linux-image-6.8.0-35-generic linux-modules-6.8.0-35-generic linux-modules-extra-6.8.0-35-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
? dirmngr gnupg-utils gpg-agent gpgsm keyboxd libksba8 pinentry-curses
Suggested packages:
? pinentry-gnome3 tor parcimonie xloadimage gpg-wks-server scdaemon pinentry-doc
Recommended packages:
? gnupg-l10n gpg-wks-client
The following NEW packages will be installed:
? dirmngr gnupg gnupg-utils gpg-agent gpgsm keyboxd libksba8 pinentry-curses
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
Need to get 1485 kB of archives.
After this operation, 3411 kB of additional disk space will be used.
Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu noble/main amd64 libksba8 amd64 1.6.6-1build1 [122 kB]
Get:2 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 dirmngr amd64 2.4.4-2ubuntu17.2 [323 kB]
Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 gnupg-utils amd64 2.4.4-2ubuntu17.2 [109 kB]
Get:4 http://nova.clouds.archive.ubuntu.com/ubuntu noble/main amd64 pinentry-curses amd64 1.2.1-3ubuntu5 [35.2 kB]
Get:5 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 gpg-agent amd64 2.4.4-2ubuntu17.2 [227 kB]
Get:6 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 gpgsm amd64 2.4.4-2ubuntu17.2 [232 kB]
Get:7 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 keyboxd amd64 2.4.4-2ubuntu17.2 [78.3 kB]
Get:8 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates/main amd64 gnupg all 2.4.4-2ubuntu17.2 [359 kB]
Fetched 1485 kB in 0s (4153 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libksba8:amd64.
(Reading database ... 55112 files and directories currently installed.)
Preparing to unpack .../0-libksba8_1.6.6-1build1_amd64.deb ...
Unpacking libksba8:amd64 (1.6.6-1build1) ...
Selecting previously unselected package dirmngr.
Preparing to unpack .../1-dirmngr_2.4.4-2ubuntu17.2_amd64.deb ...
Unpacking dirmngr (2.4.4-2ubuntu17.2) ...
Selecting previously unselected package gnupg-utils.
Preparing to unpack .../2-gnupg-utils_2.4.4-2ubuntu17.2_amd64.deb ...
Unpacking gnupg-utils (2.4.4-2ubuntu17.2) ...
Selecting previously unselected package pinentry-curses.
Preparing to unpack .../3-pinentry-curses_1.2.1-3ubuntu5_amd64.deb ...
Unpacking pinentry-curses (1.2.1-3ubuntu5) ...
Selecting previously unselected package gpg-agent.
Preparing to unpack .../4-gpg-agent_2.4.4-2ubuntu17.2_amd64.deb ...
Unpacking gpg-agent (2.4.4-2ubuntu17.2) ...
Selecting previously unselected package gpgsm.
Preparing to unpack .../5-gpgsm_2.4.4-2ubuntu17.2_amd64.deb ...
Unpacking gpgsm (2.4.4-2ubuntu17.2) ...
Selecting previously unselected package keyboxd.
Preparing to unpack .../6-keyboxd_2.4.4-2ubuntu17.2_amd64.deb ...
Unpacking keyboxd (2.4.4-2ubuntu17.2) ...
Selecting previously unselected package gnupg.
Preparing to unpack .../7-gnupg_2.4.4-2ubuntu17.2_all.deb ...
Unpacking gnupg (2.4.4-2ubuntu17.2) ...
Setting up libksba8:amd64 (1.6.6-1build1) ...
Setting up pinentry-curses (1.2.1-3ubuntu5) ...
Setting up gpg-agent (2.4.4-2ubuntu17.2) ...
Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent.socket → /usr/lib/systemd/user/gpg-agent.socket.
Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-ssh.socket → /usr/lib/systemd/user/gpg-agent-ssh.socket.
Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-extra.socket → /usr/lib/systemd/user/gpg-agent-extra.socket.
Created symlink /etc/systemd/user/sockets.target.wants/gpg-agent-browser.socket → /usr/lib/systemd/user/gpg-agent-browser.socket.
Setting up gpgsm (2.4.4-2ubuntu17.2) ...
Setting up dirmngr (2.4.4-2ubuntu17.2) ...
Created symlink /etc/systemd/user/sockets.target.wants/dirmngr.socket → /usr/lib/systemd/user/dirmngr.socket.
Setting up keyboxd (2.4.4-2ubuntu17.2) ...
Created symlink /etc/systemd/user/sockets.target.wants/keyboxd.socket → /usr/lib/systemd/user/keyboxd.socket.
Setting up gnupg-utils (2.4.4-2ubuntu17.2) ...
Setting up gnupg (2.4.4-2ubuntu17.2) ...
Processing triggers for libc-bin (2.39-0ubuntu8.4) ...
Hit:1 http://security.ubuntu.com/ubuntu noble-security InRelease
Get:2 https://deb.nodesource.com/node_20.x nodistro InRelease [12.1 kB] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Get:3 http://nova.clouds.archive.ubuntu.com/ubuntu noble InRelease [256 kB] ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Get:4 https://pkgs.tailscale.com/stable/ubuntu noble InRelease ? ? ? ? ? ? ? ? ? ? ??
Get:5 https://deb.nodesource.com/node_20.x nodistro/main amd64 Packages [11.5 kB] ? ?
Hit:6 http://nova.clouds.archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:7 http://nova.clouds.archive.ubuntu.com/ubuntu noble-backports InRelease
Fetched 286 kB in 2s (176 kB/s)
Reading package lists... Done
2025-06-23 07:51:13 - Repository configured successfully.
2025-06-23 07:51:13 - To install Node.js, run: apt-get install nodejs -y
2025-06-23 07:51:13 - You can use N|solid Runtime as a node.js alternative
2025-06-23 07:51:13 - To install N|solid Runtime, run: apt-get install nsolid -y?

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
? linux-image-6.8.0-35-generic linux-modules-6.8.0-35-generic linux-modules-extra-6.8.0-35-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
? nodejs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 32.0 MB of archives.
After this operation, 199 MB of additional disk space will be used.
Get:1 https://deb.nodesource.com/node_20.x nodistro/main amd64 nodejs amd64 20.19.2-1nodesource1 [32.0 MB]
Fetched 32.0 MB in 5s (6893 kB/s)?
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package nodejs.
(Reading database ... 55243 files and directories currently installed.)
Preparing to unpack .../nodejs_20.19.2-1nodesource1_amd64.deb ...
Unpacking nodejs (20.19.2-1nodesource1) ...
Setting up nodejs (20.19.2-1nodesource1) ...
root@usw:~#?
root@usw:~#?
root@usw:~#?
root@usw:~# node --version # Should show v20.x.x
npm --version ?# Should show 10.x.x or higher
v20.19.2
10.8.2
root@usw:~#?

3 配置 npm

mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global

添加路徑:

echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

添加依賴包(可選)

sudo apt install -y git ripgrep

4 安裝 CC

npm install -g @anthropic-ai/claude-code

root@usw:~# mkdir -p ~/.npm-global
npm config set prefix ~/.npm-global
root@usw:~# echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
root@usw:~# sudo apt install -y git ripgrep
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.43.0-1ubuntu7.2).
The following packages were automatically installed and are no longer required:
? linux-image-6.8.0-35-generic linux-modules-6.8.0-35-generic linux-modules-extra-6.8.0-35-generic
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
? ripgrep
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 1551 kB of archives.
After this operation, 5335 kB of additional disk space will be used.
Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu noble/universe amd64 ripgrep amd64 14.1.0-1 [1551 kB]
Fetched 1551 kB in 0s (3722 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package ripgrep.
(Reading database ... 60606 files and directories currently installed.)
Preparing to unpack .../ripgrep_14.1.0-1_amd64.deb ...
Unpacking ripgrep (14.1.0-1) ...
Setting up ripgrep (14.1.0-1) ...
root@usw:~# npm install -g @anthropic-ai/claude-code

added 3 packages in 12s

2 packages are looking for funding
? run `npm fund` for details

5 啟動 CC

創建項目文件夾

mkdir ~/projects

復制項目到文件夾

root@usw:~/projects# ll
total 12
drwxr-xr-x  3 root root 4096 Jun 23 08:22 ./
drwx------ 12 root root 4096 Jun 23 08:25 ../
drwxr-xr-x  6 root root 4096 Jun 23 08:23 48.removebg/
root@usw:~/projects# 

進入項目的文件夾中,運行 claude

root@usw:~/projects# cd 48.removebg/
root@usw:~/projects/48.removebg# claude?

claude 

第一次運行 CC

1 配置顯示風格

柔光用 1,我最后選的 3 為了看清楚些。

2 訂閱用戶登錄或使用 API 付費

打折時付了年度會員,用的 1,如下:

用瀏覽器打開上面的鏈接,會拿到驗證碼:

粘貼到屏幕提示區

成功后,如圖:

下一頁,安全須知

3 進入項目

總結:

在沒有 GUI 的環境里 Claude Code 是一個玩美的終端上使用 AI 的方案。如果你也是 Claude 訂閱用戶 ( Claude Pro ),你的 $20/月的 Claude Pro 訂閱本身就包含了在終端使用 Claude Code 的權限,并且會提供比免費用戶更多的使用量。?

如上圖中,Anthropic 也提供另一種方式:API 令牌使用費來使用 CC,這種按量付費模式獨立于你的 $20 訂閱,對于需要更高使用量、靈活或特定需求的用戶。

以上是在加州服務器運行,如果你的終端在國內,就要使用工具。

在國內安裝 CC

使用本地代理安裝 Claude Code

npm config set proxy http://127.0.0.1:1081
npm config set https-proxy http://127.0.0.1:1081
npm install -g @anthropic-ai/claude-code

注: socket port 1081 根據你自己的實際情況修改

最后把 npm anthropic 有關域加到路由,如: (以前有篇文章 用 DELETED tunel 組網)

{"type": "field","domain": ["registry.npmjs.org","*.npmjs.org","npmjs.com","*.npmjs.com","anthropic.com","*.anthropic.com","console.anthropic.com","api.anthropic.com","claude.ai","*.claude.ai"],"outboundTag": "usw_outbound"
}

修改后要重啟應用

下面是日志反映出主機路由的變化,BJN:

USW:

這樣在北京的主機上就可以使用 CC 來維護代碼

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/86416.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/86416.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/86416.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

Docker部署prometheus+grafana+...

Docker部署prometheusgrafana… prometheus官網 官網 https://prometheus.io/ 中文網址 https://prometheus.ac.cn/ Prometheus簡介 Prometheus(普羅米修斯)是一套開源的監控&報警&時間序列數據庫的組合,由SoundCloud公司開發。 Prometheus基…

Python爬蟲實戰:研究Spynner相關技術

1 引言 1.1 研究背景與意義 隨著互聯網的迅速發展,網頁內容呈現形式日益復雜。傳統的靜態網頁逐漸被動態網頁所取代,大量內容通過 JavaScript 動態生成或 AJAX 異步加載。這使得傳統爬蟲(如基于 Requests 庫的爬蟲)難以獲取完整的網頁信息,因為它們只能獲取頁面的初始 H…

人工智能訓練知識學習-TTS(智能語音合成)

人機對話——TTS(TextToSpeech) 概念: TTS技術,即文本轉語音技術,是一種將文字內容轉換為語音輸出的技術。它通過計算機程序和算法,將文本信息轉化為自然流暢的語音信號,讓用戶能夠聽到文字內…

【Java高頻面試問題】JVM篇

【Java高頻面試問題】JVM篇 類加載機制加載(Loading)連接(Linking)?初始化(Initialization)?使用(Using)與卸載(Unloading) 類加載器和雙親委派模型類加載器…

DBeaver的sql編輯器文本格式字體大小設置

DBeaver的sql編輯器文本格式字體大小設置。開始就沒有找到。早上比較清醒被我發現了。記錄下來

自學Java怎么入門

自學Java其實沒有想象中那么難,只要找對方法,循序漸進地學習,很快就能上手。下面我結合自己的經驗,給你整理一條清晰的學習路徑,咱們一步步來。 一、先了解Java能做什么 在開始之前,建議你先看看Java都能…

操作系統面試知識點(1):操作系統基礎

目錄 1.什么是操作系統: 2.操作系統有哪些功能? 3.常見的操作系統有哪些 4.用戶態和內核態 5.內核態權限這么高,為什么不還要用戶態? 6.用戶態和內核態是如何切換的? 7.系統調用 8,系統調用的過程 ???????1.什么是操作系統: (1)操作系統(OS)是管理計算機軟硬…

Linux 和 Windows 服務器:哪一個更適合您的業務需求?

在選擇服務器操作系統時,Linux 和 Windows 服務器是最常見的兩種選擇。它們各有特點,適合不同的業務需求和使用環境。本文將詳細分析 Linux 和 Windows 服務器的主要差異,包括成本、安全性、性能、定制化能力和用戶界面等方面,幫助…

CertiK聯創顧榮輝將于港大活動發表演講,分享Web3安全與發展新視角

CertiK聯合創始人、哥倫比亞大學教授顧榮輝,將于6月30日出席香港大學經管學院主辦的“Web3革新與商業機遇”活動,并發表主題演講《規模化Web3:面向全球受眾的創新與安全平衡之道》。 本次活動由港大經管學院高層管理教育主辦,Met…

SpringAI系列---【SpringAI如何接入阿里云百煉大模型?】

1.導言 阿里云百煉的通義千問模型支持 OpenAI 兼容接口,您只需調整 API Key、BASE_URL 和模型名稱,即可將原有 OpenAI 代碼遷移至阿里云百煉服務使用。 如果是要接入阿里云百煉模型,首先推薦使用Spring AI Alibaba,而不是使用Spri…

電子電氣架構 --- 實時系統評價的概述

我是穿拖鞋的漢子,魔都中堅持長期主義的汽車電子工程師。 老規矩,分享一段喜歡的文字,避免自己成為高知識低文化的工程師: 做到欲望極簡,了解自己的真實欲望,不受外在潮流的影響,不盲從,不跟風。把自己的精力全部用在自己。一是去掉多余,凡事找規律,基礎是誠信;二是…

Flink SQL執行流程深度剖析:從SQL語句到分布式執行

在大數據處理領域,Flink SQL憑借其強大的處理能力和易用性,成為眾多開發者的選擇。與其他OLAP引擎類似,Flink SQL的SQL執行流程大致都需要經過詞法解析、語法解析、生成抽象語法樹(AST)、校驗以及生成邏輯執行計劃等步…

什么是redis

Redis是一個開源的、基于內存的高性能鍵值存儲數據庫,廣泛用于緩存、消息隊列、會話存儲等場景。 - 核心特點: - 內存存儲:數據存儲在內存中,讀寫速度極快。 - 鍵值對:以鍵值對形式存儲數據,鍵通常是字…

《從0到1:C/C++音視頻開發自學指南》

開啟自學之旅:為何選擇 C/C 音視頻開發 在當今數字化時代,音視頻開發的應用場景極為廣泛,深刻融入了我們生活與工作的方方面面。從火爆的直播行業,無論是電商直播中主播與觀眾的實時互動,還是游戲直播里精彩賽事的實時…

學習日記-spring-day37-6.25

知識點: 1.使用utillist進行配置 知識點 核心內容 重點 Spring框架中utl名稱空間創建List 通過utl名稱空間創建并管理集合對象,實現數據復用 utl list與普通list賦值的區別; 名稱空間引入方法 無參構造器使用規則 當類中沒有其他構造器時&#x…

【Python練習】012. 使用字符串的upper()方法將字符串轉換為大寫

012. 使用字符串的upper方法將字符串轉換為大寫 012. 使用字符串的upper()方法將字符串轉換為大寫示例代碼運行結果代碼解釋 擴展:動態輸入字符串示例運行 何時使用upper方法基本用法示例忽略大小寫的字符串比較數據清洗標準化 注意事項 012. 使用字符串的upper()方…

Python Polars庫詳解:高性能數據處理的新標桿

在數據驅動的時代,高效的數據處理能力已成為開發者和數據科學家的核心競爭力。作為Pandas的強勁挑戰者,Polars庫憑借其基于Rust的底層架構和創新的表達式引擎,在性能測試中展現出驚人的速度優勢。本文將深入解析Polars的核心特性、使用技巧及…

Go語言- 單元測試

實際開發中,需要保證單元功能正確。 傳統方式:在main函數中直接調用,查看結合是否和預期一致。 缺點:1. 不方便 2. 不利于管理 因此,單元測試具有必要性 testing測試框架 Go語言中自帶testing輕量級測試框架和go…

Vue移動端開發的適配方案與性能優化技巧

文章目錄 1. 移動端適配方案1.1. 視口適配1.2. 基于rem/em的適配方案1.3. vw/vh視口單位適配1.4. 移動端UI組件庫適配 2. 移動端性能優化技巧2.1. 虛擬列表實現長列表優化2.2. 圖片懶加載與優化2.3. 減少首屏加載時間2.4. 事件節流與防抖 3. 移動端常見問題解決方案3.1. 移動端…

如何微調和部署OpenVLA在機器人平臺上

這個教程來自這個英偉達網址 教程的目標是提供用于部署 VLA 模型的優化量化和推理方法,以及針對新機器人、任務和環境的參考微調流程。在一個自包含的仿真環境中,結合場景生成和領域隨機化(MimicGen)對性能和準確性進行嚴格驗證。…