为什么 ping 工作时 apt-get 和 wget 在我的服务器上失败?

klo*_*lox 4 server updates apt

昨天我的服务器还可以,但今天尝试后sudo apt-get update我收到了这个错误:更新过程

我尝试: sudo rm /var/lib/apt/lists/* -vf 并得到了这个。然后再试update一次,但它没有解决我的问题然后显示可能仍然是相同的错误


我检查了我的互联网连接尝试ping google.com,得到结果:

PING google.com (74.125.235.40) 56(84) bytes of data.
From 136.198.117.254: icmp_seq=1 Redirect Network(New nexthop: fw1.jvc-jein.co.id (136.198.117.6))
64 bytes from sin01s05-in-f8.1e100.net (74.125.235.40): icmp_req=1 ttl=53 time=20.6 ms
64 bytes from sin01s05-in-f8.1e100.net (74.125.235.40): icmp_req=2 ttl=53 time=18.2 ms
64 bytes from sin01s05-in-f8.1e100.net (74.125.235.40): icmp_req=3 ttl=53 time=33.0 ms
64 bytes from sin01s05-in-f8.1e100.net (74.125.235.40): icmp_req=4 ttl=53 time=30.0 ms
64 bytes from sin01s05-in-f8.1e100.net (74.125.235.40): icmp_req=5 ttl=53 time=28.1 ms
Run Code Online (Sandbox Code Playgroud)

在一些网站上说可能是它造成的getdeb server is down


尝试安装:

jeinqa@SVRQAR:~$ sudo apt-get install pastebinit
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/security.ubuntu.com_ubuntu_dists_precise-security_restricted_binary-amd64_Packages
E: The package lists or status file could not be parsed or opened.
Run Code Online (Sandbox Code Playgroud)

尝试 :

sudo ufw status verbose
Run Code Online (Sandbox Code Playgroud)

结果 :

Status: inactive
Run Code Online (Sandbox Code Playgroud)

ish*_*ish 5

根据您的简单试图获取谷歌主页,通过测试wget -q -O- http://www.google.com有防火墙FW-1上的机器/域jeinfw这似乎是阻止大多数,如果不是所有出站HTTP访问。(平/ ICMP是一样的HTTP,所以只是因为ping成功并不意味着HTTP也一样)。

apt-get就是失败的原因——而不是它期望的内容,无论是文本、bzip2、gzip 还是 xz,它在请求任何文件时总是从防火墙获得此 HTML 响应

<TITLE>错误</TITLE>
<身体>
<H1>错误</H1>
jeinfw 的 FW-1:访问被拒绝。
</BODY>

要解决此问题:

您需要设置您获得的 HTTP 代理服务器!(我是通过聊天得知的!)

假设服务器是http://139.xxx.xxx.xxx:8080

  • /etc/profile使用sudo nano(或您喜欢的编辑器)打开文件。该文件存储在引导到控制台时初始化的系统范围的变量。

  • 添加以下几行,并进行适当修改。您必须以大写和小写形式进行复制,因为(不幸的是)某些程序只查找其中一个:

    http_proxy=http://139.xxx.xxx.xxx:8080/
    https_proxy=http://139.xxx.xxx.xxx:8080/
    ftp_proxy=http://139.xxx.xxx.xxx:8080/
    no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com"
    HTTP_PROXY=http://139.xxx.xxx.xxx:8080/
    HTTPS_PROXY=http://139.xxx.xxx.xxx:8080/
    FTP_PROXY=http://139.xxx.xxx.xxx:8080/
    NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com"
    

然后,为apt-getUpdate Manager设置代理

  • 这些程序不会遵守环境变量。创建一个名为95proxiesin的文件/etc/apt/apt.conf.d/,并包含以下内容:

    获取::http::proxy "http://139.xxx.xxx.xxx:8080/";
    获取::ftp::proxy "ftp://139.xxx.xxx.xxx:8080/";
    获取::https::proxy "https://139.xxx.xxx.xxx:8080/";
    

最后,重新启动服务器以应用更改。