LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   How and When to removepkg in -current (https://www.linuxquestions.org/questions/slackware-14/how-and-when-to-removepkg-in-current-4175625481/)

kjhambrick 03-13-2018 07:17 AM

How and When to removepkg in -current
 
All --

There were numerous Removed Packages in this morning's -current ChangeLog ( below )

I don't use an advanced Package Manager so I intend to `removepkg` then `upgradepkg --install-new` the other Upgraded Packages.

Opinions wanted: is that the best way to go about it ( remove first then upgrade ) ?

Thanks !

-- kjh

These are the Removed Packages from last night:

Code:

# gawk -F ':' '{ if ( match( $1, /^+-----*+/ )){ exit( 0 ) } ; if ( ! match( $2, / *Removed/ )){ next } ; Pkg = $1 ; gsub( /^[a-z][a-z]*\//, "", Pkg ) ; gsub( /.txz$/, "",Pkg ) ; print "  removepkg " Pkg " \t\t# " $1 }' ChangeLog.txt

  removepkg bigreqsproto-1.1.2-noarch-1                # x/bigreqsproto-1.1.2-noarch-1.txz
  removepkg compositeproto-0.4.2-noarch-1              # x/compositeproto-0.4.2-noarch-1.txz
  removepkg damageproto-1.2.1-noarch-1          # x/damageproto-1.2.1-noarch-1.txz
  removepkg dmxproto-2.3.1-noarch-1            # x/dmxproto-2.3.1-noarch-1.txz
  removepkg dri2proto-2.8-x86_64-2              # x/dri2proto-2.8-x86_64-2.txz
  removepkg dri3proto-1.0-x86_64-2              # x/dri3proto-1.0-x86_64-2.txz
  removepkg evieext-1.1.1-noarch-1              # x/evieext-1.1.1-noarch-1.txz
  removepkg fixesproto-5.0-x86_64-2            # x/fixesproto-5.0-x86_64-2.txz
  removepkg fontcacheproto-0.1.3-noarch-1              # x/fontcacheproto-0.1.3-noarch-1.txz
  removepkg fontsproto-2.1.3-noarch-1          # x/fontsproto-2.1.3-noarch-1.txz
  removepkg glproto-1.4.17-noarch-1            # x/glproto-1.4.17-noarch-1.txz
  removepkg inputproto-2.3.2-noarch-1          # x/inputproto-2.3.2-noarch-1.txz
  removepkg kbproto-1.0.7-noarch-1              # x/kbproto-1.0.7-noarch-1.txz
  removepkg presentproto-1.1-x86_64-1          # x/presentproto-1.1-x86_64-1.txz
  removepkg printproto-1.0.5-noarch-1          # x/printproto-1.0.5-noarch-1.txz
  removepkg randrproto-1.5.0-noarch-1          # x/randrproto-1.5.0-noarch-1.txz
  removepkg recordproto-1.14.2-noarch-1                # x/recordproto-1.14.2-noarch-1.txz
  removepkg renderproto-0.11.1-noarch-1                # x/renderproto-0.11.1-noarch-1.txz
  removepkg resourceproto-1.2.0-noarch-1                # x/resourceproto-1.2.0-noarch-1.txz
  removepkg scrnsaverproto-1.2.2-noarch-1              # x/scrnsaverproto-1.2.2-noarch-1.txz
  removepkg videoproto-2.3.3-noarch-1          # x/videoproto-2.3.3-noarch-1.txz
  removepkg xcmiscproto-1.2.2-noarch-1          # x/xcmiscproto-1.2.2-noarch-1.txz
  removepkg xextproto-7.3.0-x86_64-2            # x/xextproto-7.3.0-x86_64-2.txz
  removepkg xf86bigfontproto-1.2.0-noarch-1            # x/xf86bigfontproto-1.2.0-noarch-1.txz
  removepkg xf86dgaproto-2.1-noarch-1          # x/xf86dgaproto-2.1-noarch-1.txz
  removepkg xf86driproto-2.1.1-noarch-1                # x/xf86driproto-2.1.1-noarch-1.txz
  removepkg xf86miscproto-0.9.3-noarch-1                # x/xf86miscproto-0.9.3-noarch-1.txz
  removepkg xf86vidmodeproto-2.3.1-noarch-1            # x/xf86vidmodeproto-2.3.1-noarch-1.txz
  removepkg xineramaproto-1.2.1-noarch-1                # x/xineramaproto-1.2.1-noarch-1.txz
  removepkg xproto-7.0.31-noarch-1              # x/xproto-7.0.31-noarch-1.txz


Didier Spaier 03-13-2018 07:35 AM

Caveat: I don't run slackware-current at the moment.

I don't think that the order matters.

To feel 100% safe I would just do that in runlevel 3 and check that all updates be successfull before starting X again. If I understand well xorg-proto xorgproto replaces all the other X prototype packages.

kjhambrick 03-13-2018 07:42 AM

Quote:

Originally Posted by Didier Spaier (Post 5830449)
Caveat: I don't run slackware-current at the moment.

I don't think that the order matters.

To feel 100% safe I would just do that in runlevel 3 and check that all updates be successfull before starting X again. If I understand well xorg-proto replaces all the other X prototype packages.

Thanks for input and a BIG THANKS for the runlevel 3 reminder Didier Spaier !

While I always do X-related updates from a runlevel 3 session, it sure is helpful to spell it out in this thread !

-- kjh

Didier Spaier 03-13-2018 07:55 AM

I mistakenly wrote xorg-proto instead of xorgproto, sorry.

And while I am at it, as I am a big fan of sed:
Code:

sed -n '
/Removed/{
    s@.*/@@
    s/.txz.*//p
}
/+--/q
' ChangeLog.txt > to_be_removed


kjhambrick 03-13-2018 07:58 AM

Quote:

Originally Posted by Didier Spaier (Post 5830458)
I mistakenly wrote xorg-proto instead of xorg-pro, sorry.

And while I am at it, as I am a big fan of sed:
Code:

sed -n '
/Removed/{
    s@.*/@@
    s/.txz.*//p
}
/+--/q
' ChangeLog.txt > to_be_removed


No worries :)

Very nice script, Didier Spaier !

Thanks again !

-- kjh

Petri Kaukasoina 03-13-2018 08:14 AM

They are just header files, only needed when compiling X stuff. So you don't need to exit X or change runlevels. Just don't compile X programs during the upgrade...

kjhambrick 03-13-2018 08:22 AM

Quote:

Originally Posted by Petri Kaukasoina (Post 5830467)
They are just header files, only needed when compiling X stuff. So you don't need to exit X or change runlevels. Just don't compile X programs during the upgrade...

Good info Petri Kaukasoina.

I'll go ahead rebuild SBo System/xrdp and neutrinolabs/xorgxrdp 'just in case'.

Thank you !

-- kjh

shevegen 03-13-2018 08:37 AM

On a side note, does anyone know why slackware
removed the various proto packages recently?

Example:

http://www.slackware.com/changelog/c...php?cpu=x86_64

"x/bigreqsproto-1.1.2-noarch-1.txz: Removed.
x/compositeproto-0.4.2-noarch-1.txz: Removed.
x/damageproto-1.2.1-noarch-1.txz: Removed."

etc...

55020 03-13-2018 09:11 AM

kjh, I would always add and upgrade before removing.

If the upgrade procedure needs something that is being replaced, you want to have the new stuff installed before you remove the old stuff, otherwise the upgrade procedure will break and you won't be able to complete it.

Exactly the same considerations apply whether you're doing it manually or otherwise, hence the standard slackpkg rigmarole:

slackpkg update ; slackpkg install-new ; slackpkg upgrade-all ; slackpkg clean-system


Meanwhile:

Quote:

Originally Posted by shevegen (Post 5830478)
On a side note, does anyone know why slackware
removed the various proto packages recently?

The answer is right there in the ChangeLog. They're all now bundled up into one package.

Code:

x/xorgproto-2018.4-x86_64-1.txz:  Added.

kjhambrick 03-13-2018 09:24 AM

Quote:

Originally Posted by 55020 (Post 5830495)
kjh, I would always add and upgrade before removing.

If the upgrade procedure needs something that is being replaced, you want to have the new stuff installed before you remove the old stuff, otherwise the upgrade procedure will break and you won't be able to complete it.

Exactly the same considerations apply whether you're doing it manually or otherwise, hence the standard slackpkg rigmarole:

slackpkg update ; slackpkg install-new ; slackpkg upgrade-all ; slackpkg clean-system

Thanks 55020 !

Your logic makes perfect sense.

All done now via a remote ssh session ( with the box booted at runlevel 3 ).

I did rebuild xrdp and xorgxrdp -- they recompiled and run fine although I am not sure the Removed Packages and the new xorgproto Package had any effect on them.

I am able to log into KDE via RDesktop and at the Console via startx so ... [SOLVED] !

Quote:

Originally Posted by 55020 (Post 5830495)
Meanwhile:

The answer is right there in the ChangeLog. They're all now bundled up into one package.

Code:

x/xorgproto-2018.4-x86_64-1.txz:  Added.

Thanks ... while I did see the new xorgproto Package, you saved me a ton of google-time :)

EDIT: P.S. I meant to link this: https://www.archlinux.org/packages/extra/any/xorgproto/ from the Arch Site.

And as always, thanks to all who replied.

-- kjh

orbea 03-13-2018 10:04 AM

Quote:

Originally Posted by Didier Spaier (Post 5830449)
To feel 100% safe I would just do that in runlevel 3 and check that all updates be successfull before starting X again. If I understand well xorg-proto xorgproto replaces all the other X prototype packages.

This is not required. This function someone else (I don't recall who) posted here at LQ a while ago should report any stale pids from programs that have been upgraded and not restarted.

Code:

stale-pids ()
{
    if [ "$1" = '-v' ]; then
        find -H /proc/{1..9}*/map_files -type l -ilname '*lib*.so* (deleted)' -printf '%h %l\n' 2> /dev/null | sed -e 's|/proc/||;s|/map_files||';
    else
        find -H /proc/{1..9}*/map_files -type l -ilname '*lib*.so* (deleted)' -printf '%h\n' 2> /dev/null | cut -f3 -d'/';
    fi | sort -u | grep --color=auto -F ''
}

Edit: Fixed the function which didn't paste correctly...

Additionally even if something like xorg is upgraded, the old xorg session should still mostly work and if this worries anyone closing the xorg session and starting a new one should resolve this.

kjhambrick 03-13-2018 10:19 AM

Thanks for the very useful stale_pids() function, orbea !

-- kjh

orbea 03-13-2018 10:23 AM

I didn't paste it correctly unfortunately so I updated my post.

Didier Spaier 03-13-2018 10:25 AM

Quote:

Originally Posted by 55020 (Post 5830495)
If the upgrade procedure needs something that is being replaced, you want to have the new stuff installed before you remove the old stuff, otherwise the upgrade procedure will break and you won't be able to complete it.

Isn't that the purpose of the pre-installation in /sbin/upgradepkg?

I just realized that it can be done twice (before and after the removal of the old package)

Here is the end of upgradepkg, on Slackware version 14.2:
Code:

  # Print a banner for the current upgrade:
  cat << EOF

+==============================================================================
| Upgrading $OLD package using $INCOMINGDIR/$NNAME
+==============================================================================

EOF

  # Next, the new package is pre-installed:
  if [ "$VERBOSE" = "verbose" ]; then
    /sbin/installpkg $INCOMINGDIR/$NNAME
    RETCODE=$?
  else
    echo "Pre-installing package $NEW..."
    /sbin/installpkg $INCOMINGDIR/$NNAME 1> /dev/null
    RETCODE=$?
  fi
  # Make sure that worked:
  if [ ! $RETCODE = 0 ]; then
    echo "ERROR:  Package $INCOMINGDIR/$NNAME did not install"
    echo "correctly.  You may need to reinstall your old package"
    echo "to avoid problems.  Make sure the new package is not"
    echo "corrupted."
    sleep 30
    # Skip this package, but still try to proceed.  Good luck...
    continue;
  fi

  # Now, the leftovers from the old package(s) can go.  Pretty simple, huh? :)
  for rempkg in "$ROOT/var/log/packages/"*"-$TIMESTAMP"; do
    if [ "$VERBOSE" = "verbose" ]; then
      /sbin/removepkg "${rempkg##*/}"
    else
      /sbin/removepkg "${rempkg##*/}" | grep -v 'Skipping\.\|Removing files:'
    fi
  done
  echo

  # Again!  Again!
  # Seriously, the reinstalling of a package can be crucial if any files
  # shift location, so we should always reinstall as the final step:
  if [ ! "$NOT_PARANOID" = "true" ]; then
    /sbin/installpkg $INCOMINGDIR/$NNAME
  fi

  echo "Package $OLD upgraded with new package $INCOMINGDIR/$NNAME."
  ERRCODE=0
done

if [ ! "$DRY_RUN" = "true" ]; then
  echo
fi
exit $ERRCODE

Isn't this enough to make order of commands unimportant?

55020 03-13-2018 11:43 AM

But Didier, upgradepkg can't do that dance when the 'old' packages have already been removed :)

Quote:

Originally Posted by kjhambrick (Post 5830441)
I intend to `removepkg` then `upgradepkg --install-new` the other Upgraded Packages.



All times are GMT -5. The time now is 08:28 PM.