i ran as superuser the command : dnf remove fedora-release i was reading a tutorial and i thaught it would remove the epel fedora repository but it was the command before.

that was a terrible mistake and the result is a black screen and i can't do anything. Did I just lost all my data ? (/home, /opt, etc?) and please do you know if by any chance I can install fedora again and get back my environment as it was.

Any help would be appreciated, thank you in advance.


1 Answer 1


The fedora-release package contains only one config file /usr/lib/os-release so removing it isn't that big deal. Unfortunately a lot of packages depend on it and these were automatically uninstalled too. Good news is that data in your /home are untouched. You should still be able to backup them from LiveCD.

It might be possible to save the system either from the rescue mode or from the LiveCD. Try following this tutorial for resetting root password but instead of the step where you should run passwd to reset root password, run dnf install fedora-release. This might not bring all the removed dependencies back, so also install the Workstation group (assuming you are using Fedora Workstation) dnf groupinstall "Fedora Workstation". It's is possible that DNF won't work, because the uninstalled packages contain some definitions like version number. Also it is possible that repositories configuration was removed. You might need to manually download fedora-release and fedora-repos packages from the mirrors (link for Fedora 32) and install them manually using rpm -i --no-deps <package> in the chroot.

If this doesn't work, you can still simply reinstall Fedora. If you /home on a separate partition or logical volume (which is default in Fedora), you can simply reuse existing /home without formatting it during installation (see Fedora installation guide for details and don't forget to backup your data first).

I see a lot of potential issues with the manual recovery, the reinstallation is probably the easiest solution.

  • Thank you VERY MUCH for your complete answer. I'll try and if any of this works for me i'll accept your answer for sure.
    – batmaniac
    Oct 15, 2020 at 18:15
  • 2
    You can also just run dnf history to see all the recent transactions, and then run dnf history undo ### to undo the transaction that removed the fedora-release package, getting you back to what you had before removing it. If it was the most recent dnf command you ran, just run dnf history undo last. (all running as root)
    – jsbillings
    Oct 16, 2020 at 20:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .