Is it possible to backup/restore an already installed AUR package?

Hello guys.

I’m new here and this is my first question :grinning:

I switched from Ubuntu to Manjaro and I have the following problem:

In my work I use a tool that depends on a legacy Mozilla library.
In old versions of ubuntu, the package that contained this library was called libwebkitgtk-1.0-0

After several tries, I managed to find and install an AUR package that satisfies my needs: $ yay -Syu webkitgtk2 (Although it took a long time to build it)

My question is: Is there any way to make a backup of the compiled version of this package “webkitgtk2” that is ALREADY installed on my machine? And then easily import it in case I need it again?

My fear is that in the future I need to reinstall the system and this package is no longer available, or that something changes with a new build and it stops working…

I appreciate any help

pamac build -k packagename

As long as sources exist you can just copy PKGBUILD from AUR and use makepkg.

As for already compiled packages: they are saved in cache. Location of cache depends on which program you build it with. (eg. yay has it in ~/.cache/yay)

1 Like

You could just install the pre-compiled binary:

Hi, thanks for replying.

I had tried this package before but it didn’t work :man_shrugging:

Thanks for your attention and I appreciate if you can complement the answer :slight_smile:

The folder exists:

du -sh ~/.cache/yay/webkitgtk2
# 24M /home/anderson/.cache/yay/webkitgtk2

So, in your opinion, would I just do the procedures below?
1 - Make a backup of this folder and put it somewhere in the cloud,
2- If I need to reinstall the system, I would just restore the backup to the original path and run

yay -S webkitgtk2

You can simply copy the generated package file within that folder (.zst) and re-install it with pacman -U your-pkg.zst.

However, you don’t want to do this. It’s very likely that application is not working anymore when any of the underlying libraries (dependencies) are upgraded.

Simply save a list with the package names (e.g. pacman -Qqm > aur_pkgs.txt to list all foreign packages) and when you reinstall your system, install all those packages from scratch. That is the safest way…

If it is installed by yay and AUR is enabled in pamac an update will be seen and the new package can then be saved…This will be found in /var/cache/pacman/pkg