How to reuse downloaded packages in another computer?

I have two computers, both running Manjaro XFCE, and the sets of software installed in them are quite the same.
When large updates are released, I would have to update them separately, and (download many duplicate packages twice).

Is there any way to use the packages downloaded in one computer in another, so that pacman/pamac would use an already downloaded package to update if it is available, and download it only if it is missing (e.g. if the package was not downloaded in the first computer)?

Something like this can be achieved in Debian based distributions by copying the .deb files to /var/cache/apt.

Hi @archisman
I think the download cache under Arch based distributions are located in /var/cache/pacman/pkg/
You can copy those files over to different system I guess.

I did the following successfully many times but a few years ago and I do not know if it will still work. So the risk is yours.

Suppose you do the first update on PC1. Now you want to update PC2. You can use PC1 as a download mirror for PC2.

  1. On PC1 goto the package cache:
    $ cd /var/cache/pacman/pkg
    Copy the update database files to here:
    $ sudo cp /var/lib/pacman/sync/*.db /var/cache/pacman/pkg
    Start a python http server here:
    $ python -m http.server
    Find and remember the ip of PC1 (there are a few options).

  2. On PC2 open a browser and ensure the server on PC1 can be seen (goto http://ip-of-PC1:8000 ). You can now close the browser.
    Edit the pacman mirrorlist, PC2:/etc/pacman.d/mirrorlist, and insert PC1 as the first mirror:

    [## Country : PC1 on LAN
    Server = http://ip-of-PC1:8000]
    (Exclude the square brackets)

Now do the normal update on PC2.
(Files in common with PC1 will be found there. Files unique to PC2 will not be found there but in a subsequent mirror in the mirrorlist.)

  1. When done close the server on PC1 with ^C.