You are not logged in.

#1 2021-07-15 13:46:27

euphorbia
Member
Registered: 2021-07-15
Posts: 3

--downloadonly redownloads everything

-w, --downloadonly   download packages but do not install/upgrade anything

Seems pretty handy, in fact I need something like this for upgrade automation. Only problem: It doesn't just do what it says in the help. Unlike pacman -Syu, it redownloads everything, ignoring existing packages in cache. That's a huge waste of bandwidth. I only need it to download packages that are not in cache, and then refrain from installing them, so I can install them later. There's no separate flag for that behavior. "Redownload everything" and "download but don't install" are the same flag. Doesn't make sense to me - or am I overlooking something?

Offline

#2 2021-07-15 13:54:07

Scimmia
Fellow
Registered: 2012-09-01
Posts: 8,747

Re: --downloadonly redownloads everything

It doesn't for me. Example?

Offline

#3 2021-07-15 14:14:57

euphorbia
Member
Registered: 2021-07-15
Posts: 3

Re: --downloadonly redownloads everything

Oh, nevermind. It seems this problem only appears when you uncomment the wget line in your pacman.conf, which I had done. It still makes no sense because the wget command I'm using includes the -nc flag, and wget in fact doesn't overwrite the existing files, but it still pointlessly downloads them. I don't understand this either, but I guess it might not be a pacman issue. My bad.

Last edited by euphorbia (2021-07-15 14:16:21)

Offline

#4 2021-07-15 14:35:50

euphorbia
Member
Registered: 2021-07-15
Posts: 3

Re: --downloadonly redownloads everything

Ok I figured out why this happens. The %o variable pacman hands to wget has ".part" built in. That means wget thinks it's downloading a new file, and doesn't recognize the existing file without the ".part".

Edit:

Alright, I had to work around several unhelpful pacman behaviors but I finally got something working.

The -nc flag cannot actually be used because if pacman doesn't find a .part file after invoking wget, it'll time out. So I had to write a wrapper script for wget. This script checks if the file exists without ".part" and if it's in /var/cache/pacman/pkg/ (otherwise .db files will be skipped). If both conditions are met, it will skip download and rename the existing file to have a ".part" suffix, only so that pacman can remove the suffix and doesn't complain. Existing ".part" files will be overwritten.

I needed to use wget in order to be able to utilize its built-in rate-limiting feature.

Last edited by euphorbia (2021-07-15 20:07:09)

Offline

#5 2021-07-16 16:04:40

teckk
Member
Registered: 2013-02-21
Posts: 436

Re: --downloadonly redownloads everything

I needed to use wget in order to be able to utilize its built-in rate-limiting feature

agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0"
url="http://www.something.com"

curl -A "$agent" --limit-rate 200k "$url" -o file.out

wget -U "$agent" --limit-rate=200k "$url" -O file.out

Offline

#6 2021-07-16 16:16:37

ugjka
Member
From: Latvia
Registered: 2014-04-01
Posts: 1,673
Website

Re: --downloadonly redownloads everything

Why is this stickied?


Back on Arch
--- ugjka.net ---
"Learning the hard way is the only way for many."

Online

#7 2021-07-16 18:27:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 10,499
Website

Re: --downloadonly redownloads everything

ugjka wrote:

Why is this stickied?

I'm guessing one of the other mods misclicked.

Mod note: unstickying.

Last edited by WorMzy (2021-07-16 18:27:47)


Sakura:-
Mobo: MSI MEG B550 UNIFY // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2021-09-23 12:15:47

JoeCool
Member
Registered: 2019-08-12
Posts: 6

Re: --downloadonly redownloads everything

I think this is still an issue. Even without any XferCommand in the conf file pacman redownloads all files even if it states that it doesn't need to. This seems to be a recent change in version 6. This has definitely worked before.

:: Pacman command: /usr/bin/sudo /usr/bin/pacman -Suw
:: Starting full system upgrade...
resolving dependencies...

Package (31)                            Old Version     New Version     Net Change

extra/alsa-card-profiles                1:0.3.36-1      1:0.3.37-1        0.00 MiB
core/btrfs-progs                        5.14-1          5.14.1-1          0.00 MiB
core/curl                               7.79.0-4        7.79.1-1          0.00 MiB
--
SNIP
--
extra/xterm                             368-1           369-1             0.00 MiB

Total Download Size:  0.00 MiB

:: Proceed with download? [Y/n] 
:: Retrieving packages...
 file-5.40-6-x86_64                                                                                                                    345.0 KiB   821 KiB/s 00:00 [####################################################################################################] 100%
 libglvnd-1.3.4-1-x86_64                                                                                                               353.2 KiB   785 KiB/s 00:00 [####################################################################################################] 100%
 lib32-curl-7.79.1-1-x86_64                                                                                                            285.2 KiB   829 KiB/s 00:00
--
SNIP
--

It doesn't seem to matter where the files in the pacman cache came from. (powerpill, pacman, manual download)

EDIT: It only seems to redownload some files. I guess this need further investigation. Anyone with the same issue?

Last edited by JoeCool (2021-09-23 12:17:21)

Offline

#9 2021-09-23 12:40:20

teckk
Member
Registered: 2013-02-21
Posts: 436

Re: --downloadonly redownloads everything

https://bbs.archlinux.org/viewtopic.php?id=269644

Edit:
I've updated since that post with pacman 6. Share the package.pkg.tar.zst and the package.tar.zst.sig file with another machine that has the same pacman database.

Works just like it always has. Update one machine, shared packages and sig files with all other machines, update them.

Last edited by teckk (2021-09-23 13:39:32)

Offline

#10 2021-09-23 15:02:34

JoeCool
Member
Registered: 2019-08-12
Posts: 6

Re: --downloadonly redownloads everything

Ah thanks a lot.

Offline

Board footer

Powered by FluxBB