FORCE yay to rebuild AUR package(s)

Because of the recent Python 3.11 upgrade, I need to rebuild some AUR packages and I’m actually going crazy right now, because I’m trying for more than an hour to get yay to rebuild some AUR packages that have Python dependencies.

I even removed all the caches, uninstalled the said package(s), but somewhere yay seems to have another cache I don’t know of…

Whatever I do, I get the dreaded “already made – skipping build” line. It even downloads the sources again(!), but then tells me that it was already made, again and again…

I tried the yay --rebuild, --rebuildall, --rebuildtree (not all at the same time, of course)

Then I tried yay -R , then yay -Sc, cleaned and removed everything. After that yay -S .

It also asks me every time if I want to cleanBuild a package, but it doesn’t matter what I answer here (None, All), too.

How can I force (and I mean really force!) yay to rebuild a package? I don’t want to install the already build package! I want it to behave as this package was never ever installed on the system before.

Is forum search failing ?

1 Like

Thank you, for the link! I did not find that topic, but was also only searching for “yay force rebuild” and similar words, not for “python”, since I don’t think it has anything to do with Python itself.

The article recommends this line to rebuild the said AUR packages:

yay -S --answerclean All --rebuildall $(< AUR_pkgs_to_reinstall.txt)

But I already tried exactly the same line (except with literal packagename(s) instead of a list) and yay still tells me, that it’s skipping because “already built”:

In this example for the “autojump-git” package:

[...]
==> Starting prepare()...
==> Starting pkgver()...
==> Sources are ready.
 -> autojump-git-22.5.3.r0.g06e082c-6 already made -- skipping build
==> Making package: autojump-git 22.5.3.r0.g06e082c-6 (Mo 05 Jun 2023 10:38:55 CEST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Starting pkgver()...
==> Sources are ready.
loading packages...
resolving dependencies...
looking for conflicting packages...

Packages (1) autojump-git-22.5.3.r0.g06e082c-6

Total Installed Size:  0.26 MiB

:: Proceed with installation? [Y/n]

yay has a semi-known bug about not respecting rebuild options …

one workaround is to remove the cache;

yay -Scc

another is to use a different aur helper (I use paru)

If you follow the whole list of commands,
earlier on, all those packages get removed.
Would that make a difference?

EDIT: just noticed this:

If not, then my guide is faulty and I’ll have to add yay -Scc.
(I use pikaur, not yay.)

I found the guide when I had already used pip to freeze and reinstall the packages.

yay seems indeed eager to always install the cached package. I thought I could get around this by using yay -Sc, but apparently this didn’t remove the makepkg cache I had configured manually at some point in the past. After deleting these packages even yay was out of options and had to rebuild.

The only issue I had with the other guided linked there was, that

$ pip list --user --outdated --not-required > upgrade_list.txt

produced a text format that

$ pip install --user --upgrade -r upgrade_list.txt

didn’t accept. Since there were only two packages, I typed them in manually.

Not sure if I did something wrong, but it seems there were coulmn headers that got wrongly interpreted as package names.

In between those 2 commands it says
“Edit ‘upgrade_list.txt’ to a bare list of bare package names”
(i.e. no headers, no version numbers),
and you didn’t do that. :slight_smile:

I guess people who can manually configure their own makepkg cache are expected to remember to clean it manually…

Thanks for the info about yay.
It seems like maybe -Sc does what it says in the manual.

yay: “EXTENDED PACMAN OPERATIONS
Yay will also clean cached AUR package and any untracked Files in the cache.
Cleaning untracked files will wipe any downloaded sources or built packages”
(this is not clear enough for me: “also” in addition to what?? what does untracked mean?)

pacman: “Remove (from the cache) packages that are no longer installed …
Use one –clean switch to remove only packages that are no longer installed;
use two to remove all files from the cache.”
(this is clear)

Don’t know if yay simply passes ‘-Sc’ to pacman; pikaur does.