我是靠谱客的博主 害羞丝袜,最近开发中收集的这篇文章主要介绍五(1)、Linux遇到的问题,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

1、虚拟机上yum 安装yum install telnet
报错1no more mirrors to try
尝试1:
按照网上找的方法:
yum clean all
yum makecache
yum -y update
但是在第二步的时候,就报另外一个错:
Cannot find a valid baseurl for repo: base/7/x86_64
又找到网上说的解决这个问题的方法:去掉(重命名)/etc/yum.repos.d/CentOS-Base.repo
但是报错2:http://ip地址/cm6.0.1/repodata/repomd.xml: [Errno 14] curl#7 - "Failed connect to 192.168.5.128:80; Connection refused
但是把CentOS-Base.repo回原之后,还是报这个错,为了解决这个问题,用的是下面这个链接里面的方法:
https://www.cnblogs.com/horizonli/p/9553919.html

解决方法:

step 1)

# cd /etc/yum.repos.d/
# vim CentOS-Base.repo
:%s/$releasever/7.4.1708/g
==>替换掉为真实的版本

step 2)

sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/CentOS-Base.repo

step 3)

yum clean all
yum makecache

没有报错2,但是还在报错1
尝试2:
查看是否能够ping通外网,发现ping不通,囧n
查看network配置文件,将BOOTPROTO从动态改为静态,尤其不能漏了IPADDR、GATEWAY、DNS1,漏了就连不上外网了
TYPE=“Ethernet”
PROXY_METHOD=“none”
BROWSER_ONLY=“no”
BOOTPROTO=“static
DEFROUTE=“yes”
IPV4_FAILURE_FATAL=“no”
IPV6INIT=“yes”
IPV6_AUTOCONF=“yes”
IPV6_DEFROUTE=“yes”
IPV6_FAILURE_FATAL=“no”
IPV6_ADDR_GEN_MODE=“stable-privacy”
NAME=“ens33”
UUID=“7233d4da-8db9-4d4a-a355-e320a91376d8”
DEVICE=“ens33”
ONBOOT=“yes”
IPADDR=192.168.5.128
GATEWAY=192.168.5.2
DNS1=114.114.114.114

但是还是报错2,有时候按照网上的修改了repo文件之后又会报错1,所以网上找到的方法不是我现在出的问题。

最后解决办法:
发现我的httpd是dead状态,而我是用httpd做的yum源。
于是我把repo文件还原,接着把httpd开了,然后再yum clean all、yum makecache,就能正常使用yum了,能正常安装其他软件了。

2、安装mail,发邮件:
echo “hhhh” | mail -s “Hello from Linux Server by shell” xxxx@xxx.com
报错:

[root@hadoop-mysql1 mail]# Error initializing NSS: Unknown error -8015.
"/root/dead.letter" 11/334
. . . message not sent.

3、不能连外网的阿里云机器,安装了postfix之后,查看状态的时候报错:

[root@bigdata02 outdata]# systemctl status postfix
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2019-04-12 14:45:21 CST; 3 weeks 4 days ago
Apr 12 14:45:19 bigdata02 systemd[1]: Starting Postfix Mail Transport Agent...
Apr 12 14:45:19 bigdata02 aliasesdb[903]: /usr/sbin/postconf: fatal: parameter inet_interfaces: no local interface found for ::1
Apr 12 14:45:20 bigdata02 aliasesdb[903]: newaliases: fatal: parameter inet_interfaces: no local interface found for ::1
**Apr 12 14:45:20 bigdata02 postfix/sendmail[3782]: fatal: parameter inet_interfaces: no local interface found for ::1**
Apr 12 14:45:20 bigdata02 postfix[3807]: fatal: parameter inet_interfaces: no local interface found for ::1
Apr 12 14:45:21 bigdata02 systemd[1]: postfix.service: control process exited, code=exited status=1
Apr 12 14:45:21 bigdata02 systemd[1]: Failed to start Postfix Mail Transport Agent.
Apr 12 14:45:21 bigdata02 systemd[1]: Unit postfix.service entered failed state.
Apr 12 14:45:21 bigdata02 systemd[1]: postfix.service failed.

解决办法:修改/etc/postfix/main.cf文件:
将“inet_interfaces = localhost” 修改为“inet_interfaces = all”,再重新启动postfix:systemctl restart postfix

最后

以上就是害羞丝袜为你收集整理的五(1)、Linux遇到的问题的全部内容,希望文章能够帮你解决五(1)、Linux遇到的问题所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(45)

评论列表共有 0 条评论

立即
投稿
返回
顶部