How to Install Manjaro
Tags: bash, devops, tooling, programming
Published: 2021-12-16 17:38:56

---
title: How to Install Manjaro
published: true
date: 2021-11-19 00:15:00 UTC
tags: bash, devops, tooling, programming
canonical_url: https://www.benjaminrancourt.ca/how-to-install-manjaro
cover_image: https://www.benjaminrancourt.ca/images/pexels-roman-odintsov-4955257.jpg
---

Over the previous years, I had to install [**Manjaro**](https://manjaro.org/) a couple of times and to ease the process for the next time, I began to document more and more the command I typed. You will find below the procedure that I will try to follow the next time I want to install this distribution.  🤓

> **Warning** : this procedure may be _incomplete_ or may be _not working on your setup_. Follow it cautiously. 🚸

## Create a bootable USB

1. Download the distribution on the [official website](https://manjaro.org/download/), such as the [XFCE edition](https://manjaro.org/downloads/official/xfce/)
2. Insert a USB key into your computer
3. Open a terminal
4. Make yourself a superuser with `sudo su`
5. Take note of the path of the inserted USB key with `fdisk -l`
6. Burn the ISO on the USB key with `dd bs=4M if=/home/ranb2002/Downloads/manjaro-xfce-21.1.6-minimal-211017-linux513.iso of=/dev/sda status=progress`
7. Remove the USB key

## BIOS configuration

Depending on your computer, you may need to activate the [UEFI](https://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface) mode to be able to boot from your USB key:

1. Insert your USB key and restart the computer
2. Repeatedly press on `ESC` on your keyboard to enter the BIOS when your computer is booting
3. Activate the UEFI
4. Boot from the USB key

## Installation

Just follow the instructions on your screen! 😉

## Install applications

Some applications may exist only on the [AUR repository](https://aur.archlinux.org/). If it is not already activated, you can look at [this tutorial](https://www.fosslinux.com/2103/how-to-install-google-chrome-in-manjaro-linux.htm) to activate it with _Package Manager_.

```bash
#######################################
# (su) Multiple applications from AUR #
#######################################
# Switch to the super user
sudo su

# Make sure all installed applications are up to date
pacman -Syyu

# Install applications with pacman
pacman -S \
  noto-fonts-emoji \
  dnsutils \ 
  dockbarx \
  docker \
  firefox-beta-bin \
  firefox-nightly \
  google-chrome \
  google-chrome-beta \
  google-chrome-dev \
  gradle \
  gradle-doc \
  jdk11-openjdk \
  jetbrains-toolbox \
  nvm \
  sshfs \
  system-config-printer \
  teams \
  vim \
  vmware-horizon-client \
  vmware-keymaps \
  xfce4-dockbarx-plugin
  
exit

#######################################
# Node.js #
#######################################
# Finish the setup of NVM
echo 'source /usr/share/nvm/init-nvm.sh' >> ~/.bashrc
exec $SHELL

# Install the latest version of NVM
nvm install 16.13.0 && nvm use 16.13.0 && nvm alias default 16.13.0 && node --version

#######################################
# (su) Misc #
#######################################
# Switch to the super user
sudo su

# Disable Linux PC speaker beep permanently
echo "blacklist pcspkr" | tee /etc/modprobe.d/nobeep.conf

# Set ntp so that the clock is set to the correct time
timedatectl set-ntp true

#######################################
# (su) Docker #
#######################################
# Start Docker now
systemctl start docker

# Start Docker when starting the computer
systemctl enable docker

# Show the version of Docker (ex. Docker version 20.10.9, build c2ea9bc90b)
docker --version

# Add your user ID to the docker group to be able to manage it as non-root
usermod -a -G docker ranb2002

#######################################
# (su) Restart #
#######################################
# Restart the computer
shutdown --reboot
```

## Generate SSH keys

```
# Generate SSH keys with ssh-keygen
ssh-keygen -t ed25519 -C "ranb2002-laptop"
ssh-keygen -t rsa -b 4096 -C "ranb2002-laptop"

# See the generated keys
cat ~/.ssh/id_ed25519.pub
cat ~/.ssh/id_rsa.pub
```

## Git

```bash
# Check your settings
git config --list

# Set your identity
git config --global user.name "Benjamin Rancourt"
git config --global user.email benjamin.rancourt@email.com

# Set Vim as default editor for Git
git config --global core.editor vim

# Set some useful aliases (https://git-scm.com/book/tr/v2/Git-Basics-Git-Aliases)
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status

# https://www.stefanjudis.com/snippets/a-git-alias-to-show-a-detailed-git-branch-overview/
git config --global alias.zup "for-each-ref --sort='authordate:iso8601' --format='%(color:green)%(authordate:relative)%09%(color:white)%(refname:short) / %(contents:subject)' refs/heads"

## Unstage a file (git unstage fileA)
git config --global alias.unstage 'reset HEAD --'

## See the last commit easily (git last)
git config --global alias.last 'log -1 HEAD'

## Set the push default config to simple
git config --global push.default simple

## Add Git completion
cd ~ && wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
echo "source ~/git-completion.bash" >> ~/.bashrc

## Add Git branch name to bash prompt
# Follow instructions on https://coderwall.com/p/fasnya/add-git-branch-name-to-bash-prompt

# TODO To document correctly
git config --global commit.gpgsign true
```

## Upgrade

If you want to update applications and dependencies on your computer:

```bash
# Via pacman
# Switch to the super user
sudo su

pacman -Syu
pacman --sync --refresh --sysupgrade

# Or, via pamac
pamac update
```

Hopes it could also help you if you want this distribution! 😇