我在一个数据中心有一个 CentOS 7 服务器(服务器 X),它有一个我不能做 yum 的防火墙:
# yum search htop
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
* base: mirrors.163.com
* extras: mirrors.shu.edu.cn
* updates: ftp.sjtu.edu.cn
Warning: No matches found for: htop
No matches found
而且数据中心没有为我提供代理服务器来安装任何东西。
但是,我可以通过 Internet + VPN 从家用计算机 ssh 到服务器 X。
我只是想知道是否有办法利用 ssh 连接到 yum 安装包(或任何其他 yum 安装包的方法)。
这篇文章建议人们只使用 RPM 或 DVD 安装。
我认为如果没有任何依赖关系,从 RPM 安装很简单,但处理依赖关系会很麻烦。
欢迎任何建议。
提前致谢!
更新 1:我什至无法 ping mirrorlist.centos.org 的 IP(虽然它是可 ping 的):
# ping 85.236.43.108
PING 85.236.43.108 (85.236.43.108) 56(84) bytes of data.
^C
--- 85.236.43.108 ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 1999ms
所以DNS解析不是根本原因。
Traceroute 表示流量被阻塞:
# traceroute 85.236.43.108
traceroute to 85.236.43.108 (85.236.43.108), 30 hops max, 60 byte packets
1 gateway (172.18.22.254) 3.884 ms 4.100 ms 4.322 ms
2 gateway (172.18.22.254) 3.200 ms !H * *
它不能出去,因为数据中心有防火墙。Server X 本身没有防火墙,也没有 iptable 来防止外出。
更新 2:下载 rpms 和 rsync-ing 然后安装失败
# yum localinstall /tmp/audit-libs-2.8.1-3.el7.x86_64.rpm --disablerepo=*
Loaded plugins: fastestmirror
Examining /tmp/audit-libs-2.8.1-3.el7.x86_64.rpm: audit-libs-2.8.1-3.el7.x86_64
Marking /tmp/audit-libs-2.8.1-3.el7.x86_64.rpm as an update to audit-libs-2.7.6-3.el7.x86_64
Resolving Dependencies
--> Running transaction check
---> Package audit-libs.x86_64 0:2.7.6-3.el7 will be updated
--> Processing Dependency: audit-libs(x86-64) = 2.7.6-3.el7 for package: audit-2.7.6-3.el7.x86_64
Loading mirror speeds from cached hostfile
---> Package audit-libs.x86_64 0:2.8.1-3.el7 will be an update
--> Finished Dependency Resolution
Error: Package: audit-2.7.6-3.el7.x86_64 (@anaconda)
Requires: audit-libs(x86-64) = 2.7.6-3.el7
Removing: audit-libs-2.7.6-3.el7.x86_64 (@anaconda)
audit-libs(x86-64) = 2.7.6-3.el7
Updated By: audit-libs-2.8.1-3.el7.x86_64 (/audit-libs-2.8.1-3.el7.x86_64)
audit-libs(x86-64) = 2.8.1-3.el7
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
确保您已通过防火墙允许相关且已建立的连接,否则响应将无法返回