ggil@RAZ-188:~$ ssh
-bash: ssh: command not found

When you fresh install Debian on WSL, you need to install essential packages. 

 

1. Update the Package Manager

ggil@RAZ-188:~$ 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 ggil:
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [53.0 kB]
Ign:2 http://deb.debian.org/debian stretch InRelease
Get:3 http://deb.debian.org/debian stretch-updates InRelease [93.6 kB]
Get:4 http://deb.debian.org/debian stretch Release [118 kB]
Get:5 http://deb.debian.org/debian stretch Release.gpg [3,177 B]
Get:6 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [778 kB]
Get:7 http://deb.debian.org/debian stretch/main amd64 Packages [7,080 kB]
Get:8 http://security.debian.org/debian-security stretch/updates/main Translation-en [365 kB]
Get:9 http://deb.debian.org/debian stretch/main Translation-en [5,377 kB]
Fetched 13.9 MB in 2s (5,337 kB/s)
Reading package lists... Done
ggil@RAZ-188:~$​

 

2. Install SSH Client Service

 

ggil@RAZ-188:~$ sudo apt-get install openssh-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  krb5-locales libedit2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libx11-6 libx11-data
  libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 xauth
Suggested packages:
  krb5-doc krb5-user keychain libpam-ssh monkeysphere ssh-askpass
The following NEW packages will be installed:
  krb5-locales libedit2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libx11-6 libx11-data
  libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 openssh-client xauth
0 upgraded, 16 newly installed, 0 to remove and 56 not upgraded.
Need to get 2,954 kB of archives.
After this operation, 10.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security stretch/updates/main amd64 krb5-locales all 1.15-1+deb9u3 [94.1 kB]
Get:2 http://deb.debian.org/debian stretch/main amd64 libxau6 amd64 1:1.0.8-1 [20.7 kB]
....
....
Setting up openssh-client (1:7.4p1-10+deb9u7) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
ldconfig: /usr/lib/wsl/lib/libcuda.so.1 is not a symbolic link

ggil@RAZ-188:~$

 

2.1 Setup key store. If you don't have ".ssh" folder at account home folder, your SSH key store is not configured. 

ggil@RAZ-188:~$ ls -l ~/.ssh
ls: cannot access '/home/ggil/.ssh': No such file or directory
ggil@RAZ-188:~$

2.2 Create folder and set permission

ggil@RAZ-188:~$ mkdir -p ~/.ssh
ggil@RAZ-188:~$ chmod -R go= ~/.ssh
ggil@RAZ-188:~$ ls -al
total 24
drwxr-xr-x 3 ggil ggil 4096 Jun 16 23:01 .
drwxr-xr-x 3 root root 4096 Jun 16 22:41 ..
-rw-r--r-- 1 ggil ggil  220 Jun 16 22:41 .bash_logout
-rw-r--r-- 1 ggil ggil 3526 Jun 16 22:41 .bashrc
-rw-r--r-- 1 ggil ggil  675 Jun 16 22:41 .profile
drwx------ 2 ggil ggil 4096 Jun 16 23:01 .ssh
ggil@RAZ-188:~$

 

3. git installation

ggil@RAZ-188:~$ sudo apt-get install git
[sudo] password for ggil:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  ca-certificates git-man less libcurl3-gnutls liberror-perl libexpat1 libgdbm3 libldap-2.4-2 libldap-common
  libnghttp2-14 libperl5.24 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh2-1 libssl1.1 openssl patch
  perl perl-base perl-modules-5.24 rename rsync
Suggested packages:
  gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk gitweb git-arch git-cvs
  git-mediawiki git-svn libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap
  libsasl2-modules-otp libsasl2-modules-sql ed diffutils-doc perl-doc libterm-readline-gnu-perl
  | libterm-readline-perl-perl make openssh-server
The following NEW packages will be installed:
  ca-certificates git git-man less libcurl3-gnutls liberror-perl libexpat1 libgdbm3 libldap-2.4-2 libldap-common
  libnghttp2-14 libperl5.24 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh2-1 libssl1.1 openssl patch
  perl perl-modules-5.24 rename rsync
The following packages will be upgraded:
  perl-base
1 upgraded, 24 newly installed, 0 to remove and 55 not upgraded.
Need to get 17.6 MB of archives.
After this operation, 80.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian stretch/main amd64 perl-base amd64 5.24.1-3+deb9u7 [1,346 kB]
....
....
Processing triggers for ca-certificates (20200601~deb9u2) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
ggil@RAZ-188:~$ git --version
git version 2.11.0
ggil@RAZ-188:~$

 

4. wget installation

ggil@RAZ-188:~$ sudo apt-get install wget
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  wget
1 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
Need to get 800 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian stretch/main amd64 wget amd64 1.18-5+deb9u3 [800 kB]
Fetched 800 kB in 0s (5,564 kB/s)
(Reading database ... 13295 files and directories currently installed.)
Preparing to unpack .../wget_1.18-5+deb9u3_amd64.deb ...
Unpacking wget (1.18-5+deb9u3) over (1.18-5+deb9u2) ...
Setting up wget (1.18-5+deb9u3) ...
ggil@RAZ-188:~$ wget --version
GNU Wget 1.18 built on linux-gnu.
....
....
Originally written by Hrvoje Niksic <hniksic@xemacs.org>.
Please send bug reports and questions to <bug-wget@gnu.org>.
ggil@RAZ-188:~$

 

5. Python installation

5.1 Before install Python, it is required to install necessary packages or dependencies. 

