1

I am getting this could not resolve issue. I have been on an open network from last two months after fresh installation of ubuntu 18.04. I have just shifted in a LAN with proxy. I have done every settings including updating the /etc/resolv.conf file and have looked at other solutions of these types. None is working.

sudo apt-get update
Err:1 https://download.sublimetext.com apt/stable/ InRelease                     
Could not resolve 'download.sublimetext.com'
Err:2 http://security.ubuntu.com/ubuntu bionic-security InRelease                
Could not resolve 'security.ubuntu.com'
Err:3 http://dl.google.com/linux/chrome/deb stable InRelease                     
Could not resolve 'dl.google.com'
Err:4 http://archive.ubuntu.com/ubuntu bionic InRelease                          
Could not resolve 'archive.ubuntu.com'
Err:5 http://ppa.launchpad.net/leaeasy/dde/ubuntu bionic InRelease     
Could not resolve 'ppa.launchpad.net'
Err:6 http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu bionic InRelease
Could not resolve 'ppa.launchpad.net'
Err:7 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Could not resolve 'archive.ubuntu.com'
Err:8 http://archive.ubuntu.com/ubuntu bionic-backports InRelease
Could not resolve 'archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Could not resolve 'security.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease  Could not resolve 'archive.ubuntu.com'
W: Failed to fetch http://dl.google.com/linux/chrome/deb/dists/stable/InRelease  Could not resolve 'dl.google.com'
W: Failed to fetch http://ppa.launchpad.net/leaeasy/dde/ubuntu/dists/bionic/InRelease  Could not resolve 'ppa.launchpad.net'
W: Failed to fetch http://ppa.launchpad.net/maarten-baert/simplescreenrecorder/ubuntu/dists/bionic/InRelease  Could not resolve 'ppa.launchpad.net'
W: Failed to fetch https://download.sublimetext.com/apt/stable/InRelease  Could not resolve 'download.sublimetext.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Arun
  • 2,001
  • 11
  • 24
Deepak Kumar
  • 577
  • 2
  • 5
  • 13
  • Which VPN are you using? Can you find a configuration for it in network manager's Edit Connection dialog? If it's openvpn, is it actually installed? I've heard of it showing up without being installed. – Joe Jul 27 '18 at 16:55
  • @Joe I don't see a reference to a VPN? LAN with Proxy is not a VPN – Thomas Ward Jul 27 '18 at 17:15
  • no vpn is being used. – Deepak Kumar Jul 27 '18 at 17:22
  • Does name resolution work on your machine? Can you ping internet address? Try "dig www.google.com" and "ping www.google.com" and let us know your result. I think there is no problem with archive.ubuntu.com, you probably just have a general problem accessing the internet. PS: If you configured a proxy, post your apt configuration for this proxy. – Bernard Wei Jul 27 '18 at 18:16
  • Results of dig and ping : dig www.google.com bash: dig: command not found yo@yo-hp-pavilion-notebook:~$ ping www.google.com ping: www.google.com: Name or service not known – Deepak Kumar Jul 28 '18 at 04:40
  • my apt configuration is fine : it has it's configuration in these format only. http::username:passwd@202.141.80.24:3128 – Deepak Kumar Jul 28 '18 at 04:44

1 Answers1

0

Try this if your host is behind a proxy server.

Add the following line to /etc/apt/apt.conf. If the file doesn't exist create one.

Acquire::http::Proxy "http://yourproxyaddress:proxyport";

Replace yourproxyaddress and proxyport appropriately.

Or, if authentication is required:

Acquire::http::Proxy "http://user:pwd@yourproxyaddress:proxyport";
Pablo Bianchi
  • 15,657
A S K
  • 42
  • Assuming that missing proxy creds are, in fact, the OP's problem, this answer is corect/fine. But if the current user's environment already has the http[s]_proxy vars set, an alternative is to run sudo -E apt install <whatever>. (The -E switch runs the command with the current user's env vars set.) I generally have an easier time remembering to tack on -E than dredging up the somewhat awkward syntax used to set an APT proxy in /etc/apt. (And such changes should nowadays be placed in a separate file in /etc/apt/apt.conf.d, anyway.) – evadeflow Mar 16 '19 at 14:57