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


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

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

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

    把里面的ONBOOT=no  改成yes

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

    百牛信息技术bainiu.ltd整理发布于博客园

    <二>、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

    一般文件内容是这样的:

    # This file was automatically generated by the/lib/udev/write_net_rules
    # program, run by thepersistent-net-generator.rules rules file.
    #
    # You can modify it, as long as you keep eachrule on a single
    # line, and change only the value of the NAME=key.
    
    # PCI device 0x8086:0x100f (e1000)
    SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:20:ea:34",ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
    
    # PCI device 0x15ad:0x07b0 (vmxnet3)
    SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:5b:63:e3",ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

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

    修改完后如下:

    # This filewas automatically generated by the /lib/udev/write_net_rules
    # program, run by thepersistent-net-generator.rules rules file.
    #
    # You can modify it, as long as you keep eachrule on a single
    # line, and change only the value of the NAME=key.
    
    # PCI device 0x8086:0x100f (e1000)
    #SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:20:ea:34",ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
    
    # PCI device 0x15ad:0x07b0 (vmxnet3)
    SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="00:0c:29:5b:63:e3",ATTR{type}=="1", KERNEL=="eth*", 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@MrXiong yum.repos.d]# wgethttp://mirrors.163.com/.help/CentOS6-Base-163.repo
    -bash: wget: command not found

    通过本地yum安装wget

    [root@MrXiong yum.repos.d]# yum installwget

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

    首先备份/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@MrXiong yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
    [root@MrXiong yum.repos.d]# mvCentOS6-Base-163.repo CentOS-Base.repo
    [root@MrXiong yum.repos.d]yum clean all
    [root@MrXiong yum.repos.d]yum makecache

    <四>centos6.6安装setup命令

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

    技术分享

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

    我们可以通过

    yum install setuptool –y

    yum install system-config-firewall-tui –y

    install system-config-network-tui –y

    yum install ntsysv –y

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

    技术分享

    然后我们可以通过以上熟悉的界面来设置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
    CentOS release 6.6 (Final)
    [root@MrXiong ~]# ntpdatetime.nist.gov      
    -bash: ntpdate: command not found
    [root@MrXiong ~]# /usr/sbin/ntpdatetime.nist.gov
    -bash: /usr/sbin/ntpdate: No such file ordirectory

    解决方法:

    通过yum安装ntpdate

    [root@MrXiong ~]# yum install ntpdate –y

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

    [root@MrXiong ~]# ntpdate time.nist.gov
     7Nov 02:01:14 ntpdate[4878]: step time server 206.246.122.250 offset-28812.162590 sec

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

    [root@MrXiong ~]# yum install man -y
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     *base: mirrors.grandcloud.cn
     *extras: mirrors.grandcloud.cn
     *updates: mirrors.grandcloud.cn
    base                                       | 3.7kB     00:00
  • 相关阅读:
    Java开发环境搭建
    MySQL优化
    js正则表达式,验证身份证
    获取urlc参数
    Oracle解锁
    Qt 常用类 (4)—— QPoint
    Qt 常用类——QStandardItemModel
    Qt QTableWidget用法总结
    Qt 随机数
    C++ static类成员,static类成员函数
  • 原文地址:https://www.cnblogs.com/bainiu/p/7543679.html
Copyright © 2020-2023  润新知