@zeroability That’s exciting. I’ll look forward to an official implementation!
@LeeTalbert I’m the same. I update in the terminal. If you change to dnf5 and don’t alias correctly, and don’t always remember to use dnf5, you can flip back and forth inadvertently. If you do alias correctly, but sometimes use the official OMLx scripts, you will still use older versions of dnf5. That’s why I changed the symlinks in the /usr/bin directory. All calls on dnf point to dnf5, that way, but making that change will break the official OMLx scripts that call dnf using options in an order that isn’t compatible with DNF5. If you only update using the proper command sequence in the terminal, it’s not a problem, or if you change the system scripts it isn’t a problem. Any updates pulled from the OMLx repos will overwrite changes you may make to the official script, though.
All of that aside, if you want to get dnf5, here is the process:
sudo dnf install dnf5
Aliasing
If you follow the aliasing route, the aliases are as follows
echo 'alias dnf="dnf5"' >> /home/$USER/.bashrc && echo 'alias sudo="sudo "' >> /home/$USER/.bashrc
This will enable dnf5 to run all calls made to dnf, even when performed by sudo.
This only works in bash, so any shell scripts are unaffected, such as the official system scripts. If you change the official script for updating, it is here: (if you don’t like nano
use something else)
sudo nano /usr/share/om-welcome/apps/updatesys.run
and change the two dnf calls to dnf 5:
#!/bin/sh
konsole -e sh -c "pkexec dnf5 clean all ; pkexec dnf5 distro-sync --refresh --allowerasing; echo 'Press enter to close konsole'; read"
The above has also been modified to compliment the dnf5 order of options (--refresh --allowerasing
) after the command (distro-sync
).
Symlinking
On the other hand, if you want to change the symlinks in /usr/bin so any systemwide calls to dnf will be dnf5, here are the steps. Don’t worry about symlinking, it is already used in /usr/bin to modify the dnf command. In fact, dnf is a symlink already to dnf-3, the actual binary which is called. At any rate, do the following commands in the terminal:
cd /usr/bin
sudo ln -s dnf-3 dnf-orig
sudo rm dnf
sudo ln -s dnf5 dnf
In doing this, we’ve made a “backup” of the original symlink, dnf, as dnf-org. One could also rename the symlink, sudo mv dnf dnf-orig
, for the same effect, so long as the final command (sudo ln -s dnf5 dnf
) is also run. Now all system calls to dnf will run the dnf5 binary. However, because we haven’t modified the system update script, do the following:
sudo nano /usr/share/om-welcome/apps/updatesys.run
and change the order of the options to after the command, as such:
#!/bin/sh
konsole -e sh -c "pkexec dnf clean all ; pkexec dnf distro-sync --refresh --allowerasing; echo 'Press enter to close konsole'; read"
You’ll notice in this we’ve kept dnf instead of modifying it to dnf5. This is because in calling dnf, it will symlink to dnf5. At any rate, this is temporary at best, because any updates to the script will override the change. If you only update via the terminal, the best order of operations, as given by @zeroability,
sudo dnf clean all ; dnf distro-sync --refresh --allowerasing
Concluding statement
I would not suggest doing both aliasing AND symlinking. Do one or the other. This is certainly not an official idea and only an example of what I’ve implemented on my own system in different phases.