description: How to efficiently destroy your distribution
disqus: false
categories:
tags:
- linux
- fedora
---
I have installed Fedora on my computer 3 or 4 years ago. Since this installation, I have installed many packages and upgraded it every 6 months. Unfortunately, Gnome Software has never worked for me, and I never took the time to debug it. Like many people, I am using the old method with `dnf-system-upgrade`, which worked pretty well. But this time, I had a segfault on dnf during the offline upgrade. The only information I got was the following lines:
```
kernel: show_signal_msg: 7 callbacks suppressed
kernel: dnf[846]: segfault at 8 ip 00007f39b860f724 sp 00007ffd00588520 error 4 in libc-2.25.so[7f39b8586000+1cb000]
systemd-coredump[869]: Failed to connect to coredump service: No such file or directory
systemd[1]: dnf-system-upgrade.service: Main process exited, code=dumped, status=11/SEGV
systemd[1]: Failed to start System Upgrade using DNF.
```
Just after the segfault, my computer rebooted on Fedora 26.
## How dnf-system-upgrade works
*Some information presented here could not be totally accurate. If you have a doubt, please follow the links.*
`dnf-system-upgrade` use a feature of systemd described here: [Implementing Offline System Updates](https://www.freedesktop.org/software/systemd/man/systemd.offline-updates.html).
By creating a symlink named `/system-update`, at the next reboot systemd will boot to a specific target named `system-update.target`
But when will this symlink created ? When you run the following command:
```
# dnf system-upgrade reboot
```
We can see [in the source of the plugin](https://github.com/rpm-software-management/dnf-plugins-extras/blob/master/plugins/system_upgrade.py) that a symlink pointing to a dnf folder is created:
```python
DEFAULT_DATADIR = '/var/lib/dnf/system-upgrade'
MAGIC_SYMLINK = '/system-update'
# ...
os.symlink(DEFAULT_DATADIR, MAGIC_SYMLINK)
# ...
reboot()
```
We can now investigate which services are triggered by this target:
```raw
$ ls /usr/lib/systemd/system/system-update.target.wants/
Your computer will automatically reboot at the end. Now you'll have either a working Fedora 27 or a borken Linux distribution. Good luck and have fun !