Tmux: invalid LC_ALL, LC_CTYPE or LANG

Tried to install tmux and zsh using sudo apt install tmux or sudo apt install zsh on my BeagleBones as both are very useful tools to use over ssh.
However, as the installation was taking place a warning appeared and then when I ran tmux it throws the following error:
tmux: invalid LC_ALL, LC_CTYPE or LANG

Solution: Following the steps below helps solve this

  1. vim /etc/locale.gen
    Either vim or whatever text editor you prefer, and then
  2. uncomment the line that says: en_US.UTF-8 UTF-8
  3. run locale-gen
  4. reboot

Your problem will most likely be solved.