dnf install build deps

If you want to build a package, but need all of its buildrequires packages, use this command:

sudo dnf builddep wxGTK3

I leave my source repositories off, so be sure to do any –enablerepo=fedora-source,updates-source as necessary.

For debian family

Try a cool tool named “mk-build-deps” as documented over at https://www.guyrutenberg.com/2017/09/23/use-mk-build-deps-instead-of-apt-get-build-dep/



Automatically install build dependencies prior to building an RPM package [stackoverflow.com]


Lightdm crashes after dnf update

For a few months this year, running “dnf update” caused my display manager to malfunction. It it a terribly annoying problem. In the past, once, my /usr/bin/X was not installed. I don’t know how that happened.

This time, lightdm was not starting due to some error message which is only visible if you turn on logging/debugging and go find the right log.

lightdm gtk:error:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed

Thankfully, the issue was researchable online although it did take a while and I bounced around different distros’ fora to get to the answer.
For Fedora, the answer simply was:

sudo dnf -y reinstall shared-mime-info


Web searches

  1. Google: fedora lightdm gtk:error:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed

Web links

  1. https://forums.fedoraforum.org/showthread.php?280639-Icons-and-images-disappeared-can-t-login-in-gnome-shell
  2. https://bugzilla.redhat.com/show_bug.cgi?id=1002782
  3. points to the next two links https://bbs.archlinux.org/viewtopic.php?id=223801
  4. what actually solved it http://forum.tinycorelinux.net/index.php?topic=4389.0
  5. same kind of error https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/1627564

Fedora remove duplicate packages from partially-completed dnf update

On my Fedora 27 systems, my system froze up when I was updating all the packages (I suspect I’m having hardware problems).

My system did reboot just fine, but not all ancillary services came up. During my troubleshooting, I discovered that there were multiple versions of packages installed for hundreds of packages.

After some brief Internet searches, I found my solution:

sudo dnf remove --duplicates

Output will resemble:

Last metadata expiration check: 1:14:37 ago on Sat 31 Mar 2018 09:52:43 PM EDT.
Dependencies resolved.
 Package                       Arch   Version            Repository        Size
 ImageMagick                   x86_64 1:  updates-smith122 186 k
     replacing  ImageMagick.x86_64 1:
 ImageMagick-libs              x86_64 1:  updates-smith122 2.3 M
     replacing  ImageMagick-libs.x86_64 1:
 abrt                          x86_64 2.10.7-1.fc27      updates-smith122 525 k
     replacing  abrt.x86_64 2.10.5-1.fc27
 abrt-addon-ccpp               x86_64 2.10.7-1.fc27      updates-smith122 130 k
     replacing  abrt-addon-ccpp.x86_64 2.10.5-1.fc27
 abrt-addon-coredump-helper    x86_64 2.10.7-1.fc27      updates-smith122  40 k
     replacing  abrt-addon-coredump-helper.x86_64 2.10.5-1.fc27
 abrt-addon-kerneloops         x86_64 2.10.7-1.fc27      updates-smith122  54 k
     replacing  abrt-addon-kerneloops.x86_64 2.10.5-1.fc27
 abrt-addon-pstoreoops         x86_64 2.10.7-1.fc27      updates-smith122  32 k
     replacing  abrt-addon-pstoreoops.x86_64 2.10.5-1.fc27



  1. https://ask.fedoraproject.org/en/question/95550/how-to-remove-duplicate-packages-installed-with-dnf-on-fedora-24/

Dnf ignore weak dependencies


dnf --setopt=install_weak_deps=False --best install newpackage

dnf do not install weak dependencies

In the new paradigm for rpm package management (rpmpm?), we use dnf. I am fine with using the latest and greatest, but sometimes yum looks nicer in hindsight than dnf.

One of the more recent features added to rpms is weak dependencies. Debian has had weak dependencies for a longer time, so it’s nice to see rpm adding such a feature.

I recently went through a spell where I wanted to install my own package but exclude the recommended options.

After a lot of research and man dnf dnf.conf, I derived the command I needed.

dnf --setopt=install_weak_deps=False --best install newpackage


I tried an ugly hack, which technically worked.

dnf --disablerepo=* install ./bgscripts*

But all it does is disable all repos. I was using a local file, so it could get to the rpm I required, but any hard dependencies would be not found. I then tried another option, which technically worked.

dnf install ./bgscripts* -x freerdp

But I had to run a dnf command to see what packages would be installed, and then manually named the packages in the exclude list.



  1. https://fedoraproject.org/wiki/PackagingDrafts/WeakDependencies
  2. https://www.debian.org/doc/debian-policy/ch-relationships.html

Man pages