Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

dash problem with dpkg-reconfigure

User discussion about Debian Development, Debian Project News and Announcements. Not for support questions.
Post Reply
Message
Author
User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

dash problem with dpkg-reconfigure

#1 Post by nadir »

dpkg-reconfigure dash
gives me this:

Code: Select all

root# dpkg-reconfigure dash
dpkg-divert: mismatch on package
  when removing `diversion of /bin/sh by dash'
  found `diversion of /bin/sh to /bin/sh.distrib by bash'
My super-nanny gives me this:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582554

Code: Select all

root# dpkg-reconfigure --force dash
dpkg-divert: mismatch on package
  when removing `diversion of /bin/sh by dash'
  found `diversion of /bin/sh to /bin/sh.distrib by bash'
Odd problem and only a few useful search results. Some of those posts are very old ( ~ one year) Yesterday i had a bug-report including a patch, but i can't find it anymore.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

User avatar
brain
Posts: 253
Joined: 2006-04-25 17:15

Re: dash problem with dpkg-reconfigure

#2 Post by brain »

dpkg-reconfigure --force dash wasn't a workaround/solution to bug 582554, it was a solution to Steven's problem with a dist-upgrade.

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: dash problem with dpkg-reconfigure

#3 Post by bugsbunny »

You should just wait for dash to be fixed. You can manually force dash to be the system shell, but it's a pain to do correctly. You need to remove, and then add 2, diversions. Plus you have to swap 2 sets of files around.

I know because I just did it. Started playing around after seeing this post. Changed the system shell (sh) from dash to bash. That part was easy :) (dpkg-reconfigure dash works fine for that, just answer NO). Trying to change it back I got the same error as you did. If you really want to manually do this:

swap the following 2 pairs of symlinks (Rename so A.distrib becomes A and A becomes A.distrib)
/bin/sh
/bin/sh.distrib

/usr/share/man/man1/sh.1.gz
/usr/share/man/man1/sh.distrib.1.gz

After the swap sh should run dash, and "man sh" should bring up the help for dash (the distrib versions should point to bash).
Next you have to fix the diversions. As root:

Code: Select all

dpkg-divert --package bash --remove /bin/sh
dpkg-divert --package bash --remove /usr/share/man/man1/sh.1.gz
dpkg-divert --package dash --divert /bin/sh.distrib --add /bin/sh
dpkg-divert --package dash --divert /usr/share/man/man1/sh.distrib.1.gz --add /usr/share/man/man1/sh.1.gz
After that you can test by running dpkg-reconfigure dash again and when you answer YES it should be fine. (Just don't answer NO unless you want to go through this again).

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: dash problem with dpkg-reconfigure

#4 Post by nadir »

Bugsbunny, your how-to workaround the problem is very impressive (like most of your posts). But i think i will simply wait till its solved. Reason: for me the Shell (and all which comes with it, like env and that) is unknown territory.
But a big thanks for that (and i guess for others its more important to set dash as the system Shell, so they will have use of it)

I did only wanted to change it to test if i may work around the problems i had when dash was the system Shell, and my bash-scripting-training gave me little errors. Therefor i made bash the default again (as the most easy solution).
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

User avatar
nadir
Posts: 5961
Joined: 2009-10-05 22:06
Location: away

Re: dash problem with dpkg-reconfigure

#5 Post by nadir »

If i am not wrong the problem got solved by todays upgrade.
"I am not fine with it, so there is nothing for me to do but stand aside." M.D.

Post Reply