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

Linux安装和配置问题解决方案ISO镜像文件挂载问题。1 在 /dev/sr0 上找不到媒体。yum安装报错问题。1 No more mirrors to try。

大家好,欢迎来到IT知识分享网。

ISO镜像文件挂载问题

1 在 /dev/sr0 上找不到媒体

解决办法

1)检查镜像文件是否存在

2)检查镜像文件是否已挂载或是连接

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

  • Hyper-v
Linux安装和配置问题解决方案

3) 运行命令挂载

# 如cdrom目录不存在,需创建,挂载的目录可以自定义 mkdir /media/cdrom mount /dev/sr0 /media/cdrom # 出现 mount: /dev/sr0 is write-protected, mounting read-only,不代表挂载不成功 # 验证挂载是否成功 df -h
Linux安装和配置问题解决方案

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
Linux安装和配置问题解决方案

4)创建redhat-base.repo文件,文件名可自定义,但后缀必须是.repo

$ vi redhat-base.repo >> [media-baseos] name=CentOS Stream $releaserver -Media - BaseOS baseurl=file:///media/cdrom/BaseOS enabled=1 gpgcheck=0 #gpgkey=file:///media/cdrom/RPM-GPG-KEY-redhat-release [media-appstream] name=CentOS Stream $releaserver -Media - AppStream baseurl=file:///media/cdrom/AppStream enabled=1 gpgcheck=0 #gpgkey=file:///media/cdrom/RPM-GPG-KEY-redhat-release $ :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=priority baseurl=https://mirrors.aliyun.com/centos-stream/$stream/BaseOS/$basearch/os/ http://mirrors.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/BaseOS/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official #additional packages that may be useful #[extras] #name=CentOS-$releasever - Extras - mirrors.aliyun.com #failovermethod=priority #baseurl=https://mirrors.aliyun.com/centos-stream/$stream/extras/$basearch/os/ # http://mirrors.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/ # http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/extras/$basearch/os/ #gpgcheck=1 #gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official #additional packages that extend functionality of existing packages [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com #failovermethod=priority baseurl=https://mirrors.aliyun.com/centos-stream/$stream/centosplus/$basearch/os/ http://mirrors.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/centosplus/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official [PowerTools] name=CentOS-$releasever - PowerTools - mirrors.aliyun.com #failovermethod=priority baseurl=https://mirrors.aliyun.com/centos-stream/$stream/PowerTools/$basearch/os/ http://mirrors.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/PowerTools/$basearch/os/ gpgcheck=1 enabled=0 gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official [AppStream] name=CentOS-$releasever - AppStream - mirrors.aliyun.com #failovermethod=priority baseurl=https://mirrors.aliyun.com/centos-stream/$stream/AppStream/$basearch/os/ http://mirrors.aliyuncs.com/centos-stream/$stream/AppStream/$basearch/os/ http://mirrors.cloud.aliyuncs.com/centos-stream/$stream/AppStream/$basearch/os/ gpgcheck=1 gpgkey=https://mirrors.aliyun.com/centos-stream/RPM-GPG-KEY-CentOS-Official

3) 配置中科大yum源

[baseos] name=CentOS Stream $releasever - BaseOS #metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/BaseOS/x86_64/os/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 [baseos-debug] name=CentOS Stream $releasever - BaseOS - Debug #metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-debug-$stream&arch=$basearch&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/BaseOS/x86_64/debug/tree/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h enabled=0 [baseos-source] name=CentOS Stream $releasever - BaseOS - Source #metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-source-$stream&arch=source&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/BaseOS/source/tree/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h enabled=0 [appstream] name=CentOS Stream $releasever - AppStream #metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/AppStream/x86_64/os/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=1 [appstream-debug] name=CentOS Stream $releasever - AppStream - Debug #metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-debug-$stream&arch=$basearch&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/AppStream/x86_64/debug/tree/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h enabled=0 [appstream-source] name=CentOS Stream $releasever - AppStream - Source #metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-source-$stream&arch=source&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/BaseOS/source/tree/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h enabled=0 [crb] name=CentOS Stream $releasever - CRB #metalink=https://mirrors.centos.org/metalink?repo=centos-crb-$stream&arch=$basearch&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/CRB/x86_64/os/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h countme=1 enabled=0 [crb-debug] name=CentOS Stream $releasever - CRB - Debug #metalink=https://mirrors.centos.org/metalink?repo=centos-crb-debug-$stream&arch=$basearch&protocol=https,http baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/CRB/x86_64/debug/tree/ gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck=1 repo_gpgcheck=0 metadata_expire=6h enabled=0

4) 更新缓存

yum makecache && yum update

Hyper-v网络适配器的问题

解决办法

1)打开Hyper-v管理界面,创建虚拟交换机

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

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

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

2)配置虚拟机网络交换机

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

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

RedHat下配置静态ip问题

1 Destination Host Unreachable

解决办法有两种

1)方法一:需修改以下三个文件

  • /etc/sysconfig/network
  • /etc/sysconfig/network-scripts/ifcfg-eth0
  • /etc/resolv.conf
$ /etc/sysconfig/network >> NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=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=static ONBOOT=yes #开机自启动 DNS1=8.8.8.8 #Google DNS2=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=eth0 BOOTPROTO=static ONBOOT=yes IPADDR=192.168.2.100 NETMASK=255.255.255.0 GATEWAY=192.168.2.1 DNS1=8.8.8.8 #Google DNS2=114.114.114.114 #国内

3) 重启reboot生效

Redhat无法登录,显示module is unknown

解决办法

A、单用户模式

1)重启系统

  • 运行init6 或 reboot可以直接重启系统,窗口3秒内,然后输入 e
Linux安装和配置问题解决方案

  • 进入以下界面
Linux安装和配置问题解决方案

  • 找到linux16那一行,在行尾添加 init=/bin/sh
  • Ctrl + x
  • 进入单用户模式
Linux安装和配置问题解决方案

  • 可以修改密码,也可以其他操作

2)查看/var/log/secure文件,日志如下:

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

3)/etc/pam.d/login

  • session required /lib/security/pam_limits.so的内容注释掉,或改为/lib64/security/pam_limits.so

4)单用户模式是不允许修改系统文件,解决办法:

  • 将根分区重新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包

http://rpmfind.net/linux/rpm2html/search.php?query=libcrypto.so.10%28OPENSSL_1.0.2%29%2864bit%29&submit=Search+%E2%80%A6&system=&arch=

2、升级openssl

rpm -ivh openssl-libs-1.0.2k-12.el7.x86_64.rpm --force

3、yum -y install nginx

免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://yundeesoft.com/53346.html

(0)
上一篇 2024-08-06 18:00
下一篇 2024-08-06 22:15

相关推荐

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注微信