| 22 | | 最初に__管理者権限で__コマンドプロンプトを開く。wslコマンドで、インストール可能なディストリビューションを検索・確認する。 |
| 23 | | (wslコマンドが無い場合は、適当にGoogleで検索してください) |
| 24 | | {{{ |
| 25 | | C:\>wsl --list --online |
| 26 | | インストールできる有効なディストリビューションの一覧を次に示します。 |
| 27 | | 'wsl --install -d <Distro>' を使用してインストールします。 |
| 28 | | |
| 29 | | NAME FRIENDLY NAME |
| 30 | | Ubuntu Ubuntu |
| 31 | | Debian Debian GNU/Linux |
| 32 | | kali-linux Kali Linux Rolling |
| 33 | | Ubuntu-18.04 Ubuntu 18.04 LTS |
| 34 | | Ubuntu-20.04 Ubuntu 20.04 LTS |
| 35 | | Ubuntu-22.04 Ubuntu 22.04 LTS |
| 36 | | OracleLinux_7_9 Oracle Linux 7.9 |
| 37 | | OracleLinux_8_7 Oracle Linux 8.7 |
| 38 | | OracleLinux_9_1 Oracle Linux 9.1 |
| 39 | | SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4 |
| 40 | | openSUSE-Leap-15.4 openSUSE Leap 15.4 |
| 41 | | openSUSE-Tumbleweed openSUSE Tumbleweed |
| 42 | | }}} |
| 43 | | |
| 44 | | [[Image(wsl_install1.png, 40%)]] |
| 45 | | |
| 46 | | |
| 47 | | ここではUbuntu22.04をインストールすることにする。 |
| 48 | | {{{ |
| 49 | | C:\>wsl --install --d Ubuntu-22.04 |
| 50 | | インストール中: Ubuntu 22.04 LTS |
| 51 | | Ubuntu 22.04 LTS はインストールされました。 |
| 52 | | Ubuntu 22.04 LTS を起動しています... |
| 53 | | }}} |
| 54 | | |
| 55 | | 自動的にUbuntuのターミナルが起動して、ユーザー名を入れるプロンプトが出るので、ユーザー名とパスワードを設定する。 |
| 56 | | (最初は少し時間がかかるかもしれない) |
| 57 | | {{{ |
| 58 | | Installing, this may take a few minutes... |
| 59 | | Please create a default UNIX user account. The username does not need to match your Windows username. |
| 60 | | For more information visit: https://aka.ms/wslusers |
| 61 | | Enter new UNIX username: obina |
| 62 | | New password: |
| 63 | | Retype new password: |
| 64 | | passwd: password updated successfully |
| 65 | | Installation successful! |
| 66 | | To run a command as administrator (user "root"), use "sudo <command>". |
| 67 | | See "man sudo_root" for details. |
| 68 | | |
| 69 | | Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.10.60.1-microsoft-standard-WSL2 x86_64) |
| 70 | | |
| 71 | | * Documentation: https://help.ubuntu.com |
| 72 | | * Management: https://landscape.canonical.com |
| 73 | | * Support: https://ubuntu.com/advantage |
| 74 | | |
| 75 | | This message is shown once a day. To disable it please create the |
| 76 | | /home/obina/.hushlogin file. |
| 77 | | obina@notepc:~$ |
| 78 | | }}} |
| 79 | | [[Image(wsl_install2.png, 40%)]] |
| 80 | | |
| 81 | | [[Image(wsl_install3.png, 40%)]] |
| 82 | | |
| 83 | | |
| 84 | | |
| 85 | | いちおう確認 |
| 86 | | {{{ |
| 87 | | obina@notepc:~$ cat /etc/os-release |
| 88 | | PRETTY_NAME="Ubuntu 22.04.2 LTS" |
| 89 | | NAME="Ubuntu" |
| 90 | | VERSION_ID="22.04" |
| 91 | | VERSION="22.04.2 LTS (Jammy Jellyfish)" |
| 92 | | VERSION_CODENAME=jammy |
| 93 | | ID=ubuntu |
| 94 | | ID_LIKE=debian |
| 95 | | HOME_URL="https://www.ubuntu.com/" |
| 96 | | SUPPORT_URL="https://help.ubuntu.com/" |
| 97 | | BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" |
| 98 | | PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" |
| 99 | | UBUNTU_CODENAME=jammy |
| 100 | | obina@notepc:~$ uname -a |
| 101 | | Linux notepc 5.10.60.1-microsoft-standard-WSL2 #1 SMP Wed Aug 25 23:20:18 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux |
| 102 | | }}} |
| 103 | | |
| 104 | | パッケージのアップデート。先ほど入力したパスワードを入れる |
| 105 | | {{{ |
| 106 | | obina@notepc:~$ sudo apt update |
| 107 | | Hit:1 http://archive.ubuntu.com/ubuntu jammy InRelease |
| 108 | | Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] |
| 109 | | ..... |
| 110 | | Fetched 26.5 MB in 6s (4327 kB/s) |
| 111 | | Reading package lists... Done |
| 112 | | Building dependency tree... Done |
| 113 | | Reading state information... Done |
| 114 | | 19 packages can be upgraded. Run 'apt list --upgradable' to see them. |
| 115 | | }}} |
| 116 | | |
| 117 | | {{{ |
| 118 | | obina@notepc:~$ sudo apt upgrade |
| 119 | | Reading package lists... Done |
| 120 | | Building dependency tree... Done |
| 121 | | Reading state information... Done |
| 122 | | Calculating upgrade... Done |
| 123 | | The following packages will be upgraded: |
| 124 | | apt apt-utils distro-info-data git git-man libapt-pkg6.0 libglib2.0-0 libglib2.0-bin libglib2.0-data libssl3 libxml2 |
| 125 | | openssl tzdata ubuntu-advantage-tools vim vim-common vim-runtime vim-tiny xxd |
| 126 | | 19 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. |
| 127 | | 10 standard LTS security updates |
| 128 | | Need to get 21.9 MB of archives. |
| 129 | | After this operation, 348 kB of additional disk space will be used. |
| 130 | | Do you want to continue? [Y/n] Y |
| 131 | | .... |
| 132 | | obina@notepc:~$ |
| 133 | | }}} |
| 134 | | |
| 135 | | とりあえずここまでで十分。 |
| 136 | | |
| | 21 | こちらを参照: https://cerldev.kek.jp/trac/EpicsUsersJP/wiki/misc/setup_for_ML#WSL2%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB |