Back to Setup

Cli Tools

_partials/cli_tools.md

latest2.6 KB
Original Source

Command line tools

Check the locale

The locale is a mechanism allowing to customize programs to your language and country.

Let's verify that the default locale is set to English, please type this in the Ubuntu terminal:

bash
locale

If the output does not contain LANG=en_US.UTF-8, run the following command in a Ubuntu terminal to install the english locale:

bash
sudo locale-gen en_US.UTF-8

If after, you receive a warning (bash: warning: setlocale: LC_ALL: cannot change locale (en_US.utf-8)) in your terminal, please do the following:

<details> <summary>Generate locale</summary>

Please, run this lines in your terminal.

bash
sudo update-locale LANG=en_US.UTF8
sudo apt-get update
sudo apt-get install language-pack-en language-pack-en-base manpages
</details>

Zsh & Git

Instead of using the default bash shell, we will use zsh.

We will also use git, a command line software used for version control.

Let's install them, along with other useful tools:

  • Open an Ubuntu terminal
  • Copy and paste the following commands:
bash
sudo apt update
bash
sudo apt install -y curl git imagemagick jq unzip vim zsh tree

These commands will ask for your password: type it in.

:warning: When you type your password, nothing will show up on the screen, that's normal. This is a security feature to mask not only your password as a whole but also its length. Just type in your password and when you're done, press Enter.

GitHub CLI installation

Let's now install GitHub official CLI (Command Line Interface). It's a software used to interact with your GitHub account via the command line.

In your terminal, copy-paste the following commands and type in your password if asked:

bash
sudo apt remove -y gitsome # gh command can conflict with gitsome if already installed
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
bash
sudo apt update
bash
sudo apt install -y gh

To check that gh has been successfully installed on your machine, you can run:

bash
gh --version

:heavy_check_mark: If you see gh version X.Y.Z (YYYY-MM-DD), you're good to go :+1:

:x: Otherwise, please contact a teacher