• Home
  • Akiko Yokoyama
  • Contact
  • Feed
ja | en |

Setup for WSL / Windows Subsystem for Linux + Ubuntu

Windows Subsystem for Linux + Ubuntu Setup

Reference site.

  • Rebuilding a WSL + Hyper + fish shell environment on Windows - Qiita
  • Installing and setting up WSL (Windows Subsystem for Linux) \blur.pl
  • Using WSL to run Linux on Windows 10 - Glodia Corporation

Run from PowerShell with administrative privileges

powershell.exe

1
> Start-Process powershell.exe -Verb runas

Run as administrator

1
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

You will be asked to reboot. then reboot.

Search for Linux from Windows App Store, install Ubuntu from the featured page

Start Ubuntu

Change Username and Password

Update as is

1
2
$ sudo apt-get update
$ sudo apt-get upgrade

Install libraries

1
$ sudo apt-get install curl jq git openssl 

ag command installation

1
$ apt-get install silversearcher-ag

command available

1
$ ag -a test ~/Documents/

Configure shortcuts

Put symbolic links to the desktop and documents

  • Reference: Using Windows Subsystem for Linux (WSL) in Windows 10 on a daily basis - Cukurog (2017-11-08)

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    
    $ ln -s /mnt/c/Users/akiko.yokoyama/Documents ~/Documents
    $ ln -s /mnt/c/Users/akiko.yokoyama/Desktop ~/Desktop
    $ ls -la ~/Desktop
    lrwxrwxrwx 1 yokoyama yokoyama 35 Mar 4 10:20 /home/yokoyama/Desktop -> /mnt/c/Users/akiko.yokoyama/Desktop
    $ ls -la ~/Desktop
    lrwxrwxrwx 1 yokoyama yokoyama 35 Mar 4 10:20 /home/yokoyama/Desktop -> /mnt/c/Users/akiko.yokoyama/Desktop
    $ ls -la ~/Desktop/
    Atom.lnk Postman.lnk
    Search by Everything.lnk Slack.lnk
    Fork.lnk desktop.ini
    GitHub Desktop.lnk
    

Change the color scheme of the terminal

It was published officially by windows and was so easy!

https://github.com/Microsoft/console/releases

Sidenote: Color theme for console, makes WSL easier to read! - lisz-works https://www.lisz-works.com/entry/ms-color-tool#入手方法 %E6%96%B9%E6%B3%95)

Install Pyenv

1
2
3
4
5
6
7
   47 git clone https://github.com/pyenv/pyenv.git ~/.pyenv
   48 ls -la
   49 echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
   50 ls -la
   51 echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
   52 echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
   53 source ~/.bash_profile

Install Redis

Install

1
$ sudo apt-get install redis

Startup test

1
2
$ redis-server
<startup

set / get sample

1
2
3
4
5
$ redis-cli
127.0.0.1:6379> set hoge fuga
OK
127.0.0.1:6379> get hoge
"fuga".

Install MySQL

1
$ sudo apt-get install mysql-server

I’m kind of stumped, because I stopped MySQL halfway through.

Thanks to this, I think I can manage it https://askubuntu.com/a/1091405

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Ok I will answer to my question, thanks for the help, so what I have done after many try/error:
First, ensure you can run these commands without any error: (don't hesitate to reboot to avoid locks in apt)
sudo apt-get remove --purge mysql*
sudo apt update
sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean
sudo dpkg --configure -a
Delete: (do backup before if you want but do no leave the files in these directories, even with .bak or .old extensions)
    - /etc/mysql
    - /var/lib/mysql
If you have an error mentioning alternatives, run: (replace my.cnf) by the file indicated in the error message)
sudo update-alternatives --remove my.cnf
Then reinstall:
Then reinstall: sudo apt install mysql-server
Check now, if at least the mysql service is running:
sudo service mysql status
If still not OK, try to force reinstall:
If still not OK, try to force reinstall: sudo apt install mysql-server --reinstall
And reconfigure:
sudo dpkg-reconfigure mysql-server

Hyper configuration

1
2
3
4
5
6
Add the following to Pulugins
'hyper-material-theme',
'hyperlinks ',
'hypercwd',
'hyper-search',
'hyper-statusline',

It’s a list of cool plugins.

Awesome Hyper

  • Hyper configuration file path
  • vim /mnt/c/Users/yokoyama/.hyper.js
user-image
Akiko yokoyama in Coding
5 minute read

Similar Posts

Actually Made This Blog Multilingual Three Years Ago

Review of the Leica Q2

Re-Builded the Blog with Jekyll + Netlify + Github

Excel Tips vol.1

Setting hubot adapter slack & chatwork

user-image

Published Jan 15, 2019

Akiko yokoyama in Coding

Also found in

  • Coding

Share this article

Actually Made This Blog Multilingual Three Years Ago

Review of the Leica Q2

Re-Builded the Blog with Jekyll + Netlify + Github

Excel Tips vol.1

Setting hubot adapter slack & chatwork

How to install and setting hubot

  • Home
  • Akiko Yokoyama
  • Contact
  • Feed