From f3bb552f2a4a484afbf6396805d2a5d00e3b36a9 Mon Sep 17 00:00:00 2001 From: popozy <18868108662@163.com> Date: Sun, 7 Jul 2019 11:48:34 +0800 Subject: [PATCH] lose apt-mark unhold kubectl (#15176) lose apt-mark unhold kubectl when apt-get install kubectl. If not unhold kubectl, it would return the error follows: ``` shell root@ecs-k8s-master:~# apt-mark unhold kubelet && apt-get update && apt-get install -y kubelet=1.15.0-00 kubectl=1.15.0-00 && apt-mark hold kubelet kubelet was already not hold. Hit:1 https://download.docker.com/linux/ubuntu xenial InRelease Hit:2 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial InRelease Hit:3 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-updates InRelease Get:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-backports InRelease [107 kB] Hit:4 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-backports InRelease Hit:5 https://mirrors.tuna.tsinghua.edu.cn/ubuntu xenial-security InRelease Hit:6 https://packages.cloud.google.com/apt kubernetes-xenial InRelease Reading package lists... Done Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: linux-headers-4.4.0-145 linux-headers-4.4.0-145-generic linux-image-4.4.0-145-generic linux-modules-4.4.0-145-generic Use 'apt autoremove' to remove them. The following held packages will be changed: kubectl The following packages will be upgraded: kubectl kubelet 2 upgraded, 0 newly installed, 0 to remove and 9 not upgraded. E: Held packages were changed and -y was used without --allow-change-held-packages. ``` --- .../tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-15.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-15.md b/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-15.md index 076649a5a8..895ba679c9 100644 --- a/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-15.md +++ b/content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade-1-15.md @@ -225,9 +225,9 @@ The upgrade workflow at high level is the following: {{< tabs name="k8s_install_kubelet" >}} {{% tab name="Ubuntu, Debian or HypriotOS" %}} # replace x in 1.15.x-00 with the latest patch version - apt-mark unhold kubelet && \ + apt-mark unhold kubelet kubectl && \ apt-get update && apt-get install -y kubelet=1.15.x-00 kubectl=1.15.x-00 && \ - apt-mark hold kubelet + apt-mark hold kubelet kubectl {{% /tab %}} {{% tab name="CentOS, RHEL or Fedora" %}} # replace x in 1.15.x-0 with the latest patch version