Ask Your Question

Using `dnf` to compare filesystem contents with repositories

asked 2018-07-21 21:16:50 -0600

abitrolly gravatar image

Following a trail of one bug, I've discovered that my bsdtar utility is 0 length.

# ls -l `which bsdtar`
-rwxr-xr-x. 1 root root 0 Feb  3 19:47 /usr/bin/bsdtar

Perhaps long ago a mistake in pipe command that was run under sudo, overwrote it. Or maybe filesystem failure.

With dnf provides I can figure out that the package name is bsdtar and reinstall it, but I'd like to check if files in other installed packages became corrupted too. Is it possible to do this with dnf?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2018-07-24 06:12:01 -0600

Aeyoun gravatar image

updated 2018-07-24 06:16:52 -0600

Fixing the problem

You can identify the package with the following command:

dnf provides /usr/bin/bsdtar

…and reinstall said package with this command:

dnf reinstall bsdtar

Comparing a file to a known-good copy in a repo

cd /tmp
dnf download bsdtar
rpm2cpio bsdtar*.rpm | cpio -idmv
diff /usr/bin/bsdtar /tmp/usr/bin/bsdtar
edit flag offensive delete link more


That fixes the problem, but only with one package. Thanks for the diff part, though. I think I can do what I want with combined - rpm -Va, this command, and a little bit of scripting.

abitrolly gravatar imageabitrolly ( 2018-07-24 09:50:14 -0600 )edit

answered 2018-07-22 00:19:42 -0600

fcomida gravatar image
edit flag offensive delete link more


SM5.LUGT. g- how to read these statuses?

abitrolly gravatar imageabitrolly ( 2018-07-22 04:11:34 -0600 )edit

Okay. man rpm gives answers about statuses. But is there a way to see git diff like output?

abitrolly gravatar imageabitrolly ( 2018-07-22 04:16:05 -0600 )edit

Question Tools

1 follower


Asked: 2018-07-21 21:16:50 -0600

Seen: 144 times

Last updated: Jul 24 '18