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.
```
This commit is contained in:
popozy
2019-07-07 11:48:34 +08:00
committed by Kubernetes Prow Robot
parent 222795393c
commit f3bb552f2a
@@ -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