本文共 1827 字,大约阅读时间需要 6 分钟。
首先,我们使用centos一般使用yum安装文件,其条件:
1:必须能接入互联网;()
2:有yum功能插件。(可手动下载安装)
注:没有ifconfig可以用ip addr和ip link可以查看,使用ifconfig:
需要安装“net-tools”,执行下命令,会报错:
扩展功能:
网络:net-tools
编辑器[option]:vim
编译器:c/c++: gcc /gcc-c++
[root@localhost ~]# yum install -y net-tools
One of the configured repositories failed (未知), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: .... Cannot find a valid baseurl for repo: base/7/x86_64
解决:
在域名服务器配置中,添加一个8.8.8.8(或者其他),就解决了:# vi /etc/resolv.conf add:#Generated by NetworkManager nameserver 8.8.8.8之后,yum使用正常。
yum更新失败问题解决:
安装vim,编辑文本:
[root@localhost ~]# yum -y install vim*
vim安装问题失败:
安装GCC软件套件,C语言编写程序运行:
[root@localhost sshpass-1.05]# ./configure
checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /usr/bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking for style of include used by make... GNU checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/home/install-files/sshpass-1.05': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details[root@localhost ~]# yum install gcc
[root@localhost ~]# yum -y install gcc-c++
[root@Master scripts]# yum install -y perl-Module-Install.noarch
设置ip错误1:
CentOS Linux解决Device eth0 does not seem to be present
Bringing up interface eth0: Device eth0 does not seem to be present,delaying initialization.
解决:
cd /etc/udev/rules.d/70-persistent-net.rules记录eth1网卡的mac地址00:0c:29:50:bd:17cd //etc/sysconfig/network-scripts/ifcfg-eth0将 DEVICE="eth0" 改成 DEVICE="eth1" ,将 HWADDR="00:0c:29:8f:89:97" 改成上面的mac地址 HWADDR="00:0c:29:50:bd:17"重启网络: service network restart