How to download package using pacman?

I want to download cuda package using pacman. The man page tells me that -w is used to only download packages, not install. So I ran:

$ sudo pacman -Sw cuda
resolving dependencies...
:: There are 9 providers available for opencl-nvidia:
:: Repository extra
   1) opencl-nvidia-340xx  2) opencl-nvidia-390xx  3) opencl-nvidia-418xx  4) opencl-nvidia-430xx  5) opencl-nvidia-435xx  6) opencl-nvidia-440xx  7) opencl-nvidia-450xx  8) opencl-nvidia-455xx
:: Repository arch4edu
   9) opencl-nvidia-410xx

Enter a number (default=1): 
:: There are 9 providers available for nvidia-utils:
:: Repository extra
   1) nvidia-340xx-utils  2) nvidia-390xx-utils  3) nvidia-418xx-utils  4) nvidia-430xx-utils  5) nvidia-435xx-utils  6) nvidia-440xx-utils  7) nvidia-450xx-utils  8) nvidia-455xx-utils
:: Repository arch4edu
   9) nvidia-410xx-utils

Enter a number (default=1): 

Packages (3) nvidia-340xx-utils-340.108-1  opencl-nvidia-340xx-340.108-1  cuda-11.1.1-1

Total Download Size:  0.00 MiB

:: Proceed with download? [Y/n] 

The total download size is 0.00. Entering ‘Y’ did nothing.

Why the total download size is zero? What is the correct way to only download a package from repository?

Probably because you already have the package in your cache folder.

So check in /var/cache/pacman/pkg/ and see if it’s there.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.