Setup
Updated: April 21, 2020
Installation of headless OS onto a Raspberry Pi.
Table of Contents
MANJARO MINIMAL
- Download Pi4-Manjaro Minimal
- Install and use BalenaEtcher on microSD card.
- Place flashed card into pi. Connect ethernet cable and power the pi up.
- Connect to the pi using ssh.
ssh root@localip
- Go through setup as usual. Pi will restart itself, ending your ssh session. Reconnect in a few minutes.
- Setup ssh
ssh-keygen -t ed25519 -C "username@email.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
- Copy any ssh keys
cat ~/.ssh/id_ed25519.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys'
- Mirrors may be broken (updating will return 404s) Fix with:
- Download New Mirror Find the pacman-mirrorlist-YYYYMMDD-1-any.pkg.tar.xz
wget https://ftp-osl.osuosl.org/pub/manjaro-arm/repo/stable/core/aarch64/pacman-mirrorlist-YYYYMMDD-1-any.pkg.tar.xz
If wget is broke use wget or download the package on another machine to scp it over to your pi.
scp pacman-mirrorlist-YYYYMMDD-1-any.pkg.tar.xz user@localip:~
Then on the pi run in order:
sudo pacman -U pacman-mirrorlist-* # updates the mirrorlist with the one we just scp'd to the pi
sudo pacman-mirrors -g # updates mirrors by geo location
sudo pacman -Syyu # since we changed our mirrors we have to use extra y to update them
sudo pacman -S wget git zsh vim # should always have this - Manjaro does not be default (extra)
add oh-my-zsh to the zsh we just installed
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
sudo pacman -S zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
On any linux machine if you want easy ssh set up a
~/.ssh/config
file.
Host *
IdentitiesOnly yes
IdentityFile ~/.ssh/id_ed25519
Host pi4
HostName 192.168.0.12
Port 4321
User drax
Change ssh port & whitelist users in
~/etc/ssh/sshd_config
file.
Port 4321
AllowUsers drax
You will need to sudo systemctl restart sshd
for changes to take effect.
The changes to these two files will make it so that the user drax could use ssh pi4
to connect via custom port instead of 22.
RASPIAN
DOWNLOAD & Install
- Go to Pi to get download.
- BalenaEtcher
- Place into pi & boot up. You can find out it’s ip with:
ping raspberrypi
ssh to the pi3.
sudo raspi-config
set up localization (en-utf-8), time, file exapander, chg passwd
sudo nano /etc/default/locale
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
LANGUAGE=en_US.UTF-8
Change the hostname from pi to somthing else
sudo nano /etc/hostname
sudo nano /etc/hosts
sudo shutdown -r now
INSTALL
sudo apt install dirmngr
sudo apt install gnupg2
sudo apt install dnsutils
ADD KEYS (if/whatever error keys show up)
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B48AD6246925553
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7638D0442B90D010
sudo apt update
sudo apt install certbot -t stretch-backports -y --allow # instead of --force-yes