![在 ubuntu 17.10 上配置代理设置的困难](https://linux22.com/image/1151812/%E5%9C%A8%20ubuntu%2017.10%20%E4%B8%8A%E9%85%8D%E7%BD%AE%E4%BB%A3%E7%90%86%E8%AE%BE%E7%BD%AE%E7%9A%84%E5%9B%B0%E9%9A%BE.png)
我正在尝试使用设置代理服务器gksudo gedit /etc/apt/apt.conf
并尝试添加以下命令‘apt-get’ 无法与代理配合使用
Acquire::http::Proxy "http://user:pass@proxy-host:port/";
Acquire::ftp::Proxy "http://user:pass@proxy-host:port/";
当我尝试这个时,终端上出现了一条消息
/usr/share/themes/Ambiance/gtk-2.0/apps/mate-panel.rc:30: error: invalid string constant "murrine-scrollbar", expected valid string constant
Error copying '/home/dipesh/.Xauthority' to '/tmp/libgksu-FU5d7j': No such file or directory
屏幕上显示一条消息
Failed to run gedit '/etc/apt/apt.conf' as user root.
Unable to copy the user's Xauthorization file.
当我手动尝试添加apt.conf
文件时,它拒绝发送消息
您没有保存文件所需的权限。请检查您输入的位置是否正确,然后重试。
当我尝试这个时它有效
sudo env http_proxy=http://<ip>:<port> apt-get update
但sudo apt-get update
或
sudo add-apt-repository ppa:webupd8team/sublime-text-3
或
sudo env http_proxy=http://10.7.0.1:8080 apt-repository ppa:webupd8team/sublime-text-3
不起作用。
我是 Ubuntu 新手,请帮忙!
答案1
尝试这个
# create file:
sudo vim /etc/apt/apt.conf.d/80proxy
# with this inside file
Acquire::http::Proxy "http://user:pass@proxy-host:port/";