我有以下设置:
通过将环境变量设置http_proxy为我们的代理,我能够为用户 vagrant 配置 VBox 图像以访问互联网。但是,当我尝试在 shell 配置器中设置代理时,我遇到了问题。以下是定义代理的脚本部分,以及首次访问互联网的部分:
# Base setup proxy and DISPLAY
set HTTP_PROXY=http://proxy.name.com:8080
echo "Add proxy to necessary parts"
echo 'export http_proxy=http://proxy.name.com:8080' >> ~vagrant/.bash_profile
echo 'export DISPLAY=192.168.137.1:0.0' >> ~vagrant/.bash_profile
echo 'export http_proxy=http://proxy.name.com:8080' >> /root/.bash_profile
export http_proxy=$HTTP_PROXY
# Install Git
echo "Install Git"
apt-get update
apt-get install -y git
...
Run Code Online (Sandbox Code Playgroud)
但是,我得到以下输出:
Add proxy to necessary parts
Install Git
Err http://security.ubuntu.com trusty-security InRelease
Err http://archive.ubuntu.com trusty InRelease …Run Code Online (Sandbox Code Playgroud)