Centos6.6安装后一些常见问题详解

前端之家收集整理的这篇文章主要介绍了Centos6.6安装后一些常见问题详解前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

<>centos6.6通过VM最小化安装后上不了网的解决方法

在安装centos6.6时,没有在网络设置中设置网卡自动启动的,安装完系统后,是不能联网的,解决方法如下:

vi/etc/sysconfig/network-scripts/ifcfg-eth0

把里面的ONBOOTno 改成yes

/etc/init.d/network restart 重启网络就可以了


<>Centos6.6通过VM最小化安装后,找不到网卡,通过配置eth0后也上不了网的解决方法

在学习centos6.6时,我们通过VM安装Centos6.6系统来学习,在实验中需要用到多台服务器来进行实验,但增加一个服务器都重装一次系统太浪费时间了,我们可以通过VM的克隆方法添加多台服务器,但问题出现了:为Centos6.6创建VMWare的虚拟机后,复制,创建一个新的克隆镜像,启动和配置网卡无效。

1.配置ifcfg-eth0文件

[root@MrXiong ~]# vim/etc/sysconfig/network-scripts/ifcfg-eth0

ONBOOT=no 改成yes

保存退出

/etc/init.d/network restart 重启网络报错,

2. [root@ MrXiong ~]# ifconfig 显示不到eth0信息

3.[root@ MrXiong ~]# ifup eth0 出错device eth0does not seem to be present,delaying initialization


经过度娘和谷哥的帮助,找到原因是:

新克隆的虚拟机镜像的网卡mac地址已经变更。打开虚拟机的.vmx文件ethernet0.generatedAddress项记录了该虚拟机的mac地址。


解决方法

编辑如下文件
vim /etc/udev/rules.d/70-persistent-net.rules

一般文件内容是这样的:

#Thisfilewasautomaticallygeneratedbythe/lib/udev/write_net_rules
#program,runbythepersistent-net-generator.rulesrulesfile.
#
#Youcanmodifyit,aslongasyoukeepeachruleonasingle
#line,andchangeonlythevalueoftheNAME=key.

#PCIdevice0x8086:0x100f(e1000)
SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:20:ea:34",ATTR{type}=="1",KERNEL=="eth*",NAME="eth0"

#PCIdevice0x15ad:0x07b0(vmxnet3)
SUBSYSTEM=="net",ATTR{address}=="00:0c:29:5b:63:e3",NAME="eth1"

注释掉eth0的那个段落,然后将eth1修改eth0

修改完后如下:

#Thisfilewasautomaticallygeneratedbythe/lib/udev/write_net_rules
#program,andchangeonlythevalueoftheNAME=key.

#PCIdevice0x8086:0x100f(e1000)
#SUBSYSTEM=="net",NAME="eth0"

编辑vim /etc/sysconfig/network-scripts/ifcfg-eth0

HWADDR地正改成上面新的eth0 MAC地址

HWADDR=00:0c:29:5b:63:e3

保存退出

reboot重启服务器后生效

现在用ifconfig 可以查看到eth0相关信息


<>、新安装centos6.6最少安装后,从163网站下载yum本置文件时出现wget命令不能使用的解决方法

centos6.6中,wget是默认安装了,可以直接使用wget来下载,但在6.6最小化安装后,wget是默认没有安装的。

[root@MrXiongyum.repos.d]#wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo
-bash:wget:commandnotfound

通过本地yum安装wget

[root@MrXiongyum.repos.d]#yuminstallwget

安装wget后,我们就可以通过wget下载163yum

首先备份/etc/yum.repos.d/CentOS-Base.repo

[root@MrXiong/]mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup

下载对应版本repo文件,放入/etc/yum.repos.d/(操作前请做好相应备份)

[root@MrXiong/]#cd/etc/yum.repos.d/
[root@MrXiongyum.repos.d]#wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@MrXiongyum.repos.d]#mvCentOS6-Base-163.repoCentOS-Base.repo
[root@MrXiongyum.repos.d]yumcleanall
[root@MrXiongyum.repos.d]yummakecache


<>centos6.6安装setup命令

centos5.8中,我们可以通过setup命令来对firewallnetwork,system services等进行配置

wKiom1jUvc6SLdETAAA78eGD8v0957.png

但在centos6.6最小化安装后,发觉setup命令不管用,从网上度娘和谷哥了一下,发现centos6.6最小化安装,没有把setuptool安装上去,我们可以通过以下方法解决

我们可以通过

yum install setuptool �Cy

yum install system-config-firewall-tui �Cy

install system-config-network-tui �Cy

yum install ntsysv �Cy

安装完上面几个rpm包后,就会出现我们熟悉的setup字符图形界面。

wKiom1jUvdzCQMM2AAAcBPFO4-E449.png

然后我们可以通过以上熟悉的界面来设置IP,route,dns



<>centos6.6 与网络时间服务器ntp同步使用ntpdate命令出错

5.8中,我们使用ntpdate time.nist.gov进行时间效对,但我安装了最小化centos6.6后,发现无论使用/usr/sbin/ntpdate time.nist.gov还是直接ntpdate time.nist.gov都出现错误

[root@MrXiong~]#cat/etc/redhat-release
CentOSrelease6.6(Final)
[root@MrXiong~]#ntpdatetime.nist.gov
-bash:ntpdate:commandnotfound
[root@MrXiong~]#/usr/sbin/ntpdatetime.nist.gov
-bash:/usr/sbin/ntpdate:Nosuchfileordirectory

解决方法

通过yum安装ntpdate

[root@MrXiong~]#yuminstallntpdate�Cy

安装完后,就可以使用ntpdate命令进行时间效对

[root@MrXiong~]#ntpdatetime.nist.gov
7Nov02:01:14ntpdate[4878]:steptimeserver206.246.122.250offset-28812.162590sec


<>centos6.6安装mini后通过yum安装man命令

[root@MrXiong~]#yuminstallman-y
Loadedplugins:fastestmirror
Loadingmirrorspeedsfromcachedhostfile
*base:mirrors.grandcloud.cn
*extras:mirrors.grandcloud.cn
*updates:mirrors.grandcloud.cn
base|3.7kB00:00
原文链接:https://www.f2er.com/centos/378233.html

猜你在找的CentOS相关文章