I am running an ubuntu (focal 20.04
) on WSL2
and i am trying to install gcc and it seems i need to run apt-get update
first.
I keep getting Could not resolve us.us.archive.ubuntu.com
(error below).
I have checked for solutions and edited the /etc/resolv.conf
adding the additional nameservers like below:
/etc/resolv.conf
# This file was automatically generated by WSL. To stop automatic generation of this file, add the foll>
# [network]
# generateResolvConf = false
nameserver 172.17.96.1
nameserver 8.8.8.8
nameserver 8.8.4.4
Error
sanzor@DESKTOP-GOMS8S8:~/rust$ sudo apt-get update
[sudo] password for sanzor:
Get:1 http://archive.ubuntu.com/ubuntu focal-proposed InRelease [267 kB]
Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Ign:3 http://binaries.erlang-solutions.com/debian focal InRelease
Hit:4 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial InRelease
Hit:5 http://binaries.erlang-solutions.com/debian focal Release
Err:6 http://us.us.archive.ubuntu.com/ubuntu focal InRelease
Could not resolve 'us.us.archive.ubuntu.com'
Err:7 http://us.us.archive.ubuntu.com/ubuntu focal-updates InRelease
Could not resolve 'us.us.archive.ubuntu.com'
Ign:9 http://archive.ubuntu.com/ubuntu trusty InRelease
Err:10 http://us.us.archive.ubuntu.com/ubuntu focal-backports InRelease
Could not resolve 'us.us.archive.ubuntu.com'
Hit:11 http://archive.ubuntu.com/ubuntu trusty-security InRelease
Hit:12 http://archive.ubuntu.com/ubuntu trusty-updates InRelease
Hit:13 http://archive.ubuntu.com/ubuntu trusty-proposed InRelease
Hit:14 http://archive.ubuntu.com/ubuntu trusty-backports InRelease
Hit:15 https://packages.microsoft.com/ubuntu/20.04/prod focal InRelease
Hit:16 http://archive.ubuntu.com/ubuntu trusty Release
Fetched 381 kB in 1s (379 kB/s)
Reading package lists... Done
W: Failed to fetch http://us.us.archive.ubuntu.com/ubuntu/dists/focal/InRelease Could not resolve 'us.us.archive.ubuntu.com'
W: Failed to fetch http://us.us.archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease Could not resolve 'us.us.archive.ubuntu.com'
W: Failed to fetch http://us.us.archive.ubuntu.com/ubuntu/dists/focal-backports/InRelease Could not resolve 'us.us.archive.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
P.S
I do not know why it goes for us.us.archive.ubuntu.com
, or in which file to look for that setting to change , if i can.
Later Edit
This is the /etc/apt/sources.list file content:
sanzor@DESKTOP-GOMS8S8:/etc/apt$ cat sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.us.archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://archive.ubuntu.com/ubuntu/ focal-proposed main
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.us.archive.ubuntu.com/ubuntu/ focal universe
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal universe
deb http://us.us.archive.ubuntu.com/ubuntu/ focal-updates universe
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.us.archive.ubuntu.com/ubuntu/ focal multiverse
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://us.us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
# deb-src http://us.us.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu focal partner
# deb-src http://archive.canonical.com/ubuntu focal partner
deb http://security.ubuntu.com/ubuntu/ focal-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted
deb http://security.ubuntu.com/ubuntu/ focal-security universe
# deb-src http://security.ubuntu.com/ubuntu/ focal-security universe
deb http://security.ubuntu.com/ubuntu/ focal-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ focal-security multiverse
deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main
# deb-src http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main
deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse