update-alternatives: providing in auto mode:|update-alternatives: using ([[:print:]]+) to provide ([[:print:]]+) \(([[:print:]]+)\) in auto mode| [\1 → \2 (\3)]'
 
 _LAST_PREFIX=''
+_STARTED_PRINTING=
 DEBIAN_FRONTEND=noninteractive apt-get -y $1 2>&1 | while read _LINE; do
     _LINE=$(printf '%s' "${_LINE}" | tr -d '\r')
     if [ -z "${_LINE}" ]; then
     if [ "${_COMPRESSED_ITEM}" = "IGNORE" ]; then
         continue
     elif [ -z "${_COMPRESSED_ITEM}" ]; then
+        test ! -z "${_STARTED_PRINTING}" && printf '\n'
+        printf '\r%s' "${_LINE}"
         _LAST_PREFIX=''
-        printf '\n\r%s' "${_LINE}"
     else
         if [ "${_PREFIX}" != "${_LAST_PREFIX}" ]; then
-            printf '\n\r'
+            test ! -z "${_STARTED_PRINTING}" && printf '\n'
+            printf '\r'
             prefixed_msg_no_nl "${_PREFIX}"
             _LAST_PREFIX="${_PREFIX}"
         fi
         printf ' %s' "${_COMPRESSED_ITEM}"
     fi
+    _STARTED_PRINTING=1    
 done
 printf '\r'