我在手工添加存储库时做sudo apt update
( nodejs
和docker
有问题)在运行在VirtualBox
中的Ubuntu 17.10 VM
时有问题。我得到的错误是Could not handshake: An unexpected TLS packet was received
。
下面是我在尝试添加docker
存储库和输出时所采取的步骤。在我尝试添加nodejs
时,也发生了同样的事情。
sdnc-dev@sdncdev-VirtualBox:~/tools/idea-IC-173.4674.33/bin$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
OK
sdnc-dev@sdncdev-VirtualBox:~/tools/idea-IC-173.4674.33/bin$ sudo apt-key fingerprint 0EBFCD88
pub rsa4096 2017-02-22 [SCEA]
9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
uid [ unknown] Docker Release (CE deb)
sub rsa4096 2017-02-22 [S]
sdnc-dev@sdncdev-VirtualBox:~/tools/idea-IC-173.4674.33/bin$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
[sudo] password for sdnc-dev:
sdnc-dev@sdncdev-VirtualBox:~/tools/idea-IC-173.4674.33/bin$ sudo apt update
Ign:1 https://download.docker.com/linux/ubuntu artful InRelease
Err:2 https://download.docker.com/linux/ubuntu artful Release
Could not handshake: An unexpected TLS packet was received.
Hit:3 http://us.archive.ubuntu.com/ubuntu artful InRelease
Get:4 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu artful-updates InRelease [78.6 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu artful-backports InRelease [72.2 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages [226 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu artful-updates/main i386 Packages [222 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu artful-updates/main Translation-en [101 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu artful-updates/universe i386 Packages [91.9 kB]
Get:11 http://us.archive.ubuntu.com/ubuntu artful-updates/universe amd64 Packages [92.8 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu artful-updates/universe Translation-en [52.9 kB]
Reading package lists... Done
E: The repository 'https://download.docker.com/linux/ubuntu artful Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
下面是我设置的详细信息:
VM: Ubuntu 17.10
VirtualBox 5.2.8 r121009 (Qt5.6.2)
I am behind corporate proxy.
有人知道怎么解决这个问题吗?
发布于 2018-03-14 19:57:36
检查是否也为https设置了代理。由于curl
正在使用https,所以我假设,在某个地方设置了一个https_proxy
变量(例如~/.bashrc
)。apt
需要/etc/apt/apt.conf
或/etc/apt/apt.conf.d/
中的代理配置。您需要为所有协议指定代理:
# e.g. in file /etc/apt/apt.conf.d/05proxy
Acquire::http::proxy "http://192.168.0.1:3128/";
Acquire::https::proxy "http://192.168.0.1:3128/";
Acquire::ftp::proxy "http://192.168.0.1:3128/";
还请记住,如果只为sdnc-dev
用户设置了代理配置,则需要sudo -E
向根用户公开环境。
发布于 2020-11-04 22:15:01
在使用Ubuntu20.04LTS时,我在使用apt-get update
时也遇到了同样的错误。我在安装过程中配置了代理,这样代理urls就在/etc/apt/apt.conf.d/05proxy
中了。
在我的例子中,我错误地配置了代理URL (用于我的组织),需要编辑05proxy
并将https://proxy.mydom.it
更改为http://proxy.mydom.it
配置错误:
Acquire::http::proxy "https://proxy.mydom.it:8080";
Acquire::https::proxy "https://proxy.mydom.it:8080";
配置良好:
Acquire::http::proxy "http://proxy.mydom.it:8080";
Acquire::https::proxy "http://proxy.mydom.it:8080";
将https转换为http,在我的例子中,修复了TLS错误。
发布于 2020-08-26 15:13:16
这个答案在我的案例中解决了:https://stackoverflow.com/a/60274085/486564
如果您在代理服务器后面,请将代理设置为curl。curl无法连接到服务器,因此显示错误的版本号。通过打开subl ~/..curlrc或使用任何其他文本编辑器来设置代理。然后将以下行添加到文件中: proxy= proxyserver:proxyport,例如proxy = 10.8.0.1:8080,如果您不在代理后面,请确保curlrc文件不包含代理设置。
https://askubuntu.com/questions/1014973
复制相似问题