我在笔记本电脑在 wifi 网络上,以某种方式强制使用代理,而无需对其进行配置。每当我尝试时,apt-get update
我都会收到以下错误:
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [2827 B]
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [2835 B]
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [2836 B]
Err:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched 8498 B in 0s (11.7 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.
安装包会返回如下错误:
Err:12 http://archive.ubuntu.com/ubuntu xenial/universe amd64 cabextract amd64 1.6-1
Hash Sum mismatch
我已经尝试设置http-proxy
变量使用我的用户名和密码毫无效果。代理也做同样的事情。
有什么方法可以阻止它做正在做的事情吗?
有人知道NOSPLIT
是什么吗?(如果知道,可以评论一下吗?)
这不是这些问题的重复:
遇到 NODATA 问题:“NODATA”(网络是否需要身份验证?)
因为他们的答案不起作用。
坦白说,我的组织并不关心他们的代理是否干扰了我安装软件,因为我是唯一一个尝试这样做的人,所以问他们是不可能的。此外,我没有遇到与 NODATA 问题相同的问题,因为wget -O - http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
返回
--2016-11-11 12:20:26-- http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
Resolving extras.ubuntu.com (extras.ubuntu.com)... 91.189.92.152, 2001:67c:1360:8c01::23
Connecting to extras.ubuntu.com (extras.ubuntu.com)|91.189.92.152|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-11-11 12:20:27 ERROR 404: Not Found.
答案1
将我的 apt 源从 http 更改为 https 解决了该问题。
我最好的猜测是,代理配置为在 https 上的行为与在 http 上的行为不同,并且它没有尝试将重定向注入 https 响应。
请注意,要通过 apt 使用 https,您必须apt-transport-https
安装该包。
答案2
我按照以下步骤操作,成功让我的 ubuntu VM 正常运行
https://help.ubuntu.com/community/AptGet/Howto#Setting_up_apt-get_to_use_a_http-proxy
export http_proxy=http://proxy.server:8080
sudo -E apt-get update
sudo -E apt-get install etc...
关键点是我正在运行 apt-get,但以 ubuntu 用户身份sudo
设置环境变量http_proxy