1

currently running Ubuntu 20.04.1 LTS. I changed the /etc/os-release file to match that of an older version to fool a program I was trying to install. While the file was changed Ubuntu installed some updated packages, but they all still came from the focal repository, despite the OS no longer identifying as focal. I changed the file back to the way it was and rebooted and now have several errors. Every time the system boots it runs the Initial Setup program. The desktop is stuck using the default Ubuntu environment (I had a tweaked version of GNOME installed). But I still log in with my same user and all my files are intact. I can't launch nearly any program; they all crash with varying errors. Any ideas on how to fix this aside from reinstalling?

cjm
  • 49
  • 1
  • 5

2 Answers2

7

You have to fill the /etc/os-release file with contents below:

NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

or reinstall its package by sudo apt-get install --reinstall base-files .

N0rbert
  • 99,918
  • If I have messed up my etc/*-release file by accident. If I get the correct file for the distro I was using before, what do I need to run afterwards to "reset" everything, packages versions etc back to what I wanted originally, before I messed it up? Context: I'm running bodhi Linux but managed to convert my whole release file to that of Ubuntu 18 and now having issues running apps. – Chuck Sep 21 '23 at 20:15
1

I fixed it on Ubuntu with:

sudo ln -s /usr/lib/os-release /etc/os-release