我是linux新手,刚刚开始使用debian。我尝试安装 g++,通过
apt-get install g++
但是没有成功
root@HP:/home/krzysztof# apt-get install g++
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
g++-6 libstdc++-6-dev
Suggested packages:
g++-multilib g++-6-multilib gcc-6-doc libstdc++6-6-dbg libstdc++-6-doc
The following NEW packages will be installed:
g++ g++-6 libstdc++-6-dev
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,516 kB of archives.
After this operation, 39.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://ftp.pl.debian.org/debian stretch/main amd64 libstdc++-6-dev amd64 6.3.0-18+deb9u1
Unsupported proxy configured: 127.0.0.1://8888
Ign:2 http://ftp.pl.debian.org/debian stretch/main amd64 g++-6 amd64 6.3.0-18+deb9u1
Err:3 http://ftp.pl.debian.org/debian stretch/main amd64 g++ amd64 4:6.3.0-4
Unsupported proxy configured: 127.0.0.1://8888
Err:1 http://security.debian.org/debian-security stretch/updates/main amd64 libstdc++-6-dev amd64 6.3.0-18+deb9u1
Unsupported proxy configured: 127.0.0.1://8888
Err:2 http://security.debian.org/debian-security stretch/updates/main amd64 g++-6 amd64 6.3.0-18+deb9u1
Unsupported proxy configured: 127.0.0.1://8888
E: Failed to fetch http://security.debian.org/debian- security/pool/updates/main/g/gcc-6/libstdc++-6-dev_6.3.0-18+deb9u1_amd64.deb Unsupported proxy configured: 127.0.0.1://8888
E: Failed to fetch http://security.debian.org/debian- security/pool/updates/main/g/gcc-6/g++-6_6.3.0-18+deb9u1_amd64.deb Unsupported proxy configured: 127.0.0.1://8888
E: Failed to fetch http://ftp.pl.debian.org/debian/pool/main/g/gcc- defaults/g++_6.3.0-4_amd64.deb Unsupported proxy configured: 127.0.0.1://8888
E: Unable to fetch some archives, maybe run apt-get update or try with -- fix-missing?
//
表明您已将 http://
留在代理配置的开头。 Apt 将地址的第一部分解释为 URL 方案。例如设置
:
会给出错误
Acquire::http::Proxy "127.0.0.1:8888/"
,而
Unsupported proxy configured: 127.0.0.1://8888
将正确设置代理。
在
Apt 配置文件 Acquire::http::Proxy "http://127.0.0.1:8888/"
中定义此设置(文件名由您决定,但它们按排序顺序加载)。您也可以使用
/etc/apt/apt.conf.d/00proxy
但这已被弃用。/etc/apt/apt.conf
和
http_proxy
设置了环境变量。在这里检查它们:
https_proxy
然后取消它们:
echo $http_proxy
echo $https_proxy
unset $http_proxy
unset $https_proxy
配置的代理不受支持:127.0.0.1://8888
所以看来您(或其他人)配置了一个虚假的代理服务器,它很可能应该显示为
"http://<IP>:<PORT>/";
(没有斜杠(
127.0.0.1:8888
)。您需要在
(
apt.conf(5)
或 /etc/apt/apt.conf
)中或通过 /etc/apt/apt.conf.d/
环境变量更改这些值。