gpt4 book ai didi

proxy - 如何暂时禁用用于安装软件包的 apt 代理设置

转载 作者:行者123 更新时间:2023-12-05 08:31:47 27 4
gpt4 key购买 nike

Apt 能够使用代理来安装附加包和依赖项。我正在处理一个 Python 项目,我需要一些额外的包来提供一个库。

---> sudo apt-get update
Err:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Could not resolve 'proxy.internal'
Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
Could not resolve 'proxy.internal'
Err:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'proxy.internal'
Err:4 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Could not resolve 'proxy.internal'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease Could not resolve 'proxy.internal'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease Could not resolve 'proxy.internal'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease Could not resolve 'proxy.internal'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease Could not resolve 'proxy.internal'
W: Some index files failed to download. They have been ignored, or old ones used instead.

如何暂时禁用代理(不改变永久选项/设置)?最好从命令行。

最佳答案

暂时禁用代理配置而不改变永久设置的最快方法是使用如下命令行选项:

sudo apt-get -o Acquire::http::proxy=false install <package>

这使用户可以通过代理在开放/公共(public)/家庭网络和公司环境之间移动。来自手册页:

   -o, --option
Set a Configuration Option; This will set an arbitrary configuration option. The syntax is -o
Foo::Bar=bar. -o and --option can be used multiple times to set different options.

关于proxy - 如何暂时禁用用于安装软件包的 apt 代理设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55697602/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com