0

I am using Arch. Last night I started installing a package whose repo size is ~2GB, but my internet connection is very slow, so I let it run overnight. It finished the download, but timed out at the sudo password prompt.

Normally I would simply rerun it and let it do its thing, but when I tried that, the installation failed because the partition where yay's cache resides is quite full, so the package cannot be built there. That would've happened anyway, obviously, regardless of the timeout.

I'm curious is it possible to move the downloaded repo to a different partition, and tell yay to continue where it left off, or, alternatively, if I can finish the build manually without breaking anything (e.g. yay's awareness of installed packages).

I googled around a bit, and found the --builddir flag, so I tried simply giving it an alternate build directory on another partition. That did what I expected, but it still had to redownload everything.

So I aborted it and copied the package repository (the one downloaded overnight) to that directory and ran yay again, hoping it would recognize the repository and continue where it left off. But it got confused because the branch name was the same as the directory name:

error resetting <my_package>: fatal: ambiguous argument 'HEAD': both revision and filename Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' 

Finally, I tried running the installation manually by running makepkg -si in that alternative builddir, and I got the following error:

ERROR: /path/to/builddir/package is not a clone of git://<url_to_package> Aborting... 

I'll just delete everything and redownload it to the alternate builddir, but I'm curious what would be the best way to install the package without redownloading everything if I really had to.

4
  • When using yay, and probably other AUR helpers, the password is asked 1) before downloading AUR packages themselves, if they require installing dependencies, and/or 2) after the first AUR package has been built, to install it. If you are in case 2, the directory ~/.cache/yay/<package_name> likely contains the built package as a <package_name..>.pkg.tar.zst and you can simply install it using sudo pacman -U ~/.cache/yay/<package_name>/<package_name...>.pkg.tar.zst. Commented Mar 8, 2021 at 12:09
  • However, it'd be of help if you added the exact commands you run and the full path of the directories you used. It is otherwise hard to understand what went wrong and to suggest what you could do instead. Commented Mar 8, 2021 at 12:15
  • Hmm, that's weird. The package in question is linux-drm-tip-git and I ran yay -S linux-drm-tip-git last night, and it started cloning from the repo. It went on for several hours and hit only ~6% when I went to bed, and in the morning I saw the yay sudo timeout. Because my home partition was full, I rsync -av-ed ~/.cache/yay/linux-drm-tip-git to a different partition and deleted the original. In that copy, I don't see any .pkg.tar.zst files or anything like that. How come it asked me for the password after cloning, but before building? Commented Mar 8, 2021 at 12:55
  • Not sure. Possibly another AUR package needed to be installed in the same transaction. Commented Mar 8, 2021 at 13:12

1 Answer 1

0

A git repo copy is just a directory.

gnu mv can move directories to new partitions, so just use that.

1
  • I know that - as mentioned in the question, I tried moving the repository elsewhere and running yay with the --builddir flag set to the new location, but then git complained about the ambiguous HEAD. Do you know of a way to instruct yay on how to resolve that? Commented Mar 8, 2021 at 12:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.