-
Notifications
You must be signed in to change notification settings - Fork 48
Setting Up Unix For Windows
Credits: Unix Workshop AY2020/21
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 in Semester 1, AY2020/21.
There are two versions, WSL 1 and, a newer, WSL 2.
For the Unix@Home workshop, it suffices for attendees to install WSL 1.
Before you proceed with the instructions below, you need to make sure that:
-
You have 64-bit versions of Windows 10, version 1607 or higher (Here is how you check);
-
You have administrator access to your Windows 10; And
-
You have an SoC Unix account. You can create an SoC Unix account here. For SoC students, this username is something that sticks with you for the rest of your SoC life -- so choose wisely.
Before you install WSL 1, you need to first enable the "Windows Subsystem for Linux" feature by running the following command in PowerShell.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
You can achieve this step by:
- Hit ⊞ Win to open the Start menu, type
PowerShell
, then right-click on Windows PowerShell, and click "Run as administrator" - Copy the command above by selecting it and then hitting Ctrl + C
- Go to your PowerShell window and paste the command above by hitting Ctrl + V . Press enter if needed to run the command.
After restarting your computer, go to the Microsoft Store and get Ubuntu 18.04 LTS.
The latest Ubuntu 20.04 LTS is reported reported to be unstable on WSL 1.
Follow the on-screen instructions to install.
When you are asked to create a user account and password, we suggest that you choose a Unix username that is that same as your SoC Unix username.
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.
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 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
Codecrunch Contributions
Piazza Contributions
Wiki Contributions
Guides
Setting Up Checkstyle
Setting Up Java
Setting Up MacVim
Setting Up Sunfire
Setting Up Unix For Mac
Setting Up Unix For Windows
Setting Up Vim
Setting up SSH Config
CS2030 Contents
Lecture 1 SummaryCompile-run vs Run-time Summary
Quick Guide To Abstraction
Generics and Variance of Types
Comparable vs Comparator
Summary of completable future
CS2030S Notes
ELI5 Optional.map vs Optional.flatMap
PECS Example Code
Java Collection Framework (Iterator)
Generic
Generic Type Parameter and Generic Wildcard
Calculator
Lambda-Expression
Single Abstract Method (SAM)
Method Reference
Functional Interfaces 2
Simple Usage of Sandbox
Associative-but-not-commutative
Higher Order function
Functional Programming
Calculator With Functor
Eager Evaluation VS Lazy Evaluation
Simple Usage of Lazy Evaluation
Lazy Evaluation for LazyList
Lazy Evaluation for BinaryTree
Stream
Parallel Stream
Optional
Simple Usage of Stream
Asynchronous Programming
Notes on CompletableFuture
Notes on CompletableFuture 2
Simple Usage of CompletableFuture
Mind Map
Exception Handling
Links
CS2030 Java Style Guide
CS2030 Javadoc Specification
JDK 11 Download Link
JDK 11 API Docs
Codecrunch
Piazza Forum