[HowTo] Fix package "is newer than ..."

Difficulty: ★☆☆☆☆

What does this error mean?

This is not an error but only a warning, because it expresses an “abnormal” situation which may or may not be harmful.
That situation is exactly as described by the message: the package installed on your system is a newer version than the one in the repositories.

How did that happen?

There are two major cases:

  • You switched from the stable branch to another, in which newer versions of packages are tested. By updating from that branch, you can get those newer versions early. Then, by switching back to the stable branch, you effectively (temporarily) have a newer version of those packages than those in the branch.
  • Maintainers reverted the package to an earlier version in the repositories. This sometimes happen when a major issue is found, in order to limit the spread of that issue occurring to users.

How to fix this?

There are two cases:

  • If the newer version works on your end, you don’t have anything to do. The message will disappear on its own when the package is updated on the repositories.

  • If the newer version does not work on your end, if you want to stay aligned with the repositories, or if you simply do not want the warning to appear, you can downgrade the package by forcing the package manager to install the version from the repositories:

    sudo pacman -Syuu
12 Likes

There’s a third scenario, unfortunately. Some of our mirrors are behind Cloudflare in order to protect them against DDoS attacks. The way this then works is that Cloudflare will offer a cache of the mirror’s content. However, this may (and in the case of some of our mirrors, does) lead to the scenario where the mirror gets updated but the cache still presents the old content.

The only solution in that case is to update one’s mirror list, e.g. like so… :arrow_down:

sudo pacman-mirrors -f 5 && sudo pacman -Syyu
2 Likes

In the case of a downgrade branch from testing to stable, after waiting the next update when this next update has come what is the safiest is a simple -Syu enough ?

Normally, yes. Or perhaps -Syyuu, in case you need to downgrade something.

How are these comments not covered by the tutorial itself?
Its simple … Syu syncs/upgrades … an extra u also allows downgrades.
This will ‘fix’ the message “package is newer than …” … though in most cases, unless you have an explicit reason to do so, you should probably not use the downgrade function even if you revert branches such as from Testing to Stable.