@@ -171,49 +171,65 @@ Or use this for detailed view of version:
171
171
### 用原生包管理工具安装 {#install-using-native-package-management}
172
172
173
173
{{< tabs name="kubectl_install" >}}
174
- {{% tab name="Ubuntu、Debian 或 HypriotOS" %}}
175
-
176
- <!--
177
- 1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository:
178
- -->
179
- 1 . 更新 ` apt ` 包索引,并安装使用 Kubernetes ` apt ` 仓库所需要的包:
180
-
181
- ``` shell
182
- sudo apt-get update
183
- sudo apt-get install -y apt-transport-https ca-certificates curl
184
- ```
185
- < ! --
186
- 2. Download the Google Cloud public signing key:
187
- -->
188
- 2. 下载 Google Cloud 公开签名秘钥:
189
-
190
- ` ` ` shell
191
- sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
192
- ` ` `
193
-
194
- < ! --
195
- 3. Add the Kubernetes ` apt` repository:
196
- -->
197
- 3. 添加 Kubernetes ` apt` 仓库:
198
-
199
- ` ` ` shell
200
- echo " deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
201
- ` ` `
202
-
203
- < ! --
204
- 4. Update ` apt` package index with the new repository and install kubectl:
205
- -->
206
- 4. 更新 ` apt` 包索引,使之包含新的仓库并安装 kubectl:
207
-
208
- ` ` ` shell
209
- sudo apt-get update
210
- sudo apt-get install -y kubectl
211
- ` ` `
174
+ {{% tab name="基于 Debian 的发行版" %}}
175
+
176
+ <!--
177
+ 1. Update the `apt` package index and install packages needed to use the Kubernetes `apt` repository:
178
+ -->
179
+ 1 . 更新 ` apt ` 包索引,并安装使用 Kubernetes ` apt ` 仓库所需要的包:
180
+
181
+ ``` shell
182
+ sudo apt-get update
183
+ sudo apt-get install -y ca-certificates curl
184
+ ```
185
+ <!--
186
+ If you use Debian 9 (stretch) or earlier you would also need to install `apt-transport-https`:
187
+ -->
188
+ {{< note >}}
189
+
190
+ 如果你使用 Debian 9(stretch)或更早版本,则你还需要安装 ` apt-transport-https ` :
191
+
192
+ ``` shell
193
+ sudo apt-get install -y apt-transport-https
194
+ ```
195
+
196
+ {{< /note >}}
197
+
198
+ <!--
199
+ 2. Download the Google Cloud public signing key:
200
+ -->
201
+
202
+ 2 . 下载 Google Cloud 公开签名秘钥:
203
+
204
+ ``` shell
205
+ sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
206
+ ```
207
+
208
+ <!--
209
+ 3. Add the Kubernetes `apt` repository:
210
+ -->
211
+
212
+ 3 . 添加 Kubernetes ` apt ` 仓库:
213
+
214
+ ``` shell
215
+ echo " deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
216
+ ```
217
+
218
+ <!--
219
+ 4. Update `apt` package index with the new repository and install kubectl:
220
+ -->
221
+
222
+ 4 . 更新 ` apt ` 包索引,使之包含新的仓库并安装 kubectl:
223
+
224
+ ``` shell
225
+ sudo apt-get update
226
+ sudo apt-get install -y kubectl
227
+ ```
228
+
212
229
{{% /tab %}}
213
230
214
- {{% tab name=" 基于 Red Hat 的发行版" % }}
231
+ {{< tab name="基于 Red Hat 的发行版" codelang="bash" > }}
215
232
216
- ` ` ` shell
217
233
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
218
234
[ kubernetes]
219
235
name=Kubernetes
@@ -223,9 +239,7 @@ gpgcheck=1
223
239
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
224
240
EOF
225
241
sudo yum install -y kubectl
226
- ` ` `
227
-
228
- {{% /tab %}}
242
+ {{< /tab >}}
229
243
{{< /tabs >}}
230
244
231
245
<!--
@@ -352,6 +366,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
352
366
kubectl-convert: FAILED
353
367
sha256sum: WARNING: 1 computed checksum did NOT match
354
368
```
369
+
355
370
{{< note >}}
356
371
<!--
357
372
Download the same version of the binary and checksum.
0 commit comments