How to configure apt.conf to make apt-get work thru proxy? - Ubuntu

This is a discussion on How to configure apt.conf to make apt-get work thru proxy? - Ubuntu ; I've been trying to make it work, but no success until now. I read man page for apt.conf and browsed thru apt.conf examples file (don't remember now it's exact name), but this did not help me to create a working ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: How to configure apt.conf to make apt-get work thru proxy?

  1. How to configure apt.conf to make apt-get work thru proxy?

    I've been trying to make it work, but no success until now.

    I read man page for apt.conf and browsed thru apt.conf examples file
    (don't remember now it's exact name), but this did not help me to create
    a working file. I'm using Kubuntu 8.04, installed under Windows, but I think
    this does not matter...

    Setting HTTP_PROXY variable did not help either (if I did not do it wrong
    way).
    Apt-get can't find the packages and the reason seems to be non-working
    apt.conf
    I want to be able to get updates and new packages in my office (via proxy
    only).

    As I learned, I could install Synaptic (it works with proxies), but
    obviously I can't
    do this using apt-get.

    Could you guys post a working sample of apt.conf supporting http/ftp
    proxies?
    Or send me some howto instructions? I only started using Ubuntu Linux and I
    like it,
    but I need to work from behind a proxy server.

    Chris



  2. Re: How to configure apt.conf to make apt-get work thru proxy?

    KW wrote:
    > I've been trying to make it work, but no success until now.


    > I read man page for apt.conf and browsed thru apt.conf examples file
    > (don't remember now it's exact name), but this did not help me to create
    > a working file. I'm using Kubuntu 8.04, installed under Windows, but I think
    > this does not matter...


    > Setting HTTP_PROXY variable did not help either (if I did not do it wrong
    > way).


    How did you do it? According to man apt.conf it should be http_proxy,
    not HTTP_PROXY, shouldn't it?

    > Apt-get can't find the packages and the reason seems to be non-working
    > apt.conf


    Error messages, please.

    > I want to be able to get updates and new packages in my office (via proxy
    > only).


    > As I learned, I could install Synaptic (it works with proxies), but
    > obviously I can't
    > do this using apt-get.


    Synaptic is on the desktop and alternate cd.

    --
    Niklaus

  3. Re: How to configure apt.conf to make apt-get work thru proxy?

    Niklaus Kuehnis pravi:
    >> Setting HTTP_PROXY variable did not help either (if I did not do it wrong
    >> way).

    >
    > How did you do it? According to man apt.conf it should be http_proxy,
    > not HTTP_PROXY, shouldn't it?


    There is a HTTP_PROXY variable in export unrelated to apt.conf but
    supposed to be more general.


    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iD8DBQFIepRyB6mNZXe93qgRAijsAKC8gelz2X+KFoh1Yt1VXt g/yIY9bgCbBxPk
    QjrDpW18huNdL8gVGwaX+xk=
    =Sn19
    -----END PGP SIGNATURE-----


  4. Re: How to configure apt.conf to make apt-get work thru proxy?


    Użytkownik "Niklaus Kuehnis" napisał w
    wiadomości news:487a6aa8$0$16181$5402220f@news.sunrise.ch...
    (...)
    >> Setting HTTP_PROXY variable did not help either (if I did not do it wrong
    >> way).

    >
    > How did you do it? According to man apt.conf it should be http_proxy,
    > not HTTP_PROXY, shouldn't it?
    >


    Yes, you were right! I was mislead by results of the "printenv" command -
    all
    viarables there are shown in uppercase, so I believed all my variables must
    have
    uppercase names.When I did this: export
    http_proxy="http://proxy.example.comort"
    apt-get started working..

    >> Apt-get can't find the packages and the reason seems to be non-working
    >> apt.conf

    >
    > Error messages, please.
    >


    Today I could run: sudo apt-get upgrade (or update) successfully, when
    http_proxy was set.
    However I still could not install some new packages. I tried for example:

    sudo apt-get install mc (to install Midnight Commander), but this did NOT
    work, the error was:
    E: Couldn't find package mc

    The above command works at home, where I have "direct" access to Internet.
    I'll try again tomorrow in the office, maybe I missed something.

    Thanks Niklaus for your tip!
    Chris



  5. Re: How to configure apt.conf to make apt-get work thru proxy?

    On 2008-07-15, KW wrote:
    >
    > UÂżytkownik "Niklaus Kuehnis" napisaÂł w
    > wiadomoÂści news:487a6aa8$0$16181$5402220f@news.sunrise.ch...
    > (...)
    >>> Setting HTTP_PROXY variable did not help either (if I did not do it wrong
    >>> way).

    >>
    >> How did you do it? According to man apt.conf it should be http_proxy,
    >> not HTTP_PROXY, shouldn't it?
    >>

    >
    > Yes, you were right! I was mislead by results of the "printenv" command -
    > all
    > viarables there are shown in uppercase, so I believed all my variables must
    > have
    > uppercase names.When I did this: export
    > http_proxy="http://proxy.example.comort"
    > apt-get started working..
    >
    >>> Apt-get can't find the packages and the reason seems to be non-working
    >>> apt.conf

    >>
    >> Error messages, please.
    >>

    >
    > Today I could run: sudo apt-get upgrade (or update) successfully, when
    > http_proxy was set.
    > However I still could not install some new packages. I tried for example:
    >
    > sudo apt-get install mc (to install Midnight Commander), but this did NOT
    > work, the error was:
    > E: Couldn't find package mc
    >
    > The above command works at home, where I have "direct" access to Internet.
    > I'll try again tomorrow in the office, maybe I missed something.


    Check your sources.list. I am not sure which repo mc is in, but it
    may be one that you don't have turned on at work...


    --
    Joe - Linux User #449481/Ubuntu User #19733
    joe at hits - buffalo dot com
    "Hate is baggage, life is too short to go around pissed off all the
    time..." - Danny, American History X

  6. Re: How to configure apt.conf to make apt-get work thru proxy?

    Joe wrote:
    > On 2008-07-15, KW wrote:
    > >
    > > sudo apt-get install mc (to install Midnight Commander), but this did NOT
    > > work, the error was:
    > > E: Couldn't find package mc
    > >
    > > The above command works at home, where I have "direct" access to Internet.
    > > I'll try again tomorrow in the office, maybe I missed something.


    > Check your sources.list. I am not sure which repo mc is in, but it
    > may be one that you don't have turned on at work...


    Filename: pool/universe/m/mc/mc_4.6.1-8ubuntu1_i386.deb
    ^^^^^^^^
    --
    Niklaus

  7. Re: How to configure apt.conf to make apt-get work thru proxy?


    Użytkownik "Joe" napisał w wiadomości
    news:slrng7qulf.1df.joe@barada.griffincs.local...
    > On 2008-07-15, KW wrote:
    >>
    >> U?ytkownik "Niklaus Kuehnis" napisa3 w
    >> wiadomo?ci news:487a6aa8$0$16181$5402220f@news.sunrise.ch...
    >> (...)


    >> Today I could run: sudo apt-get upgrade (or update) successfully, when
    >> http_proxy was set.
    >> However I still could not install some new packages. I tried for example:
    >>
    >> sudo apt-get install mc (to install Midnight Commander), but this did NOT
    >> work, the error was:
    >> E: Couldn't find package mc
    >>
    >> The above command works at home, where I have "direct" access to
    >> Internet.
    >> I'll try again tomorrow in the office, maybe I missed something.

    >
    > Check your sources.list. I am not sure which repo mc is in, but it
    > may be one that you don't have turned on at work...
    >

    Yes, this is correct. This morning I tried again and I could install mc and
    some other
    packages, so everything seems to be OK now.

    I think "mc" could not be found before, because I did not change my location
    settings
    after installation of Kubuntu, so the system tried to download packages from
    Australia
    (instead of my home country - Poland). I selected one of Polish servers in
    the software
    sources dialog and it seems to have helped.

    My location setting was English/Australia before that. Anyway it is strange
    to me, that
    mc could not be found on that alternate Australian server. Maybe that one
    lacks some repos.

    One more question about setting http_proxy variable, if you don't mind:
    -----------------------------------------------------------------------
    how to make it known "system-wide"? When I enter export command in a
    terminal
    I think it is valid only for this single shell process, correct or not? Will
    other applications
    know this value? For example I want to be able to use "Add/Remove Software",
    etc.

    Thanks,
    Chris



  8. Re: How to configure apt.conf to make apt-get work thru proxy?

    KW wrote:

    > One more question about setting http_proxy variable, if you don't mind:
    > -----------------------------------------------------------------------
    > how to make it known "system-wide"? When I enter export command in a
    > terminal
    > I think it is valid only for this single shell process, correct or not?


    AFAIK export makes the variable available to the current shell and
    its children.

    > Will other applications know this value? For example I want to be
    > able to use "Add/Remove Software", etc.


    Export it in /etc/bash.bashrc to make it available to any shell.
    (/etc/profile sources /etc/bash.bashrc.)

    I'm not sure about the X programs. They may be children of a shell
    and inherit from their parent shell? I've no idea how to test this.
    Synaptic e.g. acts as a front-end of (command-line) apt, anyway.

    If all else fails, ask in comp.unix.shell.

    --
    Niklaus

+ Reply to Thread