...
But yes, I do wonder why the heck is he trying to run this as root? I guess he likes playing with fire. Given this I come to think that his messed up config likely isn't a KiCAD issue ...
ok lets start from begining,
first try
1. i go to kicad and follow instructions for ubuntu and add PPA
2. install kicad from software manager
no libraries
try x2, remove everything
1. reload ppa from terminal
2. use terminal to fetch all needed packages
in short this:
sudo add-apt-repository --yes ppa:kicad/kicad-5.1-releases
sudo apt update
sudo apt install --install-recommends kicadno libraries
searching around net, some people say go to root/ folder and remove kicad folder for help with this issue, there is no kicad folder there.
try x3
reinstall everything trough terminal commands like on x2, manualy download libraries from git and add them to my libraries folder, point to location of libraries in kicad settings(path config).
no libraries
as someone else said here do not put words in my mouth, and dont try to put this issue on me as there is a lot of users complaining about same issues over the nets and over time, even quick google search confirms that, there is one thread on this forum also even from 2017.
sorry if my engrish is not up to standard as it is not my native tongue and could lead to some misunderstandings.
only thing i have not tried yet is to manualy replace automatic downloaded libraries with ones from github in their original folders, i have not tried it yet as i use my secondary drive for projects and libraries as automatic backup is made on external drive, and in case i must use folders on os drive i would have to manualy copy that each time which is not realy fun but if it works who cares.