linux报错
1、centos8配置epel源
-
在下载bridge-utils这个包的时候,没有找到
-
配置的是阿里云上面的epel源,可以不用修改
# 首先下载epel-release
yum -y install epel-release
sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*
sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*
# 然后生成缓存,删除不能使用源
rm -rf epel-next.repo
# 就能下载到这个包了
# 其他版本的类似操作
2、配置ucloud镜像同步
-
就是直接去dockerhub上面拉取不到,因此的话,需要配置镜像同步到,做一个链接就能拉取到了
-
然后登陆ucloud仓库,账户名为邮箱,密码为仓库的独立密码
-
就可以进行拉取仓库镜像了
2、关于三台机器
-
2个仅主机模式,一个nat模式
-
实现2个仅主机模式上网
首先nat模式机器开启路由转发功能
开启nat地址转换
服务器b和c的流量到达服务器a后,由于都是私网地址,需要转换为a上面的公网地址,实现访问
然后回来的时候,需要将这个公网地址转换为b和c的私网地址即可
3、centos中文切换为英文
# 首先查看系统是否安装了英文
[root@docker ~]# locale -a | grep -i en_US
# 没有显示的话,就需要安装
# 安装英文包报错,需要降级一个软件包
[root@docker yum.repos.d]# yum install glibc-langpack-en
上次元数据过期检查:0:01:11 前,执行于 2025年07月18日 星期五 15时17分48秒。
错误:
问题: cannot install both glibc-common-2.28-164.el8.x86_64 from base and glibc-common-2.28-251.el8.2.x86_64 from @System
- package glibc-langpack-en-2.28-164.el8.x86_64 from base requires glibc-common = 2.28-164.el8, but none of the providers can be installed
- package glibc-gconv-extra-2.28-251.el8.2.x86_64 from @System requires glibc-common = 2.28-251.el8.2, but none of the providers can be installed
- 冲突的请求
- 安装的软件包的问题 glibc-gconv-extra-2.28-251.el8.2.x86_64
(尝试在命令行中添加 '--allowerasing' 来替换冲突的软件包 或 '--skip-broken' 来跳过无法安装的软件包 或 '--nobest' 来不只使用软件包的最佳候选)
# 这个 --allowerasing就可以了
[root@docker yum.repos.d]# yum install glibc-langpack-en --allowerasing
# 改成这个
[root@docker ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"
# source一下就行了
4、yum makecache报错
-
主要就是时间没有更新,太久远了
-
证书无效,主要就是时间比证书生效的时间还早,就报错了
-
更新时间即可
[root@master yum.repos.d]# yum makecache
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered with an entitlement server. You can use subscription-manager to register.
appstream 0.0 B/s | 0 B 00:00
Errors during downloading metadata for repository 'AppStream':
- Curl error (60): SSL peer certificate or SSH remote key was not OK for https://mirrors.aliyun.com/centos-stream/9-stream/AppStream/x86_64/os/repodata/repomd.xml [SSL certificate problem: certificate is not yet valid]
Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
5、docker容器卷映射报错问题
-
原因就是selinux的问题
-
在/root和mnt目录下面创建了文件,映射到nginx根目录容器里面
-
发现没有权限,但是我给的权限都是777
-
最后关闭selinux就可以了
root@ce856c33db0b:/usr/share/nginx# cd html/
root@ce856c33db0b:/usr/share/nginx/html# ls
ls: cannot open directory '.': Permission denied
setenforce 1

浙公网安备 33010602011771号