Ubuntu 22.04 安装 CINC Client 19.4.46 与 Workstation 26.3.0 指南
Ubuntu 22.04 安装 Cinc Client 19.4.46 与 Cinc Workstation 26.3.0:omnitruck 在线脚本与 deb 离线包双方案、sha256 校验、cinc-solo 首跑/幂等验证、systemd timer 定时托管与卸载清理,全程实测
Ubuntu 22.04 安装 CINC 19 指南
目标:在 Ubuntu 22.04 x86_64 服务器上完成 Cinc Client 19.4.46 的在线(omnitruck 脚本)与离线(deb 裸包)两种安装、Cinc Workstation 26.3.0 的工作站安装,并用一个真实 Cookbook 完成首次收敛、幂等复跑与 systemd timer 定时托管验证。全文命令与回显均来自 2026-10-27 真实环境实测,逐行照抄。
一、环境信息
- 操作系统:Ubuntu 22.04 LTS(Jammy)x86_64(
uname -m实测x86_64) - Cinc Client:19.4.46-1(deb 包
cinc_19.4.46-1_amd64.deb,sha256fb419dbbee156f5df23d9c6f86519f22ec220bf23ef7e04749d3ce9f2745e8e2) - Cinc Workstation:26.3.0-1(deb 包
cinc-workstation_26.3.0-1_amd64.deb,sha2562f343c071f20a771c1c7076997e1460f41ab0b35e8f4deabbe8d648a036eddec) - 安装源:omnitruck 安装服务
https://omnitruck.cinc.sh/install.sh;裸包下载站https://packages.cinc.sh - 安装布局:Client 装到
/opt/cinc,命令链接到/usr/bin/cinc-*;Workstation 装到/opt/cinc-workstation - 配置根目录:
/etc/cinc(与上游 Chef 的/etc/chef隔离) - 节点规划:node01.cinc.lab(被管节点,装 Client)、ws01.cinc.lab(管理工作站,装 Workstation)、一台离线验证机(验证 deb 方案与卸载)
⚠️ 注意:CINC 没有官方 apt/yum 仓库(官方公告仓库方案仍在征集设计中,2026-10-27 实查 cinc.sh),因此只有「omnitruck 在线脚本」与「裸 deb/rpm 包」两条安装路线,升级即重装新包。
二、前置条件
两台机器均满足:
- Ubuntu 22.04 x86_64,root 权限(或 sudo);
- 已装
curl/wget(omnitruck 脚本下载用,实测环境自带); - 在线方案:能访问
omnitruck.cinc.sh与packages.cinc.sh; - 离线方案:另备一台可联网机器下载 deb 包并记录 sha256,再拷入内网。
三、版本选型说明
CINC 四条产品线版本号各自独立(2026-10-27 实查 omnitruck stable 通道):
| 产品 | 对应上游 | 最新稳定版 | omnitruck 安装参数 |
|---|---|---|---|
| Cinc Client | Chef Infra Client | 19.4.46 | -v 19(默认产品 cinc) |
| Cinc Workstation | Chef Workstation | 26.3.0 | -P cinc-workstation -v 26 |
| Cinc Server | Chef Infra Server | 15.10.127 | -P cinc-server -v 15 |
| Cinc Auditor | Chef InSpec | 7.3.4 | -P cinc-auditor -v 7 |
选型要点:
- 锁大版本:omnitruck 的
-v 19表示「19.x 最新」,省去追小版本号;要精确版本可直接下裸 deb。 - 稳定通道:本文全部走 stable 通道(脚本默认),current 通道为预发布。
- 许可:CINC 全产品线 Apache-2.0 无 EULA;它接续构建于「最后一个无 EULA 上游版本」基线(Client 15.6.10 / Workstation 22.1.745 / Auditor 4.17.7 / Server 14.14.1)之上。
- Server 暂缓:上游 Chef Infra Server 2026 年底 EOL、Cinc Server 正转独立 fork,本文只装 Client 与 Workstation,服务端篇目留待后续。
四、在线安装方案(A:omnitruck 官方脚本,装 Cinc Client)
4.1 方案说明
omnitruck 是 CINC 的官方安装服务:脚本自动识别发行版与架构 → 拉取 metadata(含真实下载 URL 与 sha256)→ 下载 deb → 校验 → dpkg 安装,一条命令完成。适合可联网的机器,是官方主推方式。
4.2 安装
在 node01 上执行:
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -v 19
实测完整回显(脚本识别平台→取 metadata→下载→校验→dpkg 安装):
ubuntu 22.04 x86_64
Getting information for cinc stable 19 for ubuntu...
downloading https://omnitruck.cinc.sh/stable/cinc/metadata?v=19&p=ubuntu&pv=22.04&m=x86_64
to file /tmp/install.sh.2814/metadata.txt
trying wget...
sha1 ac0eb71138f7bc51b569d3cae78aac5b5d8b48e1
sha256 fb419dbbee156f5df23d9c6f86519f22ec220bf23ef7e04749d3ce9f2745e8e2
url https://packages.cinc.sh/files/stable/cinc/19.4.46/ubuntu/22.04/cinc_19.4.46-1_amd64.deb
version 19.4.46
downloaded metadata file looks valid...
downloading https://packages.cinc.sh/files/stable/cinc/19.4.46/ubuntu/22.04/cinc_19.4.46-1_amd64.deb
to file /tmp/install.sh.2814/cinc_19.4.46-1_amd64.deb
trying wget...
Comparing checksum with sha256sum...
Installing cinc 19
installing with dpkg...
Selecting previously unselected package cinc.
(Reading database ... 9396 files and directories currently installed.)
Preparing to unpack .../cinc_19.4.46-1_amd64.deb ...
Unpacking cinc (19.4.46-1) ...
Setting up cinc (19.4.46-1) ...
Symlinking chef-apply command to cinc-wrapper for compatibility...
Symlinking chef-client command to cinc-wrapper for compatibility...
Symlinking chef-shell command to cinc-wrapper for compatibility...
Symlinking chef-solo command to cinc-wrapper for compatibility...
Symlinking inspec command to cinc-wrapper for compatibility...
Thank you for installing Cinc Client, the community build based on Chef Infra Client!
💡 说明:末尾 5 行 Symlinking 是 CINC 的上游兼容层——
chef-client、chef-solo等命令被软链到cinc-wrapper,执行时先打印一行Redirecting to cinc-client再转调对应cinc-*命令,存量 Chef 脚本无需修改即可运行。
4.3 验证
cinc-client --version
which cinc-client
ls /opt/cinc/bin | head
实测回显:
Cinc Client: 19.4.46
/usr/bin/cinc-client
chef-apply
chef-client
chef-shell
chef-solo
cinc-apply
cinc-auditor
cinc-client
cinc-resource-inspector
cinc-service-manager
cinc-shell
版本号与 metadata 中的 version 19.4.46 一致,安装成功。/opt/cinc/bin 下同时可见 chef-* 兼容软链与 cinc-* 本体。
五、deb 离线包安装方案(B:断网/内网)
5.1 方案说明
裸包下载站 packages.cinc.sh 按 files/stable/<产品>/<版本>/<发行版>/<版本>/ 的固定路径组织,可直接 wget 拿 deb,拷入内网机器用 dpkg 安装。适合隔离网段与要固化版本的场景。
5.2 下载与校验值获取
在可联网机器上下载(以 Ubuntu 22.04 amd64 为例):
wget https://packages.cinc.sh/files/stable/cinc/19.4.46/ubuntu/22.04/cinc_19.4.46-1_amd64.deb
⚠️ 校验值不在下载站上:packages.cinc.sh 没有 .sha256 sidecar 文件(实测请求返回 404),正确的 sha256 要从 omnitruck metadata 接口取:
curl -sL "https://omnitruck.cinc.sh/stable/cinc/metadata?v=19&p=ubuntu&pv=22.04&m=x86_64"
回显中的 sha256 行即为官方校验值:
sha1 ac0eb71138f7bc51b569d3cae78aac5b5d8b48e1
sha256 fb419dbbee156f5df23d9c6f86519f22ec220bf23ef7e04749d3ce9f2745e8e2
url https://packages.cinc.sh/files/stable/cinc/19.4.46/ubuntu/22.04/cinc_19.4.46-1_amd64.deb
version 19.4.46
5.3 校验并安装
把 deb 拷入离线机器后,先校验再安装:
sha256sum cinc_19.4.46-1_amd64.deb
echo "期望: fb419dbbee156f5df23d9c6f86519f22ec220bf23ef7e04749d3ce9f2745e8e2"
sudo dpkg -i cinc_19.4.46-1_amd64.deb
实测回显:
fb419dbbee156f5df23d9c6f86519f22ec220bf23ef7e04749d3ce9f2745e8e2 cinc_19.4.46-1_amd64.deb
期望: fb419dbbee156f5df23d9c6f86519f22ec220bf23ef7e04749d3ce9f2745e8e2
Unpacking cinc (19.4.46-1) ...
Setting up cinc (19.4.46-1) ...
Symlinking chef-apply command to cinc-wrapper for compatibility...
Symlinking chef-client command to cinc-wrapper for compatibility...
Symlinking chef-shell command to cinc-wrapper for compatibility...
Symlinking chef-solo command to cinc-wrapper for compatibility...
Symlinking inspec command to cinc-wrapper for compatibility...
Thank you for installing Cinc Client, the community build based on Chef Infra Client!
sha256 与 omnitruck metadata 一致,说明包在传输中未被篡改。
5.4 验证
dpkg -l cinc | tail -1
实测回显:
ii cinc 19.4.46-1 amd64 The full stack of cinc
ii 状态即安装完成,与在线方案结果完全一致。
六、Cinc Workstation 安装(管理工作站 ws01)
6.1 方案说明
Workstation 是工程师编写/测试/下发 Cookbook 的工作站包(含 knife、Test Kitchen、Cookstyle、Cinc Auditor 等),装在日常操作机上,不装在被管节点。同样走 omnitruck 脚本,只是换产品名与大版本。
6.2 安装
curl -L https://omnitruck.cinc.sh/install.sh | sudo bash -s -- -P cinc-workstation -v 26
实测回显:
ubuntu 22.04 x86_64
Getting information for cinc-workstation stable 26 for ubuntu...
downloading https://omnitruck.cinc.sh/stable/cinc-workstation/metadata?v=26&p=ubuntu&pv=22.04&m=x86_64
to file /tmp/install.sh.2661/metadata.txt
trying wget...
sha1 d1865c18110c1a8f680e1cb0c503e240da38b3b5
sha256 2f343c071f20a771c1c7076997e1460f41ab0b35e8f4deabbe8d648a036eddec
url https://packages.cinc.sh/files/stable/cinc-workstation/26.3.0/ubuntu/22.04/cinc-workstation_26.3.0-1_amd64.deb
version 26.3.0
downloaded metadata file looks valid...
downloading https://packages.cinc.sh/files/stable/cinc-workstation/26.3.0/ubuntu/22.04/cinc-workstation_26.3.0-1_amd64.deb
to file /tmp/install.sh.2661/cinc-workstation_26.3.0-1_amd64.deb
trying wget...
Comparing checksum with sha256sum...
Installing cinc-workstation 26
installing with dpkg...
Selecting previously unselected package cinc-workstation.
(Reading database ... 7357 files and directories currently installed.)
Preparing to unpack .../cinc-workstation_26.3.0-1_amd64.deb ...
Unpacking cinc-workstation (26.3.0-1) ...
Setting up cinc-workstation (26.3.0-1) ...
Symlinking chef command to cinc-wrapper for compatibility...
Symlinking chef-cli command to cinc-wrapper for compatibility...
Symlinking chef-analyze command to cinc-wrapper for compatibility...
Thank you for installing Cinc Workstation!
You can find some tips on getting started at https://cinc.sh/
6.3 验证
knife --version
cinc --version
ls /opt/cinc-workstation/bin
实测回显:
knife: 19.3.3
Redirecting to cinc
Cinc Workstation version: 26.3.0
Cinc Client version: 19.3.14
Cinc Auditor version: 7.0.107
Cinc CLI version: 6.1.40
Biome version: 2.0.107
Test Kitchen version: 4.1.4
berks
bio
chef
chef-analyze
chef-apply
chef-cli
chef-client
chef-run
chef-shell
chef-solo
chef-vault
cinc
cinc-analyze
cinc-apply
cinc-auditor
cinc-cli
cinc-client
cinc-ng
cinc-resource-inspector
cinc-service-manager
cinc-shell
cinc-solo
cinc-windows-service
cinc-workstation-wrapper
cinc-wrapper
cinc-zero
cookstyle
fauxhai
inspec
kitchen
knife
💡 说明:Workstation 包内捆绑的 Cinc Client 是 19.3.14(供本地测试用),与节点上独立安装的 19.4.46 不冲突;内嵌 Ruby 为 3.4.11(
/opt/cinc-workstation/embedded/bin/ruby -v实测ruby 3.4.11 (2026-09-23 revision 592f1ffdb3) +PRISM [x86_64-linux]),不依赖系统 Ruby。
七、方案对比与选择建议
| 维度 | 方案 A:omnitruck 在线脚本 | 方案 B:deb 离线包 |
|---|---|---|
| 安装版本 | 自动解析大版本最新(19 → 19.4.46) | 精确锁定(URL 写死 19.4.46) |
| 是否需联网 | 目标机必须联网 | 目标机可完全离线,另备联网机下载 |
| 安装方式 | curl | bash,自动识别平台+校验+安装 | wget + sha256sum + dpkg -i |
| 校验来源 | 脚本内自动 sha256 比对 | 需手工从 omnitruck metadata 取 sha256 |
| 适用场景 | 可联网服务器、批量装机 | 隔离内网、版本固化、审计留档 |
选择建议:能联网一律选方案 A(一条命令、自动校验);内网/要留档选方案 B,但务必先从 omnitruck metadata 记录 sha256 再下载(下载站本身不提供校验文件,见常见问题 Q1)。两种方式装出的系统状态完全一致(/opt/cinc + /usr/bin/cinc-* + /etc/cinc 骨架),可混用。
八、首次运行验证与 systemd timer 托管
装好不算完,本节在 node01 上用一个真实 Cookbook 完成「收敛 → 验证 → 幂等复跑 → 定时托管」闭环。
8.1 准备演示 Cookbook
创建 web_base Cookbook(装 htop/curl、建 admin 用户、建 /etc/web_base、下发 /etc/motd):
mkdir -p /root/cookbooks/web_base/{recipes,attributes,templates/default}
/root/cookbooks/web_base/metadata.rb:
name "web_base"
maintainer "quzuo lab"
maintainer_email "admin@quzuo.net"
license "Apache-2.0"
description "Installs and configures baseline packages"
version "0.1.0"
/root/cookbooks/web_base/attributes/default.rb:
default["web_base"]["admin_user"] = "admin"
default["web_base"]["packages"] = %w(htop curl)
default["web_base"]["motd"] = "Managed by Cinc Client"
/root/cookbooks/web_base/recipes/default.rb:
node["web_base"]["packages"].each do |pkg|
package pkg do
action :install
end
end
user node["web_base"]["admin_user"] do
comment "demo admin"
shell "/bin/bash"
action :create
end
directory "/etc/web_base" do
owner "root"
group "root"
mode "0755"
end
template "/etc/motd" do
source "motd.erb"
mode "0644"
end
/root/cookbooks/web_base/templates/default/motd.erb:
<%= node["web_base"]["motd"] %>
node: <%= node["hostname"] %> / <%= node["platform"] %> <%= node["platform_version"] %>
8.2 配置 cinc-solo
/root/solo.rb:
cookbook_path ["/root/cookbooks"]
node_path "/root/nodes"
log_level :info
log_location STDOUT
逐项说明:cookbook_path 指向 Cookbook 搜索目录;node_path 存放节点 JSON;log_location STDOUT 让日志直接打到终端便于观察。
8.3 首次收敛
cinc-solo -c /root/solo.rb -o web_base
实测回显(输出节选,实测首尾):
Cinc Client, version 19.4.46
Patents: https://www.chef.io/patents
Infra Phase starting
[2026-10-27T09:09:42+00:00] INFO: *** Cinc Client 19.4.46 ***
[2026-10-27T09:09:42+00:00] INFO: Platform: x86_64-linux
[2026-10-27T09:09:43+00:00] INFO: Run List is [recipe[web_base]]
[2026-10-27T09:09:43+00:00] INFO: Starting Cinc Client Run for node01.cinc.lab
Resolving cookbooks for run list: ["web_base"]
[2026-10-27T09:09:43+00:00] INFO: Loading cookbooks [web_base@0.1.0]
Synchronizing cookbooks:
- web_base (0.1.0)
Compiling cookbooks...
Converging 5 resources
Recipe: web_base::default
* apt_package[htop] action install
- install version 3.0.5-7build2 of package htop
* apt_package[curl] action install (up to date)
* linux_user[admin] action create
- create user admin
* directory[/etc/web_base] action create
- create new directory /etc/web_base
- change mode from '' to '0755'
* template[/etc/motd] action create
- create new file /etc/motd
- update content in file /etc/motd from none to d9a2c7
[2026-10-27T09:09:48+00:00] INFO: Cinc Client Run complete in 5.224506654 seconds
Infra Phase complete, 4/5 resources updated in 06 seconds
首跑 5 个资源中 4 个发生变更(curl 已存在故 up to date)。逐项验证收敛结果:
cat /etc/motd
id admin
dpkg -l htop | tail -1
ls -ld /etc/web_base
实测回显:
Managed by Cinc Client
node: node01 / ubuntu 22.04
uid=1000(admin) gid=1000(admin) groups=1000(admin)
ii htop 3.0.5-7build2 amd64 interactive processes viewer
drwxr-xr-x 2 root root 4096 Oct 27 09:09 /etc/web_base
motd 内容由模板正确渲染、admin 用户已建、htop 已装、目录权限 0755,全部符合 Recipe 声明。
8.4 幂等复跑
同一命令再跑一次:
cinc-solo -c /root/solo.rb -o web_base
实测回显(尾部节选):
[2026-10-27T09:10:02+00:00] INFO: Cinc Client Run complete in 1.571419879 seconds
Infra Phase complete, 0/5 resources updated in 02 seconds
0/5 resources updated——所有资源已在期望状态,证明资源模型幂等,可安全周期性重跑。
8.5 systemd timer 定时托管
⚠️ 注意:CINC 的 deb 包不附带任何 systemd 单元;包内的
cinc-service-manager(包内置的常驻守护封装)自 Cinc 17 起已废弃。官方推荐的持续收敛方式是 systemd timer 或 cron 定时触发cinc-client/cinc-solo。
创建 service 单元 /etc/systemd/system/cinc-client.service:
[Unit]
Description=Cinc Client run (local mode)
After=network.target
[Service]
Type=oneshot
ExecStart=/usr/bin/cinc-client --local-mode -c /root/solo.rb -o web_base
创建 timer 单元 /etc/systemd/system/cinc-client.timer(每 30 分钟收敛一次,开机 5 分钟后首跑):
[Unit]
Description=Run Cinc Client every 30 minutes
[Timer]
OnBootSec=5min
OnUnitActiveSec=30min
[Install]
WantedBy=timers.target
启用并验证:
systemctl daemon-reload
systemctl enable --now cinc-client.timer
systemctl is-enabled cinc-client.timer
systemctl status cinc-client.service --no-pager
systemctl list-timers cinc-client.timer --no-pager
实测回显:
enabled
○ cinc-client.service - Cinc Client run (local mode)
Loaded: loaded (/etc/systemd/system/cinc-client.service; static)
Active: inactive (dead) since Tue 2026-10-27 09:10:57 UTC; 7ms ago
TriggeredBy: ● cinc-client.timer
Process: 4629 ExecStart=/usr/bin/cinc-client --local-mode -c /root/solo.rb -o web_base (code=exited, status=0/SUCCESS)
Main PID: 4629 (code=exited, status=0/SUCCESS)
CPU: 3.070s
Oct 27 09:10:57 node01.cinc.lab cinc-client[4629]: [2026-10-27T09:10:57+00:00] INFO: Cinc Client Run complete in 1.509810045 seconds
NEXT LEFT LAST PASSED UNIT ACTIVATES
Tue 2026-10-27 09:11:49 UTC 51s left n/a n/a cinc-client.timer cinc-client.service
1 timers listed.
timer 已 enabled、下一次触发时间明确、service 被触发后 status=0/SUCCESS——定时收敛链路完整生效。
九、配置说明
/etc/cinc/配置根目录(安装后自动建骨架):client.rb(client/server 模式主配置)、client.d/(片段配置目录)、trusted_certs/(服务端自签证书信任区)、ohai/(Ohai 插件与 hints)、accepted_licenses(许可接受标记)。- 本地模式:用
solo.rb(见 8.2),cinc-solo -c显式指定;cinc-client --local-mode等价。 - client/server 模式:
client.rb关键项为chef_server_url、node_name、validation_key等,逐项参数详解见本专栏配置篇。 - Workstation 侧:knife 19 起推荐
~/.cinc/credentials(INI profile)管理服务端凭据,旧的knife.rb自动发现行为已变化,实测细节见本专栏配置篇。 - 卸载残留:卸载后
/etc/cinc骨架不会被 purge 清掉,需手工删除(见十一、卸载与清理)。
十、常见问题
Q1:想校验离线下载的 deb,但 packages.cinc.sh 上的 .sha256 文件 404?
实测 https://packages.cinc.sh/files/stable/cinc/19.4.46/ubuntu/22.04/cinc_19.4.46-1_amd64.deb.sha256 返回 404——下载站不提供 sidecar 校验文件。正确做法:从 omnitruck metadata 接口取(见 5.2),或直接用方案 A 让脚本自动校验。
Q2:收敛日志里出现 ERROR: shard_seed: Failed to get dmi property serial_number: is dmidecode installed? 是故障吗?
不是。这是 Ohai 采集 DMI 信息时系统缺 dmidecode 的提示,仅影响 shard_seed 这一派生属性(用于按节点分片随机化定时任务),不影响收敛本身;需要消除就 apt install dmidecode。
Q3:cinc-service-manager 还能用吗?
不能依赖。它自 Cinc 17 起废弃,deb 也不再注册 systemd 服务。持续收敛请用本文 8.5 的 systemd timer(或 cron)方案。
Q4:没有 apt 仓库,以后怎么升级?
重跑方案 A 的 omnitruck 脚本(-v 19 自动拿 19.x 最新),或下载新 deb 覆盖 dpkg -i。配置目录 /etc/cinc 与 /root/cookbooks 不受重装影响。
Q5:dpkg --purge 卸载时返回非零退出码,是卸载失败吗?
不是。实测 purge 返回 exit 1,但包本体(/opt/cinc、/usr/bin/cinc-*)已删除干净;唯一残留是 /etc/cinc 骨架目录(见下节),属包脚本行为,手工清理即可。
十一、卸载与清理
- 先停掉定时收敛(如按 8.5 配置过):
systemctl disable --now cinc-client.timer
rm -f /etc/systemd/system/cinc-client.timer /etc/systemd/system/cinc-client.service
systemctl daemon-reload
- 卸载 Cinc Client:
dpkg --purge cinc
实测回显:
Removing cinc (19.4.46-1) ...
Purging configuration files for cinc (19.4.46-1) ...
- 清理 purge 不清除的
/etc/cinc骨架(实测残留accepted_licenses、client.d、client.rb、ohai、trusted_certs五项):
rm -rf /etc/cinc
- 验证卸载干净(实测
/opt/cinc、/usr/bin/cinc-client均已不存在):
ls /opt/cinc 2>&1 # ls: cannot access '/opt/cinc': No such file or directory
which cinc-client # 无输出
- 工作站卸载 Cinc Workstation(ws01 上):
dpkg --purge cinc-workstation
rm -rf ~/.cinc ~/.chef /root/chef-repo # 按实际情况清理凭据与仓库
十二、参考链接
- CINC 官网:https://cinc.sh
- omnitruck 安装脚本:https://omnitruck.cinc.sh/install.sh
- 裸包下载站:https://packages.cinc.sh
- metadata 校验值接口示例:https://omnitruck.cinc.sh/stable/cinc/metadata?v=19&p=ubuntu&pv=22.04&m=x86_64
- 主仓库(GitLab):https://gitlab.com/cinc-project
- 本站相关文档:《CINC 19 介绍与选型指南》、《Chef Infra Client 19.4.46 介绍与选型指南》