docker 简单安装
替换国内镜像源(备选方案)
若官方源长期访问困难,可改用阿里云Docker镜像源:
创建 /etc/yum.repos.d/docker-ce.repo,内容如下:
[docker-ce]
name=Docker CE Repository
baseurl=https://mirrors.aliyun.com/docker-ce/linux/centos/$releasever/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/docker-ce/linux/centos/gpg
执行 dnf clean all && dnf makecache 重建缓存。
通过以上步骤,可解决绝大多数因网络、证书、环境限制导致的Docker仓库配置失败问题。若仍报错,可结合 curl -v 的详细输出进一步定位(如代理证书、协议版本等更细节的SSL错误)。
在vim的普通模式下键入“ggdG”即可删除其中全部内容。然后换成上面的就可以下了
再下载
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
成功,太棒了
没下nginx,先下
从报错 -bash: !": event not found
可以看出,问题出在 Bash 的历史扩展特性 上。
原因分析:
在 Bash 中,!
是 历史命令扩展符(默认开启),用于调用历史命令(比如 !!
表示“上一条命令”)。当你在 双引号 中写 !!!
时,Bash 会尝试解析 !
作为历史扩展,导致报错。
解决方法(任选一种):
方法 1:用 单引号 包裹字符串(推荐)
单引号会“强引用”字符串,Bash 不会解析其中的特殊字符(如 !
、$
等)。命令改为:
echo 'Do difficult but meaningful things and keep doing them !!!' > /root/nginx-html/index.html
方法 2:转义 !
在每个 !
前加反斜杠 \
,告诉 Bash 这是普通字符:
echo "Do difficult but meaningful things and keep doing them \!\!\!" > /root/nginx-html/index.html
方法 3:临时关闭历史扩展
执行 set +H
关闭历史扩展(set -H
是重新开启,默认开启),再用双引号执行命令:
set +H
echo "Do difficult but meaningful things and keep doing them !!!" > /root/nginx-html/index.html
推荐优先用 方法 1(单引号),最简洁且避免后续类似问题。
成功
echo 'Do difficult but meaningful things and keep doing them !!!'> /root/nginx-html/index.html
nm没有VPNtm啥都拉不了
不管了,先搞其他的
这个反正最后一步了