龙空技术网

Linux安装和配置问题解决方案

Iliuhu 310

前言:

现在朋友们对“centos7安装源验证错误”大致比较珍视,姐妹们都想要知道一些“centos7安装源验证错误”的相关资讯。那么小编在网络上网罗了一些关于“centos7安装源验证错误””的相关文章,希望小伙伴们能喜欢,朋友们快快来学习一下吧!

ISO镜像文件挂载问题1 在 /dev/sr0 上找不到媒体

解决办法

1)检查镜像文件是否存在2)检查镜像文件是否已挂载或是连接VMWareHyper-v3) 运行命令挂载

# 如cdrom目录不存在,需创建,挂载的目录可以自定义mkdir /media/cdrommount /dev/sr0 /media/cdrom# 出现 mount: /dev/sr0 is write-protected, mounting read-only,不代表挂载不成功# 验证挂载是否成功df -h
4) 取消挂载命令
umount /dev/sr0
yum安装报错问题1 [Errno 256] No more mirrors to try

解决办法

A、配置本地yum源解决1) ISO镜像文件必须挂载成功,这是前提2)进入yum.repos.d目录

cd /etc/yum.repos.d
3)备份yum.repos.d目录下的文件
mv public-yum-ol7.repo public-yum-ol7.repo.bak
4)创建redhat-base.repo文件,文件名可自定义,但后缀必须是.repo
$ vi redhat-base.repo>>[media-baseos]name=CentOS Stream $releaserver -Media - BaseOSbaseurl=[media-appstream]name=CentOS Stream $releaserver -Media - AppStreambaseurl= :wq
验证yum源配置是否成功
# 清除yum缓存yum clean all# 缓存本地yum源的软件包信息yum makecache
B、配置阿里云yum源1)禁用本地yun源
$ vi redhat-base.repo>>  enabled=0 # 只需把1修改为0
2)配置阿里yum源
# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client.  You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the # remarked out baseurl= line instead.## [base]name=CentOS-$releasever - Base - mirrors.aliyun.com#failovermethod=prioritybaseurl=                 #additional packages that may be useful#[extras]#name=CentOS-$releasever - Extras - mirrors.aliyun.com#failovermethod=priority#baseurl=                 #additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus - mirrors.aliyun.com#failovermethod=prioritybaseurl=                 [PowerTools]name=CentOS-$releasever - PowerTools - mirrors.aliyun.com#failovermethod=prioritybaseurl=                [AppStream]name=CentOS-$releasever - AppStream - mirrors.aliyun.com#failovermethod=prioritybaseurl=                
3) 配置中科大yum源
[baseos]name=CentOS Stream $releasever - BaseOS#metalink=[baseos-debug]name=CentOS Stream $releasever - BaseOS - Debug#metalink=[baseos-source]name=CentOS Stream $releasever - BaseOS - Source#metalink=[appstream]name=CentOS Stream $releasever - AppStream#metalink=[appstream-debug]name=CentOS Stream $releasever - AppStream - Debug#metalink=[appstream-source]name=CentOS Stream $releasever - AppStream - Source#metalink=[crb]name=CentOS Stream $releasever - CRB#metalink=[crb-debug]name=CentOS Stream $releasever - CRB - Debug#metalink=
4) 更新缓存
yum makecache && yum update
Hyper-v网络适配器的问题

解决办法

1)打开Hyper-v管理界面,创建虚拟交换机2)配置虚拟机网络交换机RedHat下配置静态ip问题1 Destination Host Unreachable

解决办法有两种

1)方法一:需修改以下三个文件/etc/sysconfig/network/etc/sysconfig/network-scripts/ifcfg-eth0/etc/resolv.conf

$ /etc/sysconfig/network>>NETWORKING=yesNETWORKING_IPV6=noHOSTNAME=localhost   #主机名GATEWAY=192.168.2.1   # 默认网关
$ /etc/sysconfig/network-scripts/ifcfg-eth0>>DEVICE=eth0		#设备名称NETMASK=255.255.255.0	#子网掩码IPADDR=192.168.2.100		#IP地址且要与本地是在同一网段BOOTPROTO=staticONBOOT=yes		#开机自启动DNS1=8.8.8.8 		#GoogleDNS2=114.114.114.114		#国内
可解決:“ping: 域名 : Name or service not known”的问题
nameserver 114.114.114.114		#国内域名服务器nameserver 8.8.8.8 #google域名服务器nameserver 8.8.4.4 #google域名服务器
2)方法二:在一个文件下配置静态IP
$ vi /etc/sysconfig/network-scripts/ifcfg-eth0>>  DEVICE=eth0BOOTPROTO=staticONBOOT=yesIPADDR=192.168.2.100NETMASK=255.255.255.0GATEWAY=192.168.2.1 DNS1=8.8.8.8 		#GoogleDNS2=114.114.114.114		#国内
3) 重启reboot生效Redhat无法登录,显示module is unknown

解决办法

A、单用户模式1)重启系统运行init6 或 reboot可以直接重启系统,窗口3秒内,然后输入 e进入以下界面找到linux16那一行,在行尾添加 init=/bin/shCtrl + x进入单用户模式可以修改密码,也可以其他操作2)查看/var/log/secure文件,日志如下:3)/etc/pam.d/loginsession required /lib/security/pam_limits.so的内容注释掉,或改为/lib64/security/pam_limits.so4)单用户模式是不允许修改系统文件,解决办法:将根分区重新mount为可读写状态

mount / -o rw,remount
修改系统文件,重启系统Redhat yum install nginx 出现需要:libcrypto.so.10(OPENSSL_1.0.2)(64bit)

解决办法:

1、下载openssl-libs-1.0.2k-12.el7.x86_64.rpm包

2、升级openssl

rpm -ivh openssl-libs-1.0.2k-12.el7.x86_64.rpm --force
3、yum -y install nginx

标签: #centos7安装源验证错误