-
Notifications
You must be signed in to change notification settings - Fork 4
Setting Up Unix For Windows
Credits: Prof Henry Chia And Prof Ooi Wei Tsang
WSL, or Windows Subsystem for Linux, is a subsystem that allows users to run a Unix computing environment within Windows 10. This is the recommended method for having a local Unix computing environment for your Windows 10 machine, for the purpose of CS1010, CS2030, CS2030S, and CS2040.
-
Search Powershell and run as administrator
-
Run the following command which helps you to enable WSL on your windows Machine
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
- As WSL Version 2 is unstable at the moment, we will default to the usage of WSL Version 1 using the following command:
wsl --set-default-version 1
- Following which, we can using the web to invoke a request to
download the necessary
appx
file to download the package forwsl-ubuntu
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile C:\Ubuntu.appx -UseBasicParsing
- Once the installation is complete, run the following command to install this package
Add-AppxPackage C:\Ubuntu.appx
To launch WSL, you can hit ⊞ Win + R and type in Ubuntu
followed by enter. This should bring up the Unix command-line interface for you to interact with the Unix computing environment.
if there's an error "Windows cannot find 'Ubuntu'", you can try running WSL by hitting ⊞ Win + R and typing in wsl
followed by enter. You will be in the user home directory, navigate to other directories with the cd
command. eg. cd Desktop/CS2030/
View other directories with the ls
command.
Ubuntu comes with apt
as the package manager, which is a convenient way to list, search, install, update, and uninstall software and libraries in WSL.
After you have set up WSL, run the following:
sudo apt update
What it does:
-
apt
is a command to install, upgrade, search, and uninstall software and other packages in Ubuntu. -
apt update
asksapt
to obtain the latest list of available packages from the Internet. -
sudo
performsapt update
with a super-user's level permission. This command may ask you to enter your password. (Note: super-user means administrator in Unix).
In your current directory, do run the command explorer.exe .
to open your current directory using windows explorer!
In the event that you are unable to edit sets of code in Jshell
, you will need to setup its editor to vim.
As a result, please do either one of the two steps:
-
bash
shell: add in the following lineexport JSHELLEDITOR=vim
-
jshell
: Within your jshell program, run this command:/set editor vim
Peer Learning
Guides
Setting Up Checkstyle
Setting Up Java
Setting Up MacVim
Setting Up Stu
Setting Up Unix For Mac
Setting Up Unix For Windows
Setting Up Vim
Setting up SSH Config
SSH Without Password
Copying Files From PE Nodes
Using tmux
CS2030 Contents
Lecture 1 SummaryLecture 2 Summary
Access Modifiers
Lecture 3 Summary (Polymorphism)
Compile Time Type VS Runtime Type
Abstraction, Encapsulation, Inheritance, and Polymorphism
SOLID Principles
Class VS Abstract Class VS Interface
Comparable VS Comparator
Generic Types T
HashMap
Raw Types with Generic
Lambda expression
PECS (Producer Extends Consumer Super)
Optional
Streams
Parallel Streams
Monad
Functors and Monads with Category Theory