Minggu, 02 September 2018

How to run command apt-get update behind proxy

  Tidak ada komentar
Before we setting the proxy on ubuntu
root@ubuntu:/tmp#
root@ubuntu:/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.
sysop@ubuntu:/tmp$
sysop@ubuntu:/tmp$ 
we create apt.conf file and add the following config as shown bellow
sysop@ubuntu:/etc/apt/apt.conf.d$ cd ..
sysop@ubuntu:/etc/apt$ sudo vi /etc/apt/apt.conf
sysop@ubuntu:/etc/apt$
the proxy config as shown bellow
sysop@ubuntu:/$
sysop@ubuntu:/$ sudo cat /etc/apt/apt.conf
Acquire::http::Proxy "http://192.168.71.17:9898";
sysop@ubuntu:/$
sysop@ubuntu:/$
After we add the proxy config on apt.conf file, the ubuntu can perform apt-get smoothly
sysop@ubuntu:/etc/apt$
sysop@ubuntu:/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