fix Powerpill with Pacman re-download cached packages
There for me, a strange thing happened:
- Powerpill download package files(
*.pkg.tar.zst
) into CacheDir[1] - Pacman download package files again
How it happen?
Possible 1: Signature check failed
Pacman does check every pkg file according to default pacman.conf
. For safety reason you should not change this options.
Possible 2: Aira2c does downloading to .part
file
Check the /etc/pacman.conf
:
1 | [options] |
Look at the XferCommand
’s value, when pacman downloading pkg file e.g. http://mirrors.tuna.tsinghua.edu.cn/archlinux/core/os/x86_64/pacman-6.0.2-8-x86_64.pkg.tar.zst
, the command executed is:
1 | /usr/local/bin/aria2c \ |
You’ll see it writes to file //var/cache/pacman/pkg/pacman-6.0.2-8-x86_64.pkg.tar.zst.part
, the prefix //
and suffix .part
it not we expected.
This configure file will statisfiy we requirements:[2]
1 | [options] |
1 | # error handling |
Possible 3: miss time stamp / local file is older than server
If server(Mirror server) did not pass the file update time to aria2c/wget/curl, then your client will download again. It behave as if as the local file is older than server.
If no time stamp provides, it will be default to 1 January 1970 00:00:00 UTC
(Unix Timestamp 0
).
To check if a mirror site provides file update time or not yet at all, run follow command:[3]
1 | curl --silent --head "$(pacman -Sp pacman --cachedir /dev/null)" | grep Last-Modified |
Command result should be like Last-Modified: Wed, 20 Sep 2023 23:37:12 GMT
.
- If
grep
exited with return value1
, it means no match line found, this only happens when server response does not contain a time stamp.
End
This is the first time I write blog in English.
Defined in
/etc/pacman.conf
↩︎https://bbs.archlinux.org/post.php?tid=269644&qid=1992948 ↩︎