Minggu, 02 September 2018

How to run command apt-get update behind proxy

  Tidak ada komentar
Before we setting the proxy on ubuntu
[email protected]:/tmp#
[email protected]:/tmp# sudo apt-get update
Ign:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
Ign:2 http://security.ubuntu.com/ubuntu xenial-security Release
Ign:3 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages
Ign:4 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages
Ign:5 http://security.ubuntu.com/ubuntu xenial-security/main all Packages
..
..
E: Failed to fetch http://id.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages  Unable to connect to id.archive.ubuntu.com:http: [IP: 91.189.88.149 80]
E: Failed to fetch http://id.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages  Unable to connect to id.archive.ubuntu.com:http: [IP: 91.189.88.149 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
[email protected]:/tmp$
[email protected]:/tmp$ 
we create apt.conf file and add the following config as shown bellow
[email protected]:/etc/apt/apt.conf.d$ cd ..
[email protected]:/etc/apt$ sudo vi /etc/apt/apt.conf
[email protected]:/etc/apt$
the proxy config as shown bellow
[email protected]:/$
[email protected]:/$ sudo cat /etc/apt/apt.conf
Acquire::http::Proxy "http://192.168.71.17:9898";
[email protected]:/$
[email protected]:/$
After we add the proxy config on apt.conf file, the ubuntu can perform apt-get smoothly
[email protected]:/etc/apt$
sy[email protected]:/etc/apt$ sudo apt-get update
Get:1 http://ppa.launchpad.net/ondrej/php/ubuntu xenial InRelease [23.9 kB]
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]
Get:3 http://id.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:4 http://ppa.launchpad.net/ondrej/php/ubuntu xenial/main amd64 Packages [51.1 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [550 kB]

Tidak ada komentar :

Posting Komentar