0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

WSL2に「ubuntu 20.04 LTS」をインストール後に更新できない場合

Last updated at Posted at 2022-03-13
  • sudo apt updateを実行時に
    発生したエラー「Temporary failure resolving 'archive.ubuntu.com'」を回避する方法

1.下記の2行を/etc/wsl.confに追加する

[network]
generateResolvConf = false

2./etc/resolv.confに下記の1行を追加する(DNSサーバー)

sudo sh -c "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"

3.ping 8.8.8.8を通らない場合下記のコマンドをpowershellに実行する

Get-NetIPInterface -InterfaceAlias "vEthernet (WSL)" | Set-NetIPInterface -InterfaceMetric 1
Get-NetAdapter | Where-Object {$_.InterfaceDescription -Match "Cisco AnyConnect"} | Set-NetIPInterface -InterfaceMetric 6000

追記:GUI化しましたが毎回「リモート デスクトップ接続」で接続時に黒の画面になるため下記のコマンドを実行必要です。(参考記事

wsl --shutdown
sudo /etc/init.d/xrdp start
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?