SOLVED Re: copying /var/cache/pkg between machines

Coert lgroups at vlymskerp.net
Fri Sep 9 18:58:07 UTC 2016



On 09/08/16 11:17, Matthew Seaman wrote:
> On 2016/09/08 09:51, Coert wrote:
>> I have a few FreeBSD machines running with KDE installed.
>> When I copy /var/cache/pkg to another machine, it downloads all packages
>> again anyway.
>> I tried rsync, tar, made sure the symlinks with checksums are preserved,
>> but to no avail.
>>
>> What is the recommended way to sync /var/cache/pkg between machines?
> Sync'ing /var/cache/pkg like that isn't something that has been
> considered as 'normal' usage of pkg(8), so there's no guarantee that it
> will work.
>
> However, what you can do is create a local package repo from
> /var/cache/pkg by:
>
>     pkg repo /var/cache/pkg
>
> This can be served to your other machine by HTTP or even copied over to
> the other machine by rsync.  eg.
>
>     rsync -avx /var/cache/pkg/ othermachine:/var/myrepo/
>
> and then on othermachine add in /usr/local/etc/pkg/repos/myrepo.conf:
>
>     myrepo: {
>       url: file:///var/myrepo
>       priority: 10
>     }
>
> othermachine will still be able to use the default FreeBSD pkg
> repositories, but it will prefer 'myrepo' as far as possible.
>
> 	Cheers,
>
> 	Matthew
>
>
Thanks Matthew!

So far it's working perfectly.
South Africa internet is not always that epic, so I'm doing the following:

pkg fetch -a -o /my/local/mirr


Regards,
Coert


More information about the freebsd-questions mailing list