我试图在 centos 6 上配置 DHCP。我的 eth0 配置是:
[centos@localhost ~]$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
HWADDR="00:0C:29:AE:62:BC"
MTU="1500"
NM_CONTROLLED="yes"
ONBOOT="yes"
[centos@localhost ~]$
我通过以下方式安装 dhcp:
#yum -y install dhcp
我看到的结果是:
Loaded plugins: fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirror2.hs-esslingen.de
* extras: mirror2.hs-esslingen.de
* updates: ftp.plusline.de
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package dhcp.i686 12:4.1.1-31.0.1.P1.el6.centos.1 set to be updated
--> Processing Dependency: dhcp-common = 12:4.1.1-31.0.1.P1.el6.centos.1 for package:12:dhcp-4.1.1-31.0.1.P1.el6.centos.1.i686
--> Processing Dependency: portreserve for package: 12:dhcp-4.1.1-31.0.1.P1.el6.centos.1.i686
--> Running transaction check
---> Package dhcp-common.i686 12:4.1.1-31.0.1.P1.el6.centos.1 set to be updated
---> Package portreserve.i686 0:0.0.4-9.el6 set to be updated
--> Finished Dependency Resolution
Dependencies Resolved
.
.
.
Install 3 Package(s)
Upgrade 0 Package(s)
Total size: 983 k
Installed size: 2.2 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
file /usr/share/man/man5/dhcp-eval.5.gz from install of dhcp- common-12:4.1.1-31.0.1.P1.el6.centos.1.i686 conflicts with file from package dhclient-12:4.1.1-12.P1.el6.i686
file /usr/share/man/man5/dhcp-options.5.gz from install of dhcp-common-12:4.1.1-31.0.1.P1.el6.centos.1.i686 conflicts with file from package dhclient-12:4.1.1-12.P1.el6.i686
Error Summary
-------------
当我想让 dhcp 服务器在启动时启动我使用代码:
#chkconfig dhcpd on
但我看到错误:
error reading information on service dhcp:No such file or directory
另外,当我进入“ /etc/sysconfig/dhcpd ”目录时,没有任何 dhcpd 文件。有人能帮帮我吗?谢谢。
答案1
看起来你还没有真正安装 dhcp 包,你可以检查一下
yum list installed | grep dhcp
检查包裹
dhcp.x86_64 12:4.1.1-31.0.1.P1.el6.centos.1 @updates
或类似安装。您还应该检查/var/log/yum.log
文件以获取相关信息。
编辑:原帖作者没有注意到 yum install 命令不起作用。这是由于不同软件包中的文件冲突造成的。
yum update dhclient
解决了冲突,从而得以继续前进。