HowTo: apt-get hinter einem Proxy Server mit Ubuntu

Wer sein Unbuntu updaten möchte, oder neue Software installieren will wird früher oder später apt-get brauchen. Wenn man nun hinter einem Proxy-Server sitzt, wird das nicht ohne weiteres funktionieren. Dazu muss man ein paar kleine Einstellungen machen:
1) Unter System -> den Synaptic Paketverwaltung öffnen und dort unter Einstellungen -> Netzwerk die entsprechenden Einträge machen.
2) Um apt-get von der der Kommandozeile nutzen zu können, schreiben wir die Proxy-Settings in die Umgebungsvariable. Die geschieht indem man:

sudo nano /etc/bash.bashrc

aufruft und dann die folgenden Zeilen am Ende einfügt:

export http_proxy=http://user:passwort@proxyserver.domain:port/
export ftp_proxy=http://user:passwort@proxyserver.domain:port/

Das user:passwort kann natürlich entfallen, sofern der Proxy keine Zugangsberechtigung abfragt. Wen man jetzt eine neue Shell öffnet kann man wie gewohnt sein apt-get nutzen.

6 thoughts on “HowTo: apt-get hinter einem Proxy Server mit Ubuntu

  1. Stimmt nur bedingt: die Variablen sind case sensitive: http_proxy und ftp_proxy, nicht HTTP_PROXY, bzw FTP_PROXY

  2. @Tobias:
    Da hast Du (natürlich) Recht. Da habe ich beim Tippen wohl nicht aufgepasst. Habe den Artikel entsprechend korrigiert.

  3. Pingback: HTC Magic als Modem - Seite 3 - Android-Hilfe.de

  4. Zu apt-get und Proxy gibt es eig. nur eines:
    /etc/apt/apt.conf

    Acquire::http::Proxy “http://proxy.adresse.de:port”;
    Acquire::ftp::Proxy “http://proxy.adresse.de:port”;

    oder die Langfassung (http://debiananwenderhandbuch.de/apt.conf.html):

    // Options for the downloading routines
    Acquire
    {
    Queue-Mode “host”; // host|access
    Retries “0″;
    Source-Symlinks “true”;

    // HTTP method configuration
    http
    {
    Proxy “http://127.0.0.1:3128″;
    Proxy::http.us.debian.org “DIRECT”; // Specific per-host setting
    Timeout “120″;
    Pipeline-Depth “5″;

    // Cache Control. Note these do not work with Squid 2.0.2
    No-Cache “false”;
    Max-Age “86400″; // 1 Day age on index files
    No-Store “false”; // Prevent the cache from storing archives
    };

    ftp
    {
    Proxy “ftp://127.0.0.1/”;
    Proxy::http.us.debian.org “DIRECT”; // Specific per-host setting

    ProxyLogin
    {
    “USER $(PROXY_USER)”;
    “PASS $(PROXY_PASS)”;
    “USER $(SITE_USER)@$(SITE):$(SITE_PORT)”;
    “PASS $(SITE_PASS)”;
    };

    Timeout “120″;

    /* Passive mode control, proxy, non-proxy and per-host. Pasv mode
    is prefered if possible */
    Passive “true”;
    Proxy::Passive “true”;
    Passive::http.us.debian.org “true”; // Specific per-host setting
    };

Hinterlasse eine Antwort

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind markiert *

*

Du kannst folgende HTML-Tags benutzen: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>