I used the Parrot Project for years, so now i plan to give something back
Guide: Replace Systemd with OpenRC
2: Replace Systemd with OpenRC
3: Restore GUI
4: Repairing Damage
Step 1: Preparation
BACKUP YOU PC!
If you plan to remove Systemd, backup first.
It is exceedingly easy to break your system while removing systemd.
“We’re off to a good start…”
Prepare the live USB:
Not strictly required, but makes it way easier to restore your Backups - you will likely need them!
Download your preferred parrot flavor. I chose XFCE for this guide.
Open your favorite browser and go to the Parrot OS download page: https://parrotsec.org/download/
If you can’t find a current xfce image, search here instead: https://download.parrot.sh/parrot/iso/
Further Instruction on how to burn your live-USB in my earlier Guide: “Installing Parrot on ZFS”
Step 2: Replace Systemd with OpenRC
This guide assumes a fresh Parrot XFCE 4-10 Installation, but used systems have worked before.
Open your terminal. In order To avoid any unexpected surprises, first upgrade your packages and then reboot to apply any changes:
sudo parrot-upgrade; sudo reboot;
Once your system has restarted, open the terminal again. Make sure it is expanded (more on that later) and shows no previous output, otherwise reset it using:
Once you have done so, enter the following line, and DO NOT REMOVE -s!!!, which stands for simulate. We don’t want to start just yet.
sudo apt-get install -s openrc sysvinit-core policycoreutils;
You will get many lines of output, don’t remove them!
You will have to save your terminal output to disk, to allow for later restoration of deleted packages.
The default XFCE terminal contains a button under the tab terminal to do just that.
You could also copy and paste or screenshot it, but do make a copy!.
Many applications require systemd or one of the packages that rely on it, and you will likely forget about some of those without checklist.
Now reset your terminal again:
Before you continue, a few more warnings:
DO NOT INSTALL ELOGIND OR CLOSE YOUR TERMINAL AFTER COMPLETION!!!
ALSO DO NOT PERFORM AN APT AUTOREMOVE UNTIL STATED OTHERWISE!!!
With that said, lets run the install command without -s option.
WARNING - THERE IS NO TURNING BACK!!!
sudo apt-get install openrc sysvinit-core policycoreutils;
Wait patiently for its completion, this might take some time. once it has completed however, scroll up to find the following warning:
*** WARNING: if you are replacing sysv-rc by OpenRC, then you must ***
*** reboot immediately using the following command ***
for file in /etc/rc0.d/K*; do s=
basename $(readlink "$file") ; /etc/init.d/$s stop; done;
I highly recommend copy-pasting the code from your terminal, to avoid errors while tipping.
Note that the terminal adds backspaces if it is too small, causing the line to fail.
Make sure that doesn’t happen!
Now open a Root-Terminal to get sufficient privileges for the code mentioned above.
This is not strictly required, but removes the need to edit it by hand.
ONLY IF you lack such terminal, add sudo to this -> sudo /etc/init.d/ …
Warning for the next line!
SHUTDOWN WILL HANG, USE REBOOT!!!
As the warning states, immediately execute the following lines
for file in /etc/rc0.d/K*; do s=`basename $(readlink "$file")` ; /etc/init.d/$s stop; done; reboot
Step 3: Restore GUI
Your PC will now reboot. You have to be quick, because one of the removed packages ended up being your display manager!
Your PC will hang upon boot, forcing you to restart the machine.
Solve this by pressing ESC after leaving grub, in order to enter terminal mode.
Note that this disables all graphical elements, so no GUI!
This mode luckily continues, allowing you login and restore the display manager.
Or it would, had you not just removed your Network Manager, causing apt to fail!
That’s an easy fix though, just enter the following line to reconnect to the internet:
Now that internet is restored, install the package elogind, the extracted login backend from systemd, without actually relying on systemd.
sudo apt-get install elogind;
Then reinstall lightdm, granting you a correct Login screen, albeit still somewhat ugly:
sudo apt-get install lightdm;
This should restore your graphical user interface, making the following steps way easier.
Congratulation! You have restored basic functionality to your system!
Step 4: Repairing Damage
Open a terminal and restore your internet:
Run lightdm-gtk-greeter-settings, as you can use it to fix the black login screen that you might have detected earlier.
then remove all remaining systemd packages:
sudo apt-get purge *systemd*;
following that, execute the empty command:
sudo apt install;
to see what packages are still about to be removed.
Try to restore them if necessary, for example (in case of a clean install):
xfce4-goodies (or individual xfce4 plugins), mate-system-monitor, gparted, ufw, …
Be aware that many packages rely on systemd, so don’t be hasty when restoring them.
You might even wish to add
lightdm- to your apt commands, to avoid reinstalling it.
Also note that we will increase the number of possible packages later on.
You can ignore compiler, lib’s or network-manager packages for now, they either cannot be installed,
or will be installed as dependency anyway. The same goes for brasero.
Step 5: Frankenstein
Here comes the Frankenstein-like stuff:
Open your browser (Don’t worry, Firefox is likely still installed)
and get the current devuan stable source (yes, you heard that right)
I HIGHLY recommend choosing the stable branch, as it contains older packages than those of parrot,
thus avoiding accidentally installing from the wrong source.
[ @Righttoprivacy edit: As of this post, .onion address below is official Devuan onion. Source: Devuan Package Repositories. For user safety check to make sure it matches my reply below this tutorial. ]
The correct source looks like this:
deb tor+http://devuanfwojg73k6r.onion/merged beowulf main
Add it to the file /etc/apt/sources.list.d/parrot.list using a root-able text editor,
as vscodium will currently fail due to another issue. We will fix that later.
For example: gedit, pluma, neovim, vim, vi etc…
sudo nvim /etc/apt/sources.list.d/parrot.list;
install the package apt-transport-tor to allow apt to listen to that source:
sudo apt-get install apt-transport-tor;
then start tor to allow the connection:
now perform the update:
sudo apt-get update;
Note: You could also add a normal devuan source, but devuan relies on HTTP sources,
which is less secure than parrots HTTPS.
It is therefore beneficial to security to use the tor transport instead.
With all that said, you will now receive a warning message that the source is not trusted.
This is caused by the fact that parrot misses the authentication keys of devuan which we therefore have to import manually (bad practice!):
sudo apt-key adv --keyserver pool.sks-keyservers.net --recv-keys REQUIRED-KEY
Finally, run the update yet again:
sudo apt-get update;
Why did we do all this?
We needed a few packages to reinstall applications normally relying on systemd.
First install the package wicd, the devuan version of the very systemd dependent network-manager:
sudo apt-get install wicd;
Then the devuan-specific version of the package udisks2.
First list all alternate versions of the package:
apt-cache madison usdisks2;
Why madison? I have no idea…
Anyway, choose the version offered by the recently added devuan source,
which you install using the = operator in apt, like this:
sudo apt-get install udisks2=2.8.1-4+devuan1;
This package is required for many filesystem-packages, like gnome-disk-utility or gvfs.
Gvfs meanwhile is required for most file managers, like caja or thunars advanced abilities (trash etc.).
Note that mixing Package sources like this does create a bug: udisks2 allows the installation
of the aforementioned many different packages, but does not work exactly as intended.
It will glitch when showing currently mounted/available filesystems, causing them to suddenly disappear.
You can test this by running gnome-disk-utility, as its output will disappear upon opening.
Third install policykit, which allows applications to open a separate GUI password prompt.
Affected applications include virt-manager, vscodium, mate-system-monitor, etc.
Those applications cannot gain sudo rights and will fail. Note that this only works upon restart:
sudo apt-get install policykit-1-gnome libpolkit-backend-elogind-1-0; sudo reboot;
At last try to reinstall the many packages that got lost during your removal of systemd,
including packages like brasero, gufw, virt-daemon-systems and many more.
Your terminal output should now come in handy, as you can finally restore most applications.
You can now also get rid off all remaining packages that are on longer required:
sudo apt autoremove;
That’s it! You are fine to go and use your newly designed system!!!
PS: My next guide talks about compiling amd64 pcsx2