10 September 2014

msys2 upgrade without pacman errors

Upgrade Your msys2 Installation

Without pacman Errors
EDIT 9/11/2014: A new installer/zip of msys2 was released on 9/10/2014 and at least for now, the following procedure is not really necessary for new installs. Base files are all up to date upon a fresh install. The procedure below describes upgrading an old installation or a new install where the current repo packages are newer than the ones in the installer or installation zipfile.

I recently became obsessed with achieving a clean upgrade and reinstallation of all packages on  a fresh install of msys2. I finally figured out a sequence of pkg upgrades that has no pacman execution errors.

I used 64bit msys2 available here: http://sourceforge.net/projects/msys2/




Note that you will still see some fork errors on exit after updating the base pkgs. This seems to be unavoidable. But, the sequence below does prevent any errors during the actual pacman execution which could corrupt your installation.

Bash fork errors on exit seem unlikely to do much but mess up your .bash_history file.... but I didn't' really look into it.


First, update msys2 runtime dll:

          Start msys2 shell (double-click msys2shell.bat)

pacman -Sy
pacman -S --needed msys2-runtime
exit
         Wait (15-30 seconds) for window to close and ignore errors



Next, update other base packages:
          Start msys2 shell (double-click msys2shell.bat)

pacman -S --needed filesystem bash libreadline libiconv \ libgpgme libcurl pacman ncurses libintl
exit
          Wait (15-30 seconds) for window to close and ignore errors


 
Now update everything else but libnettle and libarchive (update them last):
          Start msys2 shell (double-click msys2shell.bat)

pacman -Su --needed --ignore libarchive,libnettle
pacman -S libarchive libnettle

Check that you are fully up to date:

pacman -Syu

  Check that your installed packages are not corrupt:

pacman -Qkk

By NOT running autorebase.bat you can do a clean reinstall of all packages (including base pkgs) once you have everything upgraded. That should satisfy anyone that the install is not corrupted.

I learned the hard way that autorebase.bat changes the dll file itself (baseaddress stored in PE header) and therefore pkg reinstalls via pacman throw errors for not matching the currently loaded DLL's base address.

Unless there is a truly a collision in loading addresses such that Windows cannot relocate the DLL's, I think you are better off not running autorebase.bat so as to allow for clean pkg reinstalls to verify post install scripts completed successfully.

I'd also rather see clean pacman runs than any performance enhancement from optimized DLL load addresses so rebasing for optimization is not a concern of mine either.

I'm not pretending to fully understand the issue but what I've shown above works for me!

Once you've complted your upgrade, you attempt a clean reinstall all your packages like this:
pacman -S $(pacman -Q | awk '{print $1}')
Here's a clean run:

Nice!

No comments:

Post a Comment