Windows Setup Instuctions

Basic Setup

To install your compiler, git, and make, you will need to install Windows Subsystem for Linux (WSL).

  1. Hit the windows key on your keyboard and type cmd.
  2. Right click the Command Prompt app that appears on the start menu
  3. Select the Run as administrator option from the right click menu
  4. In the command prompt window that opens type: wsl --install -d Ubuntu

NOTE: If you happen to receive an error about needing to update the WSL kernel, microsoft has an update installer to help fix this problem. Install this update program and rerun the wsl --install -d Ubuntu command

Once you have WSL installed and reboot your PC, you will have a complete Linux distribution named Ubuntu available on your PC. You can open the environment from your start menu like any other program. If you do not see it on your start menu, you can always hit the Windows key on your keyboard and start typing Ubuntu to search for it.

The first time Ubuntu opens it will need to take some time to setup a few additional things. The first thing it will ask you to do is setup your UNIX username and password. The username will need to be lowercase and all one word. Make sure to remember your login information. When Ubuntu is finished setting up your account you will be greeted with a simple command line interface (CLI). This should be a line that starts with your username and ends with a $ and a blinking cursor. From here you can type in commands to your Linux operating system.

When describing commands in the following steps, I will prefix them with a $ character to indicate that this is a command line instruction. You do not need to type in the first $ character.

First, lets tell Ubuntu to go and get the latest list of programs and updates from the internet. You may need to use your password to make the following commands work, but note that you will not see your password (or anything really) appear as you type. This is security feature so prying eyes cannot see your password or know its length. This means you will need to use the force and type your password with confidence, hit enter, and hope for the best. :)

$ sudo apt update

The command sudo tells ubuntu that you would like to run the following command with administrator privileges (that’s why you need to type your password). You don’t need to use sudo for all commands, only for important stuff that affects the operating system like installing programs and updates. The apt program is your package manager that helps you install applications, libraries, and other useful things. The update option is a part of apt and tells that program to go out and update its list of packages.

When that finishes we will tell apt to apply any updates it found.

$ sudo apt dist-upgrade

This could take a while.

Now that we have the latest software for Ubuntu lets install our compiler, make, and git.

$ sudo apt install build-essential git

When you use the install option for apt you can list the names of programs or packages you want to install. The build-essential package is a metapackage. That is a fancy way for saying that build-essential is an alias for all the tools that are essential for building programs and installs all of them with one simple phrase (saves a lot of typing). Notice that we also can install git at the same time by putting a space between the packages and programs we would like to install.

Now that you have WSL installed for Windows and the Ubuntu operating system there is another command that may be helpful. With the WSL Ubuntu window open, type the following command:

$ explorer.exe .

The explorer.exe command tells Windows to open a Windows File Explorer Window. The . refers to the current directory in a UNIX path (if you don’t know the current directory you can use the command pwd). This way you can see all your files and folders through a graphical interface instead of just using the command line interface.

If you decided to use Visual Studio Code as your editor of choice, there is a plugin called Remote Development that will save you time on your work. It allows your editor to provide you with easier access to Ubuntu in WSL and gives you a convenient embedded terminal to run your code.

Install gh

We will need one more tool called gh to make using git with GitHub a little bit easier. Note that you must have complete the previous steps before you can install gh.

  1. Open the Ubuntu app terminal
  2. Copy and paste the command from the gh installation documentation under the heading Debian, Ubuntu Linux, Raspberry Pi OS (apt) to your terminal
  3. Wait for the install to complete
  4. Run: gh auth login in your terminal
  5. Use the arrow keys to select GitHub.com and hit the enter key
  6. Use the arrow keys to select HTTPS and hit the enter key
  7. Use the arrow keys to select GitHub.com and hit the enter key
  8. Say Y to authenticating with your GitHub credentials and hit the enter key
  9. Use the arrow keys to select Login with a web browser and hit the enter key
  10. Copy the code that appears in the terminal window
  11. Press the enter key
  12. Use the browser window the opens to login to GitHub (if you aren’t already logged in)
  13. After loging in, paste the code you copied from the terminal window into the browser and click continue.
  14. Click the Authorize github button

Now you won’t have to use your GitHub login each time you use the git program.

Configuring Git (First Time Only)

Open your Ubuntu app terminal and run the following commands replacing my name and email with your name and email address.

$ git config --global user.name "Drew Guarnera"
$ git config --global user.email dguarnera@wooster.edu
$ git config --global core.editor nano

That’s it, git is ready to go!