Today I updated Arch Linux on a VM that I haven’t used in a while. When I first did this I received a message like:
(73/73) checking keys in keyring [######################] 100%
(73/73) checking package integrity [######################] 100%
(73/73) loading package files [######################] 100%
(73/73) checking for file conflicts [######################] 100%
error: failed to commit transaction (conflicting files)
filesystem: /bin exists in filesystem
filesystem: /sbin exists in filesystem
filesystem: /usr/sbin exists in filesystem
Errors occurred, no packages were upgraded.
Puzzling… Everyone that’s written a script knows to call #!/bin/bash on the first line. How could /bin existing be a problem?
I googled a bit and came across this wonderful post to get a list of packages that owns files in /bin, /sbin, and /usr/sbin: https://bbs.archlinux.org/viewtopic.php?pid=1280576#p1280576
So I ran the command:
The result was a listing of 20 some packages. I then upgraded each them, one at a time, with pacman –S
So far so good. I updated bash. No problems. Then I updated glibc…
That isn’t promising. So I tried to run /bin/sh, and it wasn’t there. Not only was /bin/sh gone, but the entire /bin directory was gone. I poked around and found bash, sh, and the other usual suspects in /usr/bin. I created a syslink for /bin -> /usr/bin with: ln –s /usr/bin /bin
Then I ran pacman –S glibc and it worked. Next up filesystem. Same error as before, except this time it was just on /bin. I removed the symlink, updated filesystem, and everything was in harmony once again. The filesystem package will actually create /bin -> /usr/bin and /sbin -> /usr/bin so that all of your scripts will continue to function when you call #!/bin/bash at the top.
True to form, I didn’t come across this post by Arch Linux until after I’d written this blog entry. Take a look for another method of solving the problem.