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# 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: 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: 80]
E: Some index files failed to download. They have been ignored, or old ones used instead.
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
the proxy config as shown bellow
sysop@ubuntu:/$ sudo cat /etc/apt/apt.conf
Acquire::http::Proxy "";
After we add the proxy config on apt.conf file, the ubuntu can perform apt-get smoothly
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