Linux on Windows -1-: debian introduction

1. 1. Introduction

As I learned PowerShell on Windows, I missed the Linux shell. If you want to play with Linux shell commands on Windows, there is a method called Cygwin (Isn't it still there?), But since it's a good idea, try building a Linux virtual environment on Win with WSL.

2. environment

The versions of Windows are as follows.


hostname:               HISABO-PC
OS name:                  Microsoft Windows 10 Home
OS version:          10.0.18363 N/A build 18363
OS manufacturer:              Microsoft Corporation
OS configuration:Standalone workstation
OS build type:        Multiprocessor Free
... Below, abbreviated ...

3. 3. Where to aim

--Build a debian environment with WSL on Windows.

4. let's try it

Find Linux in the Microsoft Store

コメント 2020-05-23 162810.png

I thought that there was only ubuntu, but since there was debian, I changed it to debian. Certainly the size was 77MB, so there would be no GUI environment. That is more convenient.

コメント 2020-05-23 163401.png

When I started debian after installation, I got an error. Refer to the following page and change the Windows settings to enable WSL.

Reference: PC studio (link)

コメント 2020-05-23 163718.png When I started it again, it worked. For the time being, I registered the user (user name, password) and the shell started up. It's a wonderful CUI.

For the time being, update the package.

hisabo@hisabo-PC:~$ sudo apt-get update

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for hisabo:
Get:1 buster InRelease [121 kB]
Get:2 buster/updates InRelease [65.4 kB]
Get:3 buster-updates InRelease [49.3 kB]
Get:12 buster-updates/main Translation-en [5,166 B]
Fetched 15.0 MB in 40s (380 kB/s)
Reading package lists... Done

hisabo@hisabo-PC:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  apt apt-utils base-files cron e2fsprogs gpgv iputils-ping libapt-inst2.0 libapt-pkg5.0 libbz2-1.0 libcom-err2
  libcryptsetup12 libdns-export1104 libext2fs2 libgnutls30 libidn2-0 libisc-export1100 libncurses6 libncursesw6 libss2
  libssl1.1 libsystemd0 libtinfo6 libudev1 ncurses-base ncurses-bin sudo systemd systemd-sysv tzdata udev
31 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 17.2 MB of archives.
After this operation, 10.2 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 buster/main amd64 base-files amd64 10.3+deb10u4 [69.8 kB]

What is the shell?

hisabo@hisabo-PC:/etc$ echo $SHELL

It's bash.

コメント 2020-05-23 164747.png Just in case, check the login shell in / etc / passwd. It's bash.

What is the Japanese environment (simple survey)

コメント 2020-05-23 164445.png

Check the input method with vi (vim). I tried as long as I remember how to change to Japanese input mode, but none of them hit. At the very end, when I pressed the half-width / full-width key, I was able to input Japanese smoothly. I saved it and checked it with cat, more, less, and view, but I can see Japanese even when browsing. At first glance, there seems to be no problem.

Check the character code and locale

hisabo@hisabo-PC:/etc$ echo $LANG
hisabo@hisabo-PC:/etc$ locale
hisabo@hisabo-PC:/etc$ locale -a

After all it is UTF-8. Isn't there euc at this time? I noticed that it's not ja_JP.UTF-8, right? Well, let's find out later.

Since there was no man, install man

I typed a command to try using awk, but I forgot because I haven't used it for a long time. I tried to find out with man, but man doesn't seem to be installed by default. install.

hisabo@hisabo-PC:/etc$ sudo apt-get install man
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'man-db' instead of 'man'
The following additional packages will be installed:
  groff-base libgdbm6 libpipeline1 libuchardet0
Suggested packages:
  groff apparmor www-browser
The following NEW packages will be installed:
  groff-base libgdbm6 libpipeline1 libuchardet0 man-db
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,351 kB of archives.
After this operation, 6,820 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y

In the days when Google wasn't there, I used man to find out how to use commands. It's a good time now. There are most answers on the net.

The end. Acquired knowledge

--How to build a debian environment on Windows 10 with WSL

Recommended Posts

Linux on Windows -1-: debian introduction
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Linux (WSL) on Windows
Linux on Windows -1-: debian introduction
Use Linux on Windows 10 (WSL2)
Create a Linux environment on Windows 10
pykintone on Windows Subsystem for Linux
[UE4] Build DedicatedServer on Windows and Linux
[Linux] Introduction to Linux
Run bootgen on Debian GNU / Linux, Ubuntu
Create a Linux virtual machine on Windows
Run Debian (Linux) & LXQt on Athlon 200GE (AMD)
Open a ZIP created on Windows in Linux
Organize files on Windows with Linux commands-using WSL-
Daemonizing processes on Linux
Introduction of trac (Windows + trac 1.0.10)
jblas on Arch Linux
Pylint on Windows Atom
NAT router on Linux
Use pyvenv on Windows
Linux, Windows proxy settings
Anaconda on Windows Terminal
Install Anaconda on Windows 10
python basic on windows ②
Install python on windows
Develop .NET on Linux
Wake on lan on Linux
Install pycuda on Windows10
Build TensorFlow on Windows
Monitor traffic on Linux
Try FEniCS on Windows!
Build XGBoost on Windows
Install pygraphviz on Windows 10
Update vscode on linux
Use Ansible on Windows
Try Poerty on Windows
Try NeosVR on Linux
Install Chainer 1.5.0 on Windows
Use QuTiP on Windows
Use pip on Windows
Check capacity on Linux
LiveUSB creation on Linux
Linux operation on Win10
Run Kali Linux on Windows with GUI (without VirtualBox)
A story about a Linux beginner putting Linux on a Windows tablet
Cross development environment (developing programs for windows on linux)
Install Numpy on virtualenv on Windows
Set-enable Python virtualenv on Windows
Install Minecraft on Arch Linux
[Windows] RDP to Windows via Linux
Run Jupyter on Ubuntu on Windows
Put the latest version of Python on linux (Debian) on Chromebook
Run Openpose on Python (Windows)
Install Linux on your Chromebox
Downgrade Mcomix on Arch Linux
A super introduction to Linux
Before trying Veriloggen on Windows
Monitor disk usage on Linux
Install cvxpy on windows, Anaconda
Python + Kivy development on Windows
Use Github Desktop on Linux