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?

WSL/Ubuntu再インストール

Posted at

はじめに

WSL/Ubuntu環境を稀によくクリアするので備忘録。

Ubuntu再インストール

コマンドプロンプトを起動し、以下のコマンドを使用する。
wsl --help
wsl --list
wsl --unregister Ubuntu
wsl --install -d Ubuntu

C:\Projects\WSL>wsl --list
Linux 用 Windows サブシステム ディストリビューション:
Ubuntu (既定)

C:\Projects\WSL>wsl --unregister Ubuntu
登録解除。
この操作を正しく終了しました。

C:\Projects\WSL>wsl --install -d Ubuntu
ダウンロード中: Ubuntu
インストール中: Ubuntu
ディストリビューションが正常にインストールされました。'wsl.exe -d Ubuntu' を使用して起動できます

WSL/Ubuntu起動

コマンドプロンプトから以下のコマンドで初期設定を行う。
wsl

C:\Projects\WSL>wsl
Provisioning the new WSL instance Ubuntu
This might take a while...
Create a default Unix user account: xxx
New password:
Retype new password:
passwd: password updated successfully
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)

また、以下のコマンドでアップデートしておく。
sudo apt update
sudo apt upgrade
apt list --upgradable

以下のようなコマンドでパッケージをインストールする。
sudo apt install gcc

また、以下のコマンドでWSLのアップデートを確認する。
wsl --update

C:\Projects\WSL>wsl --update
更新プログラムを確認しています。
Linux 用 Windows サブシステムの最新バージョンは既にインストールされています。
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?