找一台能连网的机器提前下载好所需要安装的服务离线安装包
举个 docker 离线安装的例子:
1.yum install yum-plugin-downloadonly <--(下载好 yum downloadonly 插件)
2.下载 docker 需要的依赖包:
2.1 配置 Fedora EPEL 源: yum install
http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm -y
2.2 添加 hop5.repo 源: cd /etc/yum.repos.d && wget
http://www.hop5.in/yum/el6/hop5.repo2.3 下载 Docker 离线安装包: mkdir /usr/local/docker && yum install --downloadonly --downloaddir=/usr/local/docker docker-io
2.4 下载 device-mapper-libs 安装包: mkdir /usr/local/docker/device-mapper-libs && yum install --downloadonly --downloaddir=/usr/local/docker/device-mapper-libs device-mapper-libs
《----这样就把 docker 离线包下载下来了,然后把这些包 copy 到不能连网的机器上,再 yum install * .rpm 就可以了