
Ubuntu日本語フォーラム
ログインしていません。
こんにちは、wsl2/Ubuntuで開発環境を構築しようと思っている初心者です。windows 11[Version 10.0.22000.376]上のwsl2(kernel ver: 5.10.60.1)で実行しているUbuntu20.04LTSで、アップデートやその他ソフトウェアのインストールができません。どなたか助けていただけませんか。インターネットで解決方法を模索したのですが、理解および解決できませんでした。
以下コマンドです。システムは何もいじっていません。管理者権限のPower shellでwslと打ってUbuntuを起動させ、ユーザー名とパスワードを設定しただけです。
jessica@pwhBm0qbBv:~$ sudo apt install update
[sudo] password for jessica:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package update
jessica@pwhBm0qbBv:~$ apt install update
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?
jessica@pwhBm0qbBv:~$ apt update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
jessica@pwhBm0qbBv:~$ code
Installing VS Code Server for x64 (899d46d82c4c95423fb7e10e68eba52050e30ba3)
Downloading: 100%
Failed
--2022-01-11 10:09:49-- https://update.code.visualstudio.com/commit:899d46d82c4c95423fb7e10e68eba52050e30ba3/server-linux-x64/stable
Resolving update.code.visualstudio.com (update.code.visualstudio.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘update.code.visualstudio.com’
ERROR: Failed to download https://update.code.visualstudio.com/commit:899d46d82c4c95423fb7e10e68eba52050e30ba3/server-linux-x64/stable to /home/jessica/.vscode-server/bin/899d46d82c4c95423fb7e10e68eba52050e30ba3-1641863379.tar.gz
j
オフライン
「wsl2 ubuntu update できない」で検索すると、いろいろページがヒットします。
その中から、ご自分の現象と一致しているものを見つけて対策してみてください。
原因として考えられるのは、
*時間の不一致
*Ubuntu側にネットが開放されていない
等、色々、考えられます。
オフライン
siさん
返信ありがとうございます。自己解決しました。どうやら、DNS名前解決が上手くいっていなかったようでした。
下記のサイトの通りに操作してみたところ。解決できました。
https://qiita.com/riraosan/items/3b036367d6d9f4e6b52a
オフライン