You are not logged in.

#1 2017-01-07 10:39:17

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Best Practice for System Update?

Hello, I have a build that was done in 2014.  I haven't touched it since and recently wanted to go back to it.  It was built with an RT kernel, so I thought I'd go in and update the kernel and the system, but of course everything is out of date and breaking.  I was able to update the database, but have pacman version errors, keyring errors, etc.

I was wondering if there's a good way to do a system update, without wiping out all the work I wanted to save in the rest of the system.  Is there a process through the Live CD that would allow me to do this?  From what I've been reading, the easiest way to recover would be this?


pacman crashes during an upgrade

In the case that pacman crashes with a "database write" error while removing packages, and reinstalling or upgrading packages fails thereafter, do the following:

    Boot using the Arch installation media. Preferably use a recent media so that the pacman version matches/is newer than the system.
    Mount the system's root filesystem, e.g. mount /dev/sdaX /mnt as root, and check the mount has sufficient space with df -h
    If the system uses default database and directory locations, you can now update the system's pacman database and upgrade it via pacman --root=/mnt --cachedir=/mnt/var/cache/pacman/pkg -Syyu as root.
    After the upgrade, one way to double-check for not upgraded but still broken packages: find /mnt/usr/lib -size 0
    Followed by a re-install of any still broken package via pacman --root /mnt --cachedir=/mnt/var/cache/pacman/pkg -S package.

Last edited by forkenbrock (2017-01-09 21:10:05)

Offline

#2 2017-01-07 10:50:20

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Best Practice for System Update?

You boot the live CD and use pacman from the live CD to upgrade your system (with the --root option). You need to first mount your full system to a path on the live CD (system root, /boot directory, /usr, /var... whatever you have on separate partitions). You will also need to mount some special directories inside the mountpoint (e.g. /dev, /sys... there should be a list one one of the wiki pages). After that, point pacman to the mointpoint and do a full system upgrade.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#3 2017-01-07 10:55:41

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

Ok, thank you.

Xyne wrote:

You boot the live CD and use pacman from the live CD to upgrade your system (with the --root option). You need to first mount your full system to a path on the live CD (system root, /boot directory, /usr, /var... whatever you have on separate partitions). You will also need to mount some special directories inside the mountpoint (e.g. /dev, /sys... there should be a list one one of the wiki pages). After that, point pacman to the mointpoint and do a full system upgrade.

Offline

#4 2017-01-08 01:16:16

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Best Practice for System Update?

Note that you could also use the Arch Linux Archive to update your system in monthly increments... although that will take a lot longer and use a lot more bandwidth.

Advantages:
You don't need to take the system offline and use the install media you might not have handy.
Depending on what packages might have replaced what packages, a single jump via the install media might miss part of the upgrade path and give you headaches/dependency errors. Incremental updates are more reliable -- after all, that is what normally happens! tongue


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2017-01-08 18:03:41

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Best Practice for System Update?

Eschwartz wrote:

Note that you could also use the Arch Linux Archive to update your system in monthly increments... although that will take a lot longer and use a lot more bandwidth.

Advantages:
You don't need to take the system offline and use the install media you might not have handy.
Depending on what packages might have replaced what packages, a single jump via the install media might miss part of the upgrade path and give you headaches/dependency errors. Incremental updates are more reliable -- after all, that is what normally happens! tongue

Don't forget to check previous news items on the front page for manual upgrade instructions as you walk through the upgrades.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#6 2017-01-09 21:15:06

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

This didn't work for me.  I checked my pacman log and followed the instructions below to go back to the day after my last update.  I received the errors shown below that.


replacing your /etc/pacman.d/mirrorlist with the following content:
##                                                                             
## Arch Linux repository mirrorlist                                             
## Generated on 2042-01-01                                                     
##
Server=https://archive.archlinux.org/repos/2014/03/30/$repo/os/$arch

Then update the database and force downgrade:
# pacman -Syyuu


error: dhcpcd: signature from "Anatol Pomozov <anatol.pomozov@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/dhcpcd-6.3.2-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: nspr: signature from "Anatol Pomozov <anatol.pomozov@gmail.com>" is unknown trust
:: File /var/cache/pacman/pkg/nspr-4.10.4-1-x86_64.pkg.tar.xz is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: failed to commit transaction (invalid or corrupted package)
Errors occurred, no packages were upgraded.




