Now, let’s practice what we have learned from Offline package Installation I
. For example, I want to install docker
and kubeadm
etc offline in the target machine.
Docker
Note: here we only download actual dependencies need for installation, not all rpms if we use
--installroot
option
I want to install Docker 18.06.3
(currently kubeadm now properly recognizes Docker 18.09.0
and newer, but still treats 18.06
as the default supported version). You should perform below steps on a machine that hasn’t installed docker yet.
Note: install from a package, rpms list in this link are not complete, they are in top level but can be used to upgrade version.
Uninstall old version
1 | yum remove docker \ |
The contents of /var/lib/docker/
, including images, containers, volumes, and networks, are preserved. The Docker CE package is now called docker-ce
.
Set up docker repository
Before you install Docker CE for the first time on a new host machine, you need to set up the Docker repository. Afterward, you can install and update Docker from the repository.
1 | yum install -y yum-utils \ |
Use the following command to set up the stable repository, yum-utils
contains yum-config-manager
:
1 | yum-config-manager \ |
List docker version
List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated:
1 | yum list docker-ce --showduplicates | sort -r |
1 | Loaded plugins: product-id, search-disabled-repos |
Download docker rpms
Install a specific version by its fully qualified package name, which is the package name (docker-ce
) plus the version string (2nd column) starting at the first colon (:), up to the first hyphen, separated by a hyphen (-). For example, docker-ce-18.06.3.ce
.
1 | mkdir -p /root/docker-18.06.3-rpms |
list the rpms in the target folder:
1 | audit-2.8.4-4.el7.x86_64.rpm libselinux-utils-2.5-14.1.el7.x86_64.rpm |
Note that the required components may be changed in later version, such as 18.09.2
, there are 2 more packages docker-ce-cli-18.09.2
and containerd.io
.
1 | mkdir -p /root/docker-18.09.2-rpms |
Install docker rpms
now install docker 18.06.3
offline by running:
1 | yum --disablerepo=* -y install /root/docker-18.06.3-rpms/*.rpm |
Note: please refer my blog
Set up and Use Local Yum Repository
if you want to create and use local yum repository