yum安裝中出現的問題總結

第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) <[email protected]>
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
yum安裝中出現的問題總結10.0.0.200 22 時提示 沒有這個命令
yum安裝中出現的問題總結
然後安裝yum install telnet nc mnap -y 是提示沒有這個軟件包

然後在網上阿里雲下載centOS 裝了
yum安裝中出現的問題總結
還安裝了epel
yum安裝中出現的問題總結
再一次安裝yum install telnet nc nmap
yum安裝中出現的問題總結

等再一次查看端口是否開啓時 顯示打開
yum安裝中出現的問題總結

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章