Eschwartz wrote:

Note that you could also use the Arch Linux Archive to update your system in monthly increments... although that will take a lot longer and use a lot more bandwidth.

Advantages:
You don't need to take the system offline and use the install media you might not have handy.
Depending on what packages might have replaced what packages, a single jump via the install media might miss part of the upgrade path and give you headaches/dependency errors. Incremental updates are more reliable -- after all, that is what normally happens! tongue

Last edited by forkenbrock (2017-01-09 21:39:22)

Offline

#7 2017-01-09 21:46:11

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

The original plan of updating from Live CD didn't work either.  I went through the steps below, but seemed to get stuck at the end.  Everything seemed to mount OK, but the refresh happened very quickly, as if it was updating the newer OS and it definitely didn't change the OS on the drive.


Create Arch USB with Universal USB Installer

pacman -Syu
mount /dev/sdax /mnt    #mount all partitions on existing drive

mount -t proc proc /mnt/proc     
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev

pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -Syyu



Some posts recommended this command.  The word Root in the command turned color from Red to White and there was no longer network connectivity, to connect pacman.

chroot /mnt /bin/bash

Offline

#8 2017-01-09 21:46:12

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Best Practice for System Update?

pacman-key --refresh-keys

Sometime over the last couple years, anatolik's key expired and was updated in archlinux-keyring. wink Since your date did not go back in time with everything else, gpg is throwing fits.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#9 2017-01-09 21:48:24

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

Thank you Eschwartz, I will try this.

Eschwartz wrote:

pacman-key --refresh-keys

Sometime over the last couple years, anatolik's key expired and was updated in archlinux-keyring. wink Since your date did not go back in time with everything else, gpg is throwing fits.

Offline

#10 2017-01-10 09:16:11

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

Well, I worked through several errors and had the updates installed up to 7/20/16, but something in the keyring was broken, so I could no longer update the keys.  When I rebooted my GUI was corrupted (I was using LXDE) and I just got a blank screen full of white squares.

I thought I might give it one more try, by using the Live CD to repair broken packages.  I don't know if this would solve my problem and I don't know why the commands below wouldn't allow me to do a fresh update from the Live CD.


forkenbrock wrote:

Create Arch USB with Universal USB Installer

pacman -Syu
mount /dev/sdax /mnt    #mount all partitions on existing drive

mount -t proc proc /mnt/proc     
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev

pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -Syyu

Offline

#11 2017-01-10 09:54:03

akrep55tr
Member
Registered: 2013-11-20
Posts: 10

Re: Best Practice for System Update?

"mount /dev/sdax /mnt    #mount all partitions on existing drive" change this according to your partition.
sdax is false. It should be sda1 or sda2 ...

Last edited by akrep55tr (2017-01-10 09:54:46)

Offline

#12 2017-01-10 10:21:00

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

I did actually get that part right.  I can see how it looks like I made an error there, so thanks for pointing it out.

akrep55tr wrote:

"mount /dev/sdax /mnt    #mount all partitions on existing drive" change this according to your partition.
sdax is false. It should be sda1 or sda2 ...

Offline

#13 2017-01-10 10:33:22

forkenbrock
Member
Registered: 2011-12-06
Posts: 43

Re: Best Practice for System Update?

It seems that this command was supposed to go in there somewhere, but I'm not sure where; it seemed to kill my pacman connection when done after all the mount steps.

  arch-chroot /mnt /bin/bash


forkenbrock wrote:

Create Arch USB with Universal USB Installer

pacman -Syu
mount /dev/sdax /mnt    #mount all partitions on existing drive

mount -t proc proc /mnt/proc     
mount -t sysfs sys /mnt/sys
mount -o bind /dev /mnt/dev

pacman --root /mnt --cachedir /mnt/var/cache/pacman/pkg -Syyu

Offline

#14 2017-01-10 10:50:43

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Best Practice for System Update?

Please use the edit function to append information to your previous post when it is the last in the thread, as per our forum policy. It is also the convention to post replies below quoted posts so that the entire post can be read in order from top to bottom. Thanks.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

Board footer

Powered by FluxBB