Score:0

Could not resolve us.us.archive.ubuntu.com for ubuntu 20.04 on WSL

us flag

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
David avatar
cn flag
Why does it say us.us? Seems your sources is wrong.
David avatar
cn flag
Tried to use a browser to get there just to double check. This site can’t be reached Check if there is a typo in us.us.archive.ubuntu.com. DNS_PROBE_FINISHED_NXDOMAIN
Bercovici Adrian avatar
us flag
Do you know which file i should check for ? I don't know why it goes for those sites.
David avatar
cn flag
The source list /etc/apt/sources. list and the files contained in /etc/apt/sources. list. d/ are designed to support any number of active sources and a variety of source media.
David avatar
cn flag
There should not be us.us it should only be one us
Bercovici Adrian avatar
us flag
@David where should i look for in which file and edit ? I added the content of `sources.list` file in the original post.
David avatar
cn flag
Get rid of the PPA entry it is not even for this release of Ubuntu and edit all the us.us to only have one us
Score:1
us flag

I fixed the issue by editing the /etc/apt/sources.list file. All urls were us.us.archive.ubuntu.com/... and i changed to us.archive.com

All worked like a charm afterwards.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.