paru icon indicating copy to clipboard operation
paru copied to clipboard

Install specific version of an AUR package

Open arakis opened this issue 2 years ago • 4 comments

Discussed in https://github.com/Morganamilo/paru/discussions/1068

Originally posted by arakis November 8, 2023 I want to know how to install a specific version and/or branch/commit/tag.

I know ArchLinux is a Rolling Distribution and partial Updates are not allowed. That's why i'm using archive.archlinux.org.

There are two reasons why I need to specify a specific version (or commit):

a) If the AUR packages require a SPECIFIC installed dependency of the regular packages. Example: You stick with virtualbox 7.0.10 (using archive.archlinux.org), but the latest AUR virtualbox-ext-oracle is at 7.0.12. To work around this, instead of using paru, I'm using these commands:

cd ~/.cache/paru/clone/virtualbox-ext-oracle
git checkout 9184ed4abf39476502419f626e3da6980ccf53d2 #7.0.10
makepkg -si --noconfirm

b) avoid re-downloading packages/sources again. The reason is, once a month, I completely rebuild my arch linux from another running linux chroot via a large, well maintained script. This means, I wipe the whole file system except the arch package cache, and the paru cache and some important data directories. I can re-build as often I want, normally, there are no re-downloads. But when paru detects new version, it will force always the latest versions. In case of large binary packages, i there could be several gigabytes of data. FYI: I'm on cell connection only, and mostly I have horrible connection.

I have no problems to iterate the commits and check the PKGBUILD version until I find a specifc commit that matches that PKGBUILD file. But even if I have the matching commit, I have no way to tell paru to take that commit. Even if I checkout the commit manually (see my example above), paru will ignore this.

Of course, I could take makepkg alone without paru, but then I lose some dependency resolving features, like when an AUR packages requires another AUR package.

Summary

I kindly ask to add one of the following mechanisms:

  • Install with explicit version like paru -S package=version.
  • Install with explicit commit hash --> you checkout exactly that commit from AUR. Let's say paru -S package --commit-hash=<hash>
  • Let user manually checkout the repo (see above), and do NOT pull the latest PKGINFO, just take the repo as it it locally checked out. This method should work without any internet connection (if the repo is already cloned).

arakis avatar Nov 28 '23 11:11 arakis

You can use a local pkgbuild repo to keep packages on a commit that you want.

Morganamilo avatar Nov 28 '23 17:11 Morganamilo

Can you sketch how this concept would work, please? Checkout the specific AUR repo (containing the PKGINFO file), checkout the specific comit, and than just tell paru to take that directory? how to do this with multiple packages? Can i just point to the parent dir of the repo? If yes, can i just link to ~/.cache/paru/clone?

Questions over questions - small hint/sketch of the workflow would be amazing.

arakis avatar Nov 28 '23 18:11 arakis

Add

[myrepo]
Path = /home/user/myrepo

to your paru.conf

Then clone whatever aur packages you want into that dir and checkout the commits you want.

Should be as simple as that.

Using paru-git is better for this as it has a minor bug fix.

Morganamilo avatar Nov 28 '23 18:11 Morganamilo

I still get version 7.0.12 instead of 7.0.10:

paru@arch myrepo/virtualbox-ext-oracle - [master~1] $ paru -S virtualbox-ext-oracle
:: Resolving dependencies...
:: Calculating conflicts...
:: Calculating inner conflicts...

Aur (1)                    Old Version  New Version    Make Only
aur/virtualbox-ext-oracle  7.0.12-1     7.0.12-1       No

Context / Configuration:

paru@arch myrepo/virtualbox-ext-oracle - [master~1] $ pwd
/home/paru/myrepo/virtualbox-ext-oracle

paru@arch myrepo/virtualbox-ext-oracle - [master~1] $ ls -l ~/myrepo
lrwxrwxrwx 1 paru paru 50 Nov 30 21:38 virtualbox-ext-oracle -> /home/paru/.cache/paru/clone/virtualbox-ext-oracle

paru@arch myrepo/virtualbox-ext-oracle - [master~1] $ cat PKGBUILD | grep pkgver=
pkgver=7.0.10

paru@arch myrepo/virtualbox-ext-oracle - [master~1] $ tail -n 2 /etc/paru.conf
[myrepo]
Path = /home/paru/myrepo

paru@arch myrepo/virtualbox-ext-oracle - [master~1] $ paru --version
paru v2.0.0.r13.g26ce55f - libalpm v13.0.2

What i'm doing wrong?

arakis avatar Nov 30 '23 21:11 arakis