To install your compiler, git, and make, you will need to install Windows Subsystem for Linux (WSL).
cmd
.Run as administrator
option from the right click menuwsl --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.
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
.
Debian, Ubuntu Linux, Raspberry Pi OS (apt)
to your terminalgh auth login
in your terminalGitHub.com
and hit the enter keyHTTPS
and hit the enter keyGitHub.com
and hit the enter keyY
to authenticating with your GitHub credentials and hit the enter keyLogin with a web browser
and hit the enter keycontinue
.Authorize github
buttonNow you won’t have to use your GitHub login each time you use the git
program.
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!