To restart your display manager.
sudo systemctl restart display-manager
For bash scripts, use:
#!/bin/bash -eu
The e
exits the script on failure and u
considers reading unset variables a failure.
Arch
If, while trying to install a package, you get an error like:
error: failed retrieving file ...
Run pacman -Syu thing
to update your package lists.