1

So I recently updated to Xubuntu 22.04. Now the software center claims to have some updates which "Requires Restart". However, when I click the "Restart and Update" button, there is a small popup claiming

Unable to install updates:
Prepared update not found: /var/lib/PackageKit/prepared-update

Is that some kind of stale state? How can I solve this? It's pretty annoying that Software Center claims to have updates, but is not able to install them...


Here is a screenshot from software center:

Software center

red_trumpet
  • 1,849

2 Answers2

2

You can try using Synaptic Package Manager to install the updates by following these steps:

  1. If you don't already have Synaptic Package Manager, search for it and install it from the Software Center. When installed in Xubuntu, it appears in the menu under System. Run it from there.

  2. Synaptic Package Manager has three buttons at the top (shown in the screenshot): Reload (reloads the packages database), Mark All Upgrades and Apply.

    Synaptic Package Manager

    Click Reload and wait for it to finish. Then click Mark All Upgrades.

  3. At the bottom left there is a series of tabs. Click on Status. Now a list appears below the Reload button with the following options:

    • All
    • Installed
    • Installed (auto removable)
    • Installed (manual)
    • Installed (upgradable) - this only appears if there are upgrades available
    • Not installed

    If it is there, click on Installed (upgradable). Now all the upgradable packages will appear in the right hand window.

  4. The following columns are shown in the right hand window: Package (name), Installed Version, Latest Version and a Description. Click on a package if you want more info to appear in the bottom right window. If you are happy with the packages it has selected, click on the exclamation mark beside each one and select Upgrade.

  5. Once you have marked the upgrades you want, click on the Apply button at the top. When it is finished close Synaptic and go back to the Software Center and reload the Updates tab.

Some people do not want to use unattended upgrades.

GlenM
  • 39
  • 7
1

Today I got the same error message as described: (...)Prepared update not found: /var/lib/PackageKit/prepared-update. And I have managed to solve it regenerating that file in the following way:

  • $ su - # Open a terminal as super-user.
  • # cd /var/lib/PackageKit/ # Go to the directory where the missing file should be and check that it is not there.
  • # apt list --upgradable 2> /dev/null | grep -F '/' | sed -re 's/^([^\/]+).*$/\1/' > prepared-update # Generate the missing file, writing the packages that can be updated in (be careful and review the generated file later!).
  • # chmod o+r prepared-update # Perhaps unnecessary, but the rest of the files in this folder had "0644" permission, and the newly created one had "0640".

After this, I didn't force the update in the terminal; instead I restarted the computer. I logged in graphical mode, opened "Ubuntu Software" and checked the “Updates” tab: the error message no longer appeared and the packages listed in the “prepared-update” file were successfully updated (after the update the file disappeared).

I hope this can be usefull to someone.

Greetings.