oracle linux 7 yum报错解决:COULD NOT RESOLVE HOST: YUM.ORACLE.COM

虚拟机中yum报错

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
[root@localhost ~]# yum -y install oracle-rdbms-server-11gR2-preinstall
Loaded plugins: langpacks, ulninfo
Resolving Dependencies
--> Running transaction check
---> Package oracle-rdbms-server-11gR2-preinstall.x86_64 0:1.0-6.el7 will be installed
--> Processing Dependency: gcc for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
--> Processing Dependency: gcc-c++ for package: oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64
 
( many more lines suppressed )
 
compat-libstdc++-33-3.2.3-72.e FAILED                                         
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/compat-libstdc%2B%2B-33-3.2.3-72.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Unknown error"
Trying other mirror.
compat-libcap1-1.10-7.el7.x86_ FAILED                                         
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/compat-libcap1-1.10-7.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Unknown error"
Trying other mirror.
cpp-4.8.5-36.0.1.el7.x86_64.rp FAILED                                         
https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/cpp-4.8.5-36.0.1.el7.x86_64.rpm: [Errno 14] curl#6 - "Could not resolve host: yum.oracle.com; Unknown error"ETA
Trying other mirror.
warning: /var/cache/yum/x86_64/7Server/ol7_latest/packages/gcc-4.8.5-36.0.1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY ] 1.1 MB/s |  16 MB  00:00:36 ETA
Public key for gcc-4.8.5-36.0.1.el7.x86_64.rpm is not installed
(1/14): gcc-4.8.5-36.0.1.el7.x86_64.rpm                                                                                                                       |  16 MB  00:00:26    
(2/14): gcc-c++-4.8.5-36.0.1.el7.x86_64.rpm                                                                                                                   | 7.2 MB  00:00:06    
(3/14): glibc-2.17-260.0.15.el7_6.3.x86_64.rpm                                                                                                                | 3.7 MB  00:00:03    
(4/14): glibc-common-2.17-260.0.15.el7_6.3.x86_64.rpm                                                                                                         |  12 MB  00:00:10    
(5/14): glibc-devel-2.17-260.0.15.el7_6.3.x86_64.rpm                                                                                                          | 1.1 MB  00:00:01    
(6/14): glibc-headers-2.17-260.0.15.el7_6.3.x86_64.rpm                                                                                                        | 685 kB  00:00:00    
(7/14): kernel-headers-3.10.0-957.5.1.el7.x86_64.rpm                                                                                                          | 8.0 MB  00:00:06    
(8/14): ksh-20120801-139.0.1.el7.x86_64.rpm                                                                                                                   | 883 kB  00:00:00    
(9/14): libaio-devel-0.3.109-13.el7.x86_64.rpm                                                                                                                |  12 kB  00:00:00    
(10/14): libstdc++-devel-4.8.5-36.0.1.el7.x86_64.rpm                                                                                                          | 1.5 MB  00:00:01    
(11/14): oracle-rdbms-server-11gR2-preinstall-1.0-6.el7.x86_64.rpm                                                                                            |  22 kB  00:00:00    
 
 
Error downloading packages:
  cpp-4.8.5-36.0.1.el7.x86_64: [Errno 256] No more mirrors to try.
  compat-libcap1-1.10-7.el7.x86_64: [Errno 256] No more mirrors to try.
  compat-libstdc++-33-3.2.3-72.el7.x86_64: [Errno 256] No more mirrors to try.
 
[root@localhost ~]#

出现这个的原因是虚拟机中的主机网关不能dns到,加8.8.8.8作为dns即可

1
2
3
4
[root@localhost ~]# vim /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.0.1.2
nameserver 8.8.8.8
posted @   九命猫幺  阅读(3340)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· 字符编码:从基础到乱码解决
点击右上角即可分享
微信分享提示