
프록시 뒤에서 작동하도록 apt-get을 어떻게 설정할 수 있습니까?
답변1
http_proxy="http://host:port" apt-get something
작동해야합니다.
인증이 필요한 경우 시도해 보세요.
http_proxy="http://user:pass@host:port" apt-get something
그리고 이것이 영구적이기를 원한다면, ~/.bashrc
모든 프록시 가능 애플리케이션이 미래에 작동할 수 있도록 http_proxy(및 ftp_proxy?) 변수를 설정해야 합니다(예: 'wget').
답변2
/etc/apt/apt.conf에 다음 줄을 추가합니다.
Acquire::http::Proxy "http://MYDOMAIN\MYNAME:[email protected]:MYPORT"
답변3
프록시는 로컬(예: ) 또는 전역(예: )으로 및 환경 변수 http_proxy
를 설정하여 지정됩니다 . 이러한 설정은 사실상 모든 넷 소프트웨어 패키지(apt-get, wget, 컬 등)에서 적용됩니다.ftp_proxy
all_proxy
~/.bashrc
/etc/bash.bashrc
# HTTP proxy without authentification
export http_proxy="http://host:port"
# HTTP proxy with authentification
export http_proxy="http://user:pass@host:port"
그러나 이러한 방식으로 설정하면 실행 시 도움이 되지 않습니다 sudo apt-get ...
. 이는 다음 줄 때문입니다 /etc/sudoers
.
Defaults env_reset
이 줄재설정sudo
보안상의 이유로 를 사용할 때 모든 환경 변수 . 하기 위해유지하다http_proxy
호출 에서 등 의 값을 통해 다음을 통해 sudo
예외를 지정할 수 있습니다 .env_reset
env_keep
# Exception specific to the command apt-get
Defaults!/usr/bin/apt-get env_keep="http_proxy https_proxy ftp_proxy"
# Exception specific to the user joe
Defaults:joe env_keep="http_proxy https_proxy ftp_proxy"
이렇게 하면, 당신은 apt-get
명예를 얻을 수 있습니다글로벌apt-get
일부 난해한 적절한 특정 구성 파일 에 대한 설정을 복제하는 대신 http_proxy에 대한 설정입니다 .