Ubuntu – Updating the apt-get command in the terminal

aptcommand lineupdates

I have only recently installed ubuntu 18.04 on one of my machines as a means of becoming competent in using a Linux system, when I attempt to use the command

sudo apt-get update 

I receive an error message saying

Could not resolve 'security.ubuntu.com'

and likewise for all four of the main repositories. If it is necessary for me to print the exact output just let me know..

UPDATED:

I was able to update upon reboot of my system, however only partially, receiving the following error message in my output:

E: The repository 'http://security.ubuntu.com bionic-security Release'
does not have a Release file.

N: Updating from such a repository can't be done securely, and is
therefore disabled by default.

N: See apt-secure(8) manpage for repository creation and user
configuration details.

Best Answer

Could not resolve 'security.ubuntu.com means the system cannot find to which IP address security.ubuntu.com is pointing to. This means your DNS is broken.

To fix it, make sure of a few things:

  1. Your linux has an ip address.
  2. If you have an ip address, you are connected to the internet (ping to 8.8.8.8).
  3. If you can ping to 8.8.8.8, try ping to google.com
  4. If step 2 worked but step 3 didn`t, you need to fix your dns. Make sure that in the file /etc/resolv.conf there's a valid dns server.

I'm using umbrella DNS servers:

cat /etc/resolv.conf
nameserver 208.67.220.220
nameserver 208.67.222.222
Related Question