diff --git a/meta/recipes-core/busybox/busybox.inc b/meta/recipes-core/busybox/busybox.inc
index e0522be729..c85402411b 100644
--- a/meta/recipes-core/busybox/busybox.inc
+++ b/meta/recipes-core/busybox/busybox.inc
@@ -441,12 +441,28 @@ pkg_postinst_${PN}_prepend () {
 }
 
 pkg_postinst_${PN}_append () {
-        # If busybox exists in the remove directory it is because it was the only shell left.
         if [ "x$D" = "x" ] ; then
+           # If busybox exists in the remove directory it is because it was the only shell left.
            if [ "x$BUSYBOX" != "x" ] ; then
               update-alternatives --remove sh $BUSYBOX
-              rm -f $BUSYBOX
            fi
+           # Remove the temporary alternatives
+           for busybox_preinstdir in /tmp/busyboxpreinst-*; do
+               if [ "$busybox_preinstdir" != '/tmp/busyboxpreinst-*' ] ; then
+                  BUSYBOX_PREINST_DIR="$busybox_preinstdir"
+                  BUSYBOX="$BUSYBOX_PREINST_DIR/busybox"
+                  if [ -e $BUSYBOX ] ; then
+                      for suffix in "" ".nosuid" ".suid"; do
+                          if [ -e $BUSYBOX_PREINST_DIR/busybox.links$suffix ] ; then
+                              while read link; do
+                                  update-alternatives --remove $($BUSYBOX basename $link) $BUSYBOX
+                              done < $BUSYBOX_PREINST_DIR/busybox.links$suffix
+                          fi
+                      done
+                  fi
+                  rm -rf $BUSYBOX_PREINST_DIR
+               fi
+           done
         fi
 } 
 
@@ -480,6 +496,43 @@ pkg_prerm_${PN} () {
         fi
 }
 
+pkg_preinst_${PN} () {
+        # Create a temporary copy the busybox binary and the links files.  Then,
+        # install an alternative link for all the links.  Other packages use these
+        # commands during their upgrade process.  This ensures the links are available
+        # to all the other packages.  We do this in the preinst step because it is
+        # the first step guaranteed to be used from the new package.  The prerm is
+        # used from the old package.  Placing this here ensures it runs on upgrade even
+        # on older systems.
+        
+        if [ "x$D" = "x" ] ; then
+           # update-alternatives may need the links from commands added in the prerm step
+           # to operate.  Make sure we can get to that path.
+           for busybox_rmdir in /tmp/busyboxrm-*; do
+               if [ "$busybox_rmdir" != '/tmp/busyboxrm-*' ] ; then
+                  export PATH=$busybox_rmdir:$PATH
+               fi
+           done
+
+           # Create a temporary directory for the busybox binary and the link lists
+           BUSYBOX=${base_bindir}/busybox
+           BUSYBOX_TMP_DIR=`$BUSYBOX mktemp -d /tmp/busyboxpreinst-XXXXXX`
+           BUSYBOX_TMP_LOC="$BUSYBOX_TMP_DIR/busybox"
+           $BUSYBOX cp $BUSYBOX $BUSYBOX_TMP_LOC
+
+           # Go through all the links and install an alternative that points to the temporary
+           # busybox binary.
+           for suffix in "" ".nosuid" ".suid"; do
+               if [ -e ${sysconfdir}/busybox.links$suffix ] ; then
+                   $BUSYBOX cp ${sysconfdir}/busybox.links$suffix $BUSYBOX_TMP_DIR
+                   while read link; do
+                       update-alternatives --install $link $($BUSYBOX basename $link) $BUSYBOX_TMP_LOC 1
+                   done < $BUSYBOX_TMP_DIR/busybox.links$suffix
+               fi
+           done
+        fi
+}
+
 pkg_postrm_${PN} () {
         # Add path to remove dir in case we removed our only grep
         if [ "x$D" = "x" ] ; then
