How to use apt-get behind proxy server (Ubuntu/Debian)

If you are a Debian-based GNU/Linux user, then you’re probably
familiar with synaptic and apt-get to install application from software
repositories. This post focussed on how to use apt-get/synaptic behind
proxy server/firewall which under normal circumstances, you’re unable
to use apt-get.

If you’re using Synaptic

Open up your Synaptic package manager (usually as root), go to
Settings-> Preference -> Network. Enter your proxy server details
like :, and put the proxy server port
(usually 8080).

If you’re using command-line apt-get

Edit your /etc/bash.bashrc or /etc/profile file as root.

Put these line at the end of your /etc/bash.bashrc or /etc/profile file :

export http_proxy=

You can omit the username:password, if your proxy server has no password. That’s all for today! Happy apt-get-ing!

debian,ubuntu,knoppix, mepis, apt-get

powered by performancing firefox


32 thoughts on “How to use apt-get behind proxy server (Ubuntu/Debian)

  1. Add the following lines to /etc/apt/apt.conf (might be empty) file worked for me while the instructions above did not.

    http::proxy “”

    If you need to authenticate use

    http::proxy “http://DOMAIN\username:Password@FQDN.or.IP:8080/”

    • Hi All I have tried this solution and it works perfect i was struggling from version 7.04 but finaly it works

      Add the following lines to /etc/apt/apt.conf (might be empty) file worked for me while the instructions above did not.

      ACQUIRE {
      http::proxy “”

      #If you need to authenticate use

      ACQUIRE {
      http::proxy “http://DOMAIN\username:Password@FQDN.or.IP:8080/”

      and ensure that u insert the entries in /etc/bash.bashrc

  2. I am Using Debain and there is not Setting for Authentication for proxy in Synaptic package manger. Can you tell which file to edit for proxy setting becasue a always get error 407 Proxy Authentication Required

  3. Pingback: bobpeers -> blog » apt-get Through A Proxy Server

    • Hi,

      Do you have @ in your password?

      If you have @, it will be tough to handle the condition.

      ask you admin the change the @ with any other special charecter.

      Regards, Shrinivasan

      • Replace the “@” with “%40”.

        e.g. if your password is “p@ssword”, use “http://username:p%40ssword@proxy.server:8080”.

        It’s years later, but hopefully someone will find this on google someday 😉

  4. Hi people, my problem consist in that I am using external and internal rep´s for Debian but am behind a proxy. So I configure the /etc/apt/apt.conf file as Anonymous says and it works fine for the external servers but not for the internal ones. I suppose that is because of their local addresses. How can I bypass the Proxy when it is about local requierements?? I mean how can I bypass when the packets are going inside my own network? Thanks and sorry if my english sucks.

  5. Pingback: Fish and Ski Boats: Get It From Lund

  6. Not Working! I guess problem is that my username has slashes and the password has @ character. is there a way of escaping those?

  7. This is the right web site for anybody who wishes to find out about this topic.
    You realize a whole lot its almost tough to argue with you (not that I personally will need to…HaHa).
    You definitely put a fresh spin on a subject which has been discussed for decades.
    Wonderful stuff, just wonderful!

  8. Your current write-up has proven helpful to me personally. It’s really useful and you’re obviously quite educated in this region. You have exposed our face for you to various views on this topic using intriguing and reliable articles.

  9. Excellent web site. A lot of useful info here. I’m sending it to a few buddies ans also sharing in delicious. And of course, thank you to your sweat!

  10. I have to thank you for the efforts you have put in penning this site.

    I really hope to see the same high-grade content from
    you later on as well. In fact, your creative writing abilities has inspired me
    to get my own site now 😉

  11. After all, there was a vaccine available, which many parents are choosing to give their child
    additional protection against Causes Tonsil Stones without increasing the number of sores and lessens the time you are sick.
    After tests revealed that Hewitt had Causes Tonsil Stones, she was slipping away.
    But where there is constant close contact among children.
    Rest and put in separate rooms until the scab dries to avoid transmission typically,
    1 week after onset of rash 2. This recommendation was made.

  12. Please let me know if you’re looking for a author for your site.
    You have some really great articles and I believe I would be a good
    asset. If you ever want to take some of the load off, I’d really
    like to write some content for your blog in exchange for a link back too mine.
    Please shoot me an email if interested. Thanks!

  13. Hello! Do you know if they make any plugins to protect against hackers?

    I’m kinda paranoid about losing everything I’ve worked hard on.
    Any tips?

  14. Smoking affects the potency levels in men and many times it has been noted that smokers are generally impotent.
    These people told that their sex life is improved as they have either
    stopped smoking completely or reduced the frequency of smoking.
    Sometimes damage can turn up after a few days so it’s a safety precaution that you must take.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s