下载并安装yq
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq
赋予执行权限
sudo chmod +x /usr/local/bin/yq
验证安装
yq --version
root@bastion quickstart\]# sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq --2025-09-26 08:28:16-- https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 Resolving github.com (github.com)... 20.205.243.166 Connecting to github.com (github.com)\|20.205.243.166\|:443... connected. HTTP request sent, awaiting response... Read error (The TLS connection was non-properly terminated.) in headers. Retrying. --2025-09-26 08:29:49-- (try: 2) https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 Connecting to github.com (github.com)\|20.205.243.166\|:443... failed: Connection timed out. Resolving github.com (github.com)... 20.205.243.166 Connecting to github.com (github.com)\|20.205.243.166\|:443... failed: Connection timed out. Retrying. --2025-09-26 08:34:11-- (try: 3) https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 Connecting to github.com (github.com)\|20.205.243.166\|:443... connected. HTTP request sent, awaiting response... 302 Found Location: https://github.com/mikefarah/yq/releases/download/v4.47.2/yq_linux_amd64 \[following
--2025-09-26 08:34:12-- https://github.com/mikefarah/yq/releases/download/v4.47.2/yq_linux_amd64
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 302 Found
Resolving release-assets.githubusercontent.com (release-assets.githubusercontent.com)... 185.199.110.133, 185.199.111.133, 185.199.109.133, ...
Connecting to release-assets.githubusercontent.com (release-assets.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11477176 (11M) [application/octet-stream]
Saving to: '/usr/local/bin/yq'
/usr/local/bin/yq 100%[=====================================================================================>] 10.95M 1002KB/s in 7.1s
2025-09-26 08:34:22 (1.55 MB/s) - '/usr/local/bin/yq' saved [11477176/11477176]
root@bastion quickstart\]# sudo chmod +x /usr/local/bin/yq \[root@bastion quickstart\]# yq --version yq (https://github.com/mikefarah/yq/) version v4.47.2 \[root@bastion quickstart\]#