ggil@RAZ-188:~$ sudo apt-get install wget build-essential libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
Reading package lists... Done
Building dependency tree
....
....
The following packages will be upgraded:
  libc6 libsqlite3-0 zlib1g
3 upgraded, 148 newly installed, 0 to remove and 51 not upgraded.
Need to get 103 MB of archives.
After this operation, 463 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian stretch/main amd64 libc6 amd64 2.24-11+deb9u4 [2,694 kB]
....
....
Processing triggers for sgml-base (1.29) ...
Processing triggers for systemd (232-25+deb9u4) ...
ggil@RAZ-188:~$

 

5.2 Python 3.10 requires openssl 1.1.1 or newer. Following instruction is for upgrading openssl.

  1. Fetch the tarball: wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz  
    1. When you experience certificate error for openssl.org, please refer following guide. (https://blog.puiup.net/2021/11/solved-issued-certificate-has-expired.html)
  2. Unpack the tarball with tar -zxf openssl-1.1.1o.tar.gz && cd openssl-1.1.1o
  3. Issue the command ./config.
  4. Issue the command make (You may need to run sudo apt install make gcc before running this command successfully).
  5. Run make test to check for possible errors.
  6. Backup current openssl binary: sudo mv /usr/bin/openssl ~/tmp
  7. Issue the command sudo make install.
  8. Create symbolic link from newly install binary to the default location:
    sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
    
  9. Run the command sudo ldconfig to update symlinks and rebuild the library cache.

 

5.3 Download Python release, unzip

ggil@RAZ-188:~$ wget https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz
--2022-06-16 23:37:49--  https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz
Resolving www.python.org (www.python.org)... 146.75.92.223, 2a04:4e42:87::223
Connecting to www.python.org (www.python.org)|146.75.92.223|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 25628472 (24M) [application/octet-stream]
Saving to: ‘Python-3.10.5.tgz’

Python-3.10.5.tgz             100%[=================================================>]  24.44M  6.87MB/s    in 3.6s

2022-06-16 23:37:52 (6.85 MB/s) - ‘Python-3.10.5.tgz’ saved [25628472/25628472]

ggil@RAZ-188:~$ tar xzf Python-3.10.5.tgz
ggil@RAZ-188:~$ cd Python-3.10.5
ggil@RAZ-188:~/Python-3.10.5$

5.4 Build and install

ggil@RAZ-188:~/Python-3.10.5$ ./configure --enable-optimizations
checking build system type... x86_64-pc-linux-gnu
....
....
config.status: creating pyconfig.h
creating Modules/Setup.local
creating Makefile
ggil@RAZ-188:~/Python-3.10.5$
ggil@RAZ-188:~/Python-3.10.5$ make -j 2
Running code to generate profile data (this can take a while):
# First, we need to create a clean build with profile generation
# enabled.
make profile-gen-stamp
make[1]: Entering directory '/home/ggil/Python-3.10.5'
....
....
renaming build/scripts-3.10/2to3 to build/scripts-3.10/2to3-3.10
make[1]: Leaving directory '/home/ggil/Python-3.10.5'
ggil@RAZ-188:~/Python-3.10.5$ 
ggil@RAZ-188:~/Python-3.10.5$ sudo make install
[sudo] password for ggil:
if test "no-framework" = "no-framework" ; then \
....
....
Installing collected packages: setuptools, pip
Successfully installed pip-22.0.4 setuptools-58.1.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
ggil@RAZ-188:~/Python-3.10.5$
ggil@RAZ-188:~/Python-3.10.5$ python3 --version
Python 3.10.5
ggil@RAZ-188:~/Python-3.10.5$

5.5 install pip

ggil@RAZ-188:~/Python-3.10.5$ sudo apt-get install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
....
....
After this operation, 102 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.debian.org/debian-security stretch/updates/main amd64 libpython3.5-minimal amd64 3.5.3-1+deb9u5 [574 kB]
....
....
Processing triggers for systemd (232-25+deb9u4) ...
ggil@RAZ-188:~/Python-3.10.5$
ggil@RAZ-188:~/Python-3.10.5$ pip3 --version
pip 22.0.4 from /usr/local/lib/python3.10/site-packages/pip (python 3.10)
ggil@RAZ-188:~/Python-3.10.5$

5.6 install pipenv

ggil@DESKTOP-6OL58HT:~/$ sudo pip3 install pipenv
Collecting pipenv
  Downloading pipenv-2022.11.30-py3-none-any.whl (2.9 MB)
  ....
Installing collected packages: distlib, virtualenv-clone, platformdirs, filelock, certifi, virtualenv, pipenv
Successfully installed certifi-2022.9.24 distlib-0.3.6 filelock-3.8.0 pipenv-2022.11.30 platformdirs-2.5.4 virtualenv-20.17.0 virtualenv-clone-0.5.7
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

[notice] A new release of pip available: 22.2.2 -> 22.3.1
[notice] To update, run: pip3 install --upgrade pip
ggil@DESKTOP-6OL58HT:~/$ pipenv --version
pipenv, version 2022.11.30
ggil@DESKTOP-6OL58HT:~/$

 

1. Enable Windows Hypervisor Platform

If you didn't enable this feature, you may see "No action was taken as a system reboot is required." message when you install WSL.

2. Install WSL with Administrative Powershell

wsl --install --d debian

 

2.1 Checking list of WSL distro

wsl --list --online 

 

3. Create account for distro plaform. New windows may show "Installing, this may take a few minutes..." awhile, just type Enter. So you can create new UNIX account. 

 

+ Recent posts