2

I have Debian 10 installed in my Virtual Machine and want to use

sudo apt-get update

Problem is I am in a network with an internet connection over proxy. So far so good, I set up the automatic proxy address and also set up IvP4 as it is set up in Windows. I can normally browse the internet with my VM, but when I want to use the bash mentioned earlier I get the error message that it is not able to establish the connection and download files.

I found this

sudo http_proxy='http://user:[email protected]:8080/'
apt-get install package-name

but my attempts on using this all failed.

So do anyone knows a solution for this?

1 Answer 1

4

Create a /etc/apt/apt.conf.d/http-proxy.conf with the following line:

Acquire::http::Proxy "http://user:[email protected]:8080/";

Then run:

export http_proxy=http://user:[email protected]:8080/

Or add it to your ~/.bashrc .

sudo apt install package_name

Debian FAQ: Q: How do I tell {{{apt-get}}} which http-proxy to use?

A: Set the environment Variable http_proxy: export http_proxy="http://192.168.1.1:8080" or export http_proxy=http://uid:pw@proxy:port if the proxy needs authentication. Alternatively you can configure it in /etc/apt/apt.conf.d

3
  • 1
    You may also have to acquire the https proxy: Acquire::https::Proxy "http://user:[email protected]:XXXX/"
    – Ron Beyer
    Mar 3, 2020 at 13:15
  • 1
    Okay thank you, but one question I ran into earlier. Do you have an example on how to fill (http::Proxy "user:[email protected]:8080/")?
    – BaB
    Mar 3, 2020 at 13:21
  • @BaB Welcome , just use your proxy credentials , user, pass and the address.
    – GAD3R
    Mar 3, 2020 at 15:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .