Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Instructions for setting up a development environment on Linux(Ubuntu, WSL2)

Satoshi Terasaki edited this page Sep 20, 2024 · 8 revisions

How to Configure a Development Environment on Linux

Introduction

This guide provides step-by-step instructions on how to set up a development environment on Linux. We use Ubuntu as a Linux distribution. This guide also should help WSL2 users.

WSL2 users guide

See https://learn.microsoft.com/en-us/windows/wsl/setup/environment#set-up-your-linux-username-and-password This is a step-by-step guide to the best practices for setting up a WSL development environment.

What You Will Learn

You will learn how to install various commands like wget, git, julia, make, and code using Advanced Packaging Tool a.k.a apt command. The commands contained within apt provide the means to install new software packages, upgrade existing software packages, update the package list index, and even upgrade the entire Ubuntu system.

O.K. let's get started.

Updating the package index

Open a terminal and run the following commands:

$ sudo apt update
$ sudo apt upgrade -y

To open a terminal on Ubuntu, refer The Linux command line for beginners.

As an example, to install the curl command, run the following command:

$ sudo apt install curl -y

The curl command is required to install Julia.

Install Julia

We follow this instruction to install Julia.

$ curl -fsSL https://install.julialang.org | sh -s -- --yes

This will install Juliaup(=Julia version manager) and allows us to use julia command. To check Julia is installed, run the following command:

$ julia --version

As of September 2024, this should output

julia version 1.10.5

You can launch Julia REPL by simply typing julia:

$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.10.5 (2024-08-27)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> println("Hello")
Hello
julia> exit()
$ # Back to Bash session

Install git, make command

Just run the following command:

$ sudo apt install git make -y

Install Visual Studio Code (VS Code)

We follow this instruction to install Visual Studio Code a.k.a VS Code:

Run the following commands:

$ sudo apt-get install wget gpg
$ wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
$ sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
$ echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" |sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
$ rm -f packages.microsoft.gpg

This will automatically install the apt repository and signing key to enable auto-updating using the system's package manager. Then update the package cache and install the package using:

$ sudo apt install apt-transport-https
$ sudo apt update
$ sudo apt install code

Now we can launch VS Code via $ code ..