第1章排错yum安装 学习过程中有一些题是必须通过安装yum 才能完成的 老师让把access.log这个文档拖到文件夹下 不管我怎样就是拖不到里面 进度条不动 放多久就是不动 我就yum install lrzsz 然后它就出现下面错误 是NDS配置的问题 [root@oldboyedu50 ~]#yum install lrzsz Setting up Install Process Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os&infra=stock error was 14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'" Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again 1,配置默认yum源 1)备份 [root@oldboyedu50 ~]#mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup 下载centOS 软件包 [root@oldboyedu50 ~]#wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo --2018-08-23 20:21:49-- http://mirrors.aliyun.com/repo/epel-6.repo Resolving mirrors.aliyun.com... 183.203.69.117, 183.203.69.224, 183.203.69.223, ... Connecting to mirrors.aliyun.com|183.203.69.117|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 664 [application/octet-stream] Saving to: “/etc/yum.repos.d/epel.repo”

100%[=================>] 664 --.-K/s in 0s

2018-08-23 20:21:50 (12.9 MB/s) - “/etc/yum.repos.d/epel.repo” saved [664/664]

进入查看是否有你想要的文件 [root@oldboyedu50 ~]#cd /etc/yum yum/ yum.conf yum.repos.d/ 查看 [root@oldboyedu50 ~]#cd /etc/yum.repos.d/ CentOS-Base.repo CentOS-Media.repo CentOS-Debuginfo.repo CentOS-Vault.repo CentOS-fasttrack.repo epel.repo.backup 编辑网卡配置文件 [root@oldboyedu50 ~]#vi /etc/sysconfig/network-scripts/ ifcfg-eth0 ifup-eth ifcfg-lo ifup-ib ifdown ifup-ippp ifdown-bnep ifup-ipv6 ifdown-eth ifup-isdn ifdown-ib ifup-plip ifdown-ippp ifup-plusb ifdown-ipv6 ifup-post ifdown-isdn ifup-ppp ifdown-post ifup-routes ifdown-ppp ifup-sit ifdown-routes ifup-tunnel ifdown-sit ifup-wireless ifdown-tunnel init.ipv6-global ifup net.hotplug ifup-aliases network-functions ifup-bnep network-functions-ipv6 编辑网卡配置文件 [root@oldboyedu50 ~]#vim /etc/sysconfig/network-scripts/ifcfg-eth0 编辑DNS配置文件 [root@oldboyedu50 ~]#vim /etc/resolv.conf nameserver 223.5.5.5 nameserver 223.6.6.6 增加 这两行网关 重启网络 [root@oldboyedu50 ~]#service network restart Shutting down interface eth0: [ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: Determining if ip address 10.0.0.200 is already in use for device eth0... [ OK ] 首先ping baidu.com 看通不通
[root@oldboyedu50 ~]#ping baidu.com PING baidu.com (220.181.57.216) 56(84) bytes of data. 64 bytes from 220.181.57.216: icmp_seq=1 ttl=128 time=67.1 ms 64 bytes from 220.181.57.216: icmp_seq=2 ttl=128 time=64.9 ms 64 bytes from 220.181.57.216: icmp_seq=3 ttl=128 time=71.3 ms 64 bytes from 220.181.57.216: icmp_seq=4 ttl=128 time=39.2 ms ^C --- baidu.com ping statistics --- 5 packets transmitted, 4 received, 20% packet loss, time 4499ms rtt min/avg/max/mdev = 39.232/60.655/71.319/12.582 ms 安装yum install tree lrzsz [root@oldboyedu50 ~]#yum install tree lrzsz Setting up Install Process base | 3.7 kB 00:00
base/primary_db | 4.7 MB 00:13
epel | 3.2 kB 00:00
epel/primary | 3.2 MB 00:09
epel 12519/12519 extras | 3.4 kB 00:00
extras/primary_db | 25 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 1.2 MB 00:03
Resolving Dependencies --> Running transaction check ---> Package lrzsz.x86_64 0:0.12.20-27.1.el6 will be installed ---> Package tree.x86_64 0:1.5.3-3.el6 will be installed --> Finished Dependency Resolution

Dependencies Resolved

=========================================================== Package Arch Version Repository Size

Installing: lrzsz x86_64 0.12.20-27.1.el6 base 71 k tree x86_64 1.5.3-3.el6 base 36 k

Transaction Summary

Install 2 Package(s)

Total download size: 107 k Installed size: 224 k Is this ok [y/N]: y Downloading Packages: (1/2): lrzsz-0.12.20-27.1.el6.x86_6 | 71 kB 00:00
(2/2): tree-1.5.3-3.el6.x86_64.rpm | 36 kB 00:00

Total 258 kB/s | 107 kB 00:00
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 Importing GPG key 0xC105B9DE: Userid : CentOS-6 Key (CentOS 6 Official Signing Key) centos-6-key@centos.org Package: centos-release-6-9.el6.12.3.x86_64 (@anaconda-CentOS-201703281317.x86_64/6.9) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : tree-1.5.3-3.el6.x86_64 1/2 Installing : lrzsz-0.12.20-27.1.el6.x86_64 2/2 Verifying : lrzsz-0.12.20-27.1.el6.x86_64 1/2 Verifying : tree-1.5.3-3.el6.x86_64 2/2

Installed: lrzsz.x86_64 0:0.12.20-27.1.el6
tree.x86_64 0:1.5.3-3.el6

Complete! 各个步骤下来 终于回到了正常

[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0#网卡设备名称 ONBOOT=yes#启动时是否激活 yes | no BOOTPROTO=static#协议类型 dhcp bootp none IPADDR=192.168.1.90#网络IP地址 NETMASK=255.255.255.0#网络子网地址 GATEWAY=192.168.1.1#网关地址 BROADCAST=192.168.1.255#广播地址 HWADDR=00:0C:29:FE:1A:09#网卡MAC地址 TYPE=Ethernet#网卡类型为以太网 第2章yum安装 2018.8.27 学习过程中 老师让我们查看端口是否开启 输入命令Telnet 10.0.0.200 22 时提示 没有这个命令 然后安装yum install telnet nc mnap -y 是提示没有这个软件包

然后在网上阿里云下载centOS 装了 还安装了epel 再一次安装yum install telnet nc nmap

等再一次查看端口是否开启时 显示打开