Доступ к Интернету не работает в подсистеме Windows для Linux

6165
Soham Dasgupta

Я пробовал sudo apt-get updateв новой подсистеме Windows для Linux, но я получаю следующую ошибку:

ошибка

Наиболее важными частями, по-видимому, являются строки «не удалось разрешить» о серверах Ubuntu, например:

Could not resolve 'archive.ubuntu.com' 
5
Вы проверили основы, такие как IP DNS и т. Д. SeanClt 8 лет назад 1

3 ответа на вопрос

9
Ben N

There is an open GitHub issue about this error.

It appears that the most likely problem is that /etc/resolv.conf didn't get generated correctly. Make sure it contains a nameserver line for a valid DNS server, preferably one on your local network. Many routers provide DNS services to their networks; on my network, I would add this line:

nameserver 192.168.1.1 

If there are entries that don't correspond to valid DNS servers, remove them.

If you use a third-party antivirus product, try disabling its firewall - there are reports that some such programs interfere with Bash's connectivity.

`nameserver 8.8.8.8` работал и у меня. Ben Visness 7 лет назад 2
2
Rowan Hawkins

It looks like your DNS settings are incorrect or you could have a gateway/netmask incompatibility.

use ip link to verify that an interface is listed as 'up' and then ifconfig to for the settings of that interface. you may also need to cat /etc/sysconfig/network-scripts/ifcfg-eth? to look at the settings of the interfaces.

try traceroute -d 8.8.8.4 to see if you can reach google's public DNS server. That will verify you are getting out to the outside network. If it works with -d but fails to resolve the IP's to names when run without the -d then a quick fix would be to add 8.8.8.8 & 8.8.8.4 to your DNS Settings for the interface that is up, and then issue a service network restart to restart the network services and make the DNS changes active.

I forgot if you don't have a gui interface configured yet, you can easily edit the interface configs with system-config-network. Navigate with arrow keys,tab, esc, and enter

Во-первых, я не могу установить traceroute из-за проблем с сетью. Michael Terry 6 лет назад 1
Похоже, * tracepath * - это опция, которую вы можете попробовать. Вы также можете подключить RPM-систему к системе с другого компьютера на USB-накопителе, поскольку все его зависимости являются общими вещами .... libc.so, rpmlib и rtld Rowan Hawkins 6 лет назад 2
1
Rambabu Chamakuri

Создайте /etc/apt/apt.conf для добавления конфигурации прокси.

sudo nano /etc/apt/apt.conf

Добавьте эту строку в ваш файл /etc/apt/apt.conf

Получить :: http :: Proxy " http: // proxyaddress: port ";

Сохраните его с помощью Ctrl + X, Y и повторите попытку:

Теперь выполните команду ниже

sudo apt-get update

Я попробовал и подтвердил.