archlinuxhardened / selinux

PKGBUILDs to build SELinux enabled packages for Arch Linux
145 stars 25 forks source link

How to uninstall SELinux? #94

Closed pablogzlezmora closed 2 years ago

pablogzlezmora commented 2 years ago

Please, How can I uninstall SELinux?

System: Arch Linux LTS

fishilico commented 2 years ago

Hello, I have never uninstalled SELinux, but if I were to do this, I would perform the following steps:

  1. Disable SELinux in the kernel boot command line (for example by adding selinux=0)
  2. Reboot
  3. Ensure that SELinux is disabled by running sestatus. This should display SELinux status: disabled
  4. Replace ...-selinux packages with their usual ones (for example systemd-selinux -> systemd), using pacman -S ...
  5. Reboot, so that core system components (such as systemd, pam, sudo, coreutils...) no longer depends on libselinux.
  6. Uninstall packages from the group selinux (the list can be found by running pacman -Qqg selinux)
pablogzlezmora commented 2 years ago

@fishilico: It worked.

In step 4, I tried: # pacman -S sudo dbus cronie shadow util-linux systemd-resolvconf systemd-sysvcompat systemd pambase pam coreutils

Between steps 5 and 6, I had to add my user to the sudoers group again (now, I know that it's an obviously needed task).

In step 6, I saw that I had forgotten some packages when I made step 4: pacman -Qi <package>, the wiki, and a small amount of patience were very useful here.

The setting seems to be ready now.

Thanks a lot.

fishilico commented 2 years ago

Thanks for your feedback! I am closing this issue as it seems to be resolved.

pablogzlezmora commented 2 years ago

Great. Yes, it's resolved. Thanks a lot.