Install VS Code on RHEL8

CLI stuff (from https://code.visualstudio.com/docs/setup/linux)

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
sudo dnf check-update
sudo dnf -y install code

Running code the first time I got “unable to write program user data” with a complaint about some directories it couldn’t write to. Long story short I created the directory it was complaining about and gave ownership to my normal user:

sudo mkdir /run/user/1000
sudo chown $USER.$USER /run/user/1000

Leave a Comment