Linux environment construction (on WSL environment)

Hello. I tried to build a Linux environment using Windows Subsystem for Linux (WSL) of Windows 10 (I also installed Linuxbrew). The procedure is [^ 1].

[^ 1]: I'm sorry that there are many existing articles and it seems to build a rooftop.

** 1 ** Start Powershell with administrator privileges Then set ExecutionPolicy to `` `RemoteSigned```.

PS> Set-ExecutionPolicy RemoteSigned

Next, this time, Install Chocolatey and use it to Windows Terminal. / windows / terminal /) (terminal environment) installed (also vscode):

PS> set ChocolateyInstall=C:\ProgramData\chocolatey
PS> Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
PS> choco list -lo
PS> choco install -y microsoft-windows-terminal vscode

Then, in order to enable Windows Subsystem for Linux (WSL), execute the following command and reboot [^ 2].

PS> Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

[^ 2]: Or, enable it in "Control Panel> Programs and Features>" Enable or Disable Windows Features ""

** 2 ** Obtaining and installing a Linux distribution Start the Microsoft Store, enter "WSL" in the search field, find Ubuntu 18.04 LTS (Linux) [^ 3], get it, install it, and start it [^ 4]. You can skip signing in to your Microsoft account. The installation will start, and you will be asked to enter the username and password for sudo.

  Enter new UNIX username:
  Enter new UNIX password:
  Retype new UNIX password:

[^ 3]: Ubuntu 20.04 LTS (Linux) may also be good. [^ 4]: Reference articles are "Windows Subsystem for Linux (WSL) setting procedure", "Windows 10 Install WSL to make Linux programs available on (version 1803 or later) "," [[ Introduction to WSL] Part 1 Windows 10 standard Linux environment Let's start WSL "etc.

** 3 ** Confirm that the Linux terminal can be started Start the Linux terminal environment (Windows Terminal or the default one installed at the same time as the distribution) and check that the command is executed:

$ uname -a
Linux ...
$ cat /etc/os-release
  :
  :

Next, make various settings:

$ echo 'umask 002' >> ~/.bashrc
$ echo 'export VISUAL="vim"\nexport EDITOR="vim"' >> ~/.bashrc
$ echo 'export PATH="/home/linuxbrew/.linuxbrew/sbin:/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~/.bashrc

** 4 ** Restart the Linux terminal environment and update etc .:

$ sudo apt update
$ sudo apt upgrade -y
$ sudo apt install git curl file build-essential

I also installed Linuxbrew this time.

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
$ brew doctor
$ brew update
$ brew install gcc zlib

** 5 ** Check services on Linux Check the status of cron and ssh

$ sudo service cron status
 * cron is not running
$ sudo ssh-keygen -A
$ sudo service ssh start
$ sudo service ssh status
 * sshd is running

Recommended Posts

Linux environment construction (on WSL environment)
Linux environment construction
[Linux] Docker environment construction on Redhat
Linux (WSL) on Windows
About Linux environment construction (CentOS)
Anaconda environment construction on CentOS7
[Tensorflow] Tensorflow environment construction on Windows 10
Use Linux on Windows 10 (WSL2)
Python environment construction memo on Windows 10
Anaconda python environment construction on Windows 10
Anaconda environment construction on Mac (2018 version)
WSL2 ~ Linux on Windows ~ (Part 1: Introduction)
Python environment construction memo on Mac
Python development environment construction on macOS
Environment construction of python3.8 on mac
Development environment construction (2020 version, WSL2 + VcXsrv)
Introduce Python 3.5.2 environment on Amazon Linux
Environment construction of "Tello_Video" on Ubuntu
OpenCV3 & Python3 environment construction on Ubuntu
Memo of Linux environment construction using VirtualBox + Vagrant on Windows 10
Django environment construction
DeepIE3D environment construction
Emacs-based environment construction
Install wsl2 and master linux on windows
Linux (CentOS) construction
Environment construction (python)
Build an LNPP environment on Amazon Linux 2
CodeIgniter environment construction
Python --Environment construction
GeoDjango + SQLite environment construction on OS X
Python environment construction
Install rJava on Linux in R3.6 environment.
Golang environment construction
python environment construction
Word2vec environment construction
[0] TensorFlow-GPU environment construction built with Anaconda on Ubuntu
Deployment method (2) (EC2 environment construction / Linux / MySQL settings)
Set up an Objective-C 2.0 development environment on Linux
Build an Arch Linux environment on Raspberry Pi
Daemonizing processes on Linux
Install python on WSL
Environment construction: GCP + Docker
Django project environment construction
python windows environment construction
jblas on Arch Linux
Go language environment construction
ConoHa environment construction memo
NAT router on Linux
homebrew python environment construction
PyData related environment construction
Anaconda-4.2.0-python3 environment construction (Mac)
Python development environment construction
YOLO v4 environment construction ①
Develop .NET on Linux
Wake on lan on Linux
Linux PATH environment variable
pyenv + fish environment construction
python2.7 development environment construction
BigGorilla environment construction memo
Monitor traffic on Linux
grip environment construction onCentOS6.5