Unexpected system reboot during updates

I was away for more than a week. When I came back I turned the desktop PC on and ran yay. It was about 99% finished when the computer unexpectedly restarted. Either a hard drive problem or a power issue, but regardless of why, it messed it up a bit.

I found that multiple programs were broken, for example Google Chrome, and others installed from AUR. They had broken installations, no icon, and wouldn’t start.

I couldn’t reinstall them, because it refused to overwrite existing files. For example, hundreds of lines like this:

error: failed to commit transaction (conflicting files)
google-chrome: /opt/google/chrome/CHROME_VERSION_EXTRA exists in filesystem
google-chrome: /opt/google/chrome/MEIPreload/manifest.json exists in filesystem
google-chrome: /opt/google/chrome/MEIPreload/preloaded_data.pb exists in filesystem
google-chrome: /opt/google/chrome/PrivacySandboxAttestationsPreloaded/manifest.json exists in filesystem

In one instance, I resolved it by manually removing all mentioned files and directories, and then it allowed me to install the program.

I then discovered the --overwrite option, which allowed me to re-install such programs.

My problem now is I don’t know what might be broken, because there were hundreds of updates being installed. I suspect it might only be the last things that were installed from AUR that failed to complete, but is there a way to identify what was previously updated? I could force a reinstall of those things, but I don’t know if there’s a way to identify was updated in a previous run of yay.

You can use pacman’s log for this.

cat /var/log/pacman.log

Or you can send it to a file like this:

cat /var/log/pacman.log > pacman_log.log

The end of the list is the newest, and the start of the list is the oldest.


I have a Fish function/alias I run before I update that sends the list of apps with an update available to a date-stamped file. It’s less cluttered than pacman’s log.
You can see it below.

### Function to send checkupdates and paru -Qua to a file then open it in micro
function cup
    set syu_date_format (date +"%Y-%m-%d_%H-%M-%S")
    set syu_log_name "$HOME/syu-$syu_date_format.sh"

    # Capture the output of checkupdates and paru -Qua
    set checkupdates_output (checkupdates | sed 's/\x1b\[[0-9;]*m//g')
    set paru_output (paru -Qua)

    # Check if there are any updates
    if test -n "$checkupdates_output" -o -n "$paru_output"
        # If there are updates, create the file and write the output
        printf "%s\n" $checkupdates_output > "$syu_log_name"
        printf "%s\n" $paru_output >> "$syu_log_name"
        sleep 0.1
        micro "$syu_log_name"
        # Remove the last two lines above if you don't need to see the output.
        # They can be replaced with syu && yy / syu && yy && fup to update immediately.
        # This is good for logging the available updates before updating.
    else
        echo "No updates found."
    end
end

This might be of some help.