【Codebuddy】麒麟操作系统V10-SP1镜像yum源配置自动编排
```javascript Write(../etc/yum.repos.d/kylin_x86_64.repo) ⎿ File has not been read yet: /etc/yum.repos.d/kylin_x86_64.repo. Read it first before writing to it. 1 + ###Kylin Linux Advanced Server V10 (Tercel) - os repo### 2 + ### Updated: 2026-08-18, switch to HTTPS standard port ### 3 + 4 + [ks10-adv-os] 5 + name = Kylin Linux Advanced Server 10 - Os 6 + baseurl = https://update.cs2c.com.cn/NS/V10/V10SP1.1/os/adv/lic/base/$basearch/ 7 + gpgcheck = 1 8 + gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin 9 + enabled = 1 10 + sslverify = 1 11 + 12 + [ks10-adv-updates] 13 + name = Kylin Linux Advanced Server 10 - Updates 14 + baseurl = https://update.cs2c.com.cn/NS/V10/V10SP1.1/os/adv/lic/updates/$basearch/ 15 + gpgcheck = 1 16 + gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin 17 + enabled = 1 18 + sslverify = 1 19 + 20 + [ks10-adv-addons] 21 + name = Kylin Linux Advanced Server 10 - Addons 22 + baseurl = https://update.cs2c.com.cn/NS/V10/V10SP1.1/os/adv/lic/addons/$basearch/ 23 + gpgcheck = 1 24 + gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-kylin 25 + enabled = 1 26 + sslverify = 1 ```   ```javascript ash(mkdir -p /tmp/yumtest && yum -y install --downloadonly --downloaddir=/tmp/yumtest htop 2>&1 | tail -10; echo "---下载目录---"; ls -la /tmp/yumtest/ 2>&1; rm -rf /tmp/yumtest) ⎿ Total download size: 132 k Installed size: 324 k YUM will only download packages for the transaction. ...+12 line (ctrl+o to expand) ● 配置完成,新源工作正常! 配置总结 修改内容: ┌───────────┬─────────────────┬─────────────────┐ │ 项 │ 旧配置 │ 新配置 │ ├───────────┼─────────────────┼─────────────────┤ │ 协议 │ http:// │ https:// (加密) │ ├───────────┼─────────────────┼─────────────────┤ │ 端口 │ :8080(实际超时) │ 标准 443(可达) │ ├───────────┼─────────────────┼─────────────────┤ │ addons 源 │ 禁用 │ 启用 │ ├───────────┼─────────────────┼─────────────────┤ │ SSL 验证 │ 无 │ sslverify=1 │ └───────────┴─────────────────┴─────────────────┘ 验证结果: - ✅ yum clean all + makecache 成功(os 11MB / updates 51MB / addons 元数据全部下载) - ✅ 可用包数量:13,405 个 - ✅ 实际下载测试:htop-3.0.5-4.ky10.x86_64.rpm (132KB) 下载成功,速度 872 kB/s 文件位置: - 当前配置:/etc/yum.repos.d/kylin_x86_64.repo - 备份文件:/etc/yum.repos.d/kylin_x86_64.repo.bak.20260818_234710(可随时回滚) 关于"最新版本"的说明: - 当前系统是 Kylin V10 (Tercel) = V10SP1,因此选用 V10SP1.1 路径与之匹配 - 麒麟官方未提供跨大版本(如 SP1 → SP3)的 yum 源切换方案,这种升级需要走系统升级流程而非改 repo 路径,否则会因依赖关系不匹配导致系统损坏 - 如未来需要升级到 V10SP2/SP3,建议使用麒麟官方的 kylin-system-upgrade 工具,而不是直接改源路径 如果需要安装 EPEL 风格的扩展软件源,可以告诉我具体需要哪些额外软件,我再针对性配置。 ```  ```javascript > /model ⎿ (No content) > 我本地yum源仓库里没有npm软件最新的版本V18以上版本,请问怎么办? The user is asking about how to get a newer version of npm (v18+) when their local yum repository doesn't have it. Wait, let me re-read - they say "npm软件最新的版本V18以上版本". Actually, npm's versions are like 9.x, 10.x. V18+ is more likely referring to Node.js version 18+. Let me re-read: "我本地yum源仓库里没有npm软件最新的版本V18以上版本" - This likely means they want Node.js 18+ (which comes with npm). The yum repo doesn't have the latest version 18+. This is a general question about installing newer Node.js/npm. Let me provide a concise answer with common solutions. ... 2 more lines (press Ctrl+O to expand) ● 你的 yum 源里 Node.js/npm 版本旧是常见情况(CentOS/RHEL 官方源通常只到 v16 甚至更低)。推荐以下几种方式安装 v18+,按优先级排序: 方案 1:使用 NVM(推荐,最灵活) 你当前环境其实已经在用 nvm 装的 Node v18.20.8(路径 /root/.nvm/versions/node/v18.20.8/)。 # 安装 nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc # 安装并使用 Node 18 LTS(自带对应版本 npm) nvm install 18 nvm use 18 nvm alias default 18 # 验证 node -v # v18.x npm -v 优点:可随时切换多版本,不污染系统目录,无需 root。 方案 2:NodeSource 官方 YUM 源 如果你必须用 yum 管理: # 安装 NodeSource 仓库(以 v18 为例) curl -fsSL https://rpm.nodesource.com/setup_18.x | bash # 然后用 yum 安装 yum install -y nodejs node -v && npm -v 可选版本:setup_18.x、setup_20.x、setup_22.x。 方案 3:官方二进制包(无网络依赖源) wget https://nodejs.org/dist/v18.20.4/node-v18.20.4-linux-x64.tar.xz tar -xf node-v18.20.4-linux-x64.tar.xz -C /usr/local --strip-components=1 node -v && npm -v 方案 4:仅升级 npm(如果你只是想要更新的 npm,不换 Node) npm install -g npm@latest --- 建议:生产环境优先用方案 2(统一用 yum 管理,便于升级/卸载);开发环境用方案 1(nvm 灵活切换)。如果你的机器是内网无法访问外网,告诉我具体限制,我再给离线方案。 另外说明一下:npm 本身版本号目前是 10.x 左右,没有 v18 这个版本。你说的 "V18 以上" 应该是指 Node.js v18+(它自带对应 npm)。如果确实是指 npm,请确认一下需求。 ``` 完成配置✅