From owner-freebsd-questions@freebsd.org Fri Sep 9 18:58:06 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3F9ABD4D7E for ; Fri, 9 Sep 2016 18:58:06 +0000 (UTC) (envelope-from lgroups@vlymskerp.net) Received: from mail.wolk.co.za (mail.wolk.co.za [197.189.230.211]) by mx1.freebsd.org (Postfix) with ESMTP id 2A17ABFE for ; Fri, 9 Sep 2016 18:58:05 +0000 (UTC) (envelope-from lgroups@vlymskerp.net) Received: from poskantoor (cal.wolk.co.za [10.30.40.70]) by mail.wolk.co.za (Postfix) with ESMTP id A6C86232F21 for ; Fri, 9 Sep 2016 20:57:57 +0200 (SAST) X-Virus-Scanned: amavisd-new at wolk.co.za Received: from mail.wolk.co.za ([10.30.40.70]) by poskantoor (mail.wolk.co.za [10.30.40.70]) (amavisd-new, port 10024) with LMTP id ovZI2GvyFjLj for ; Fri, 9 Sep 2016 20:57:48 +0200 (SAST) Received: from bulldozer.snk (unknown [165.255.160.137]) by mail.wolk.co.za (Postfix) with ESMTPSA id 746D522D972 for ; Fri, 9 Sep 2016 20:57:48 +0200 (SAST) Subject: SOLVED Re: copying /var/cache/pkg between machines To: freebsd-questions@freebsd.org References: <57D12678.7000903@vlymskerp.net> <3ca9afc1-a867-51aa-92df-96e6c7f80d24@FreeBSD.org> From: Coert Message-ID: <01407ad3-030d-2037-a6e3-4a9d0d81870f@vlymskerp.net> Date: Fri, 9 Sep 2016 20:57:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <3ca9afc1-a867-51aa-92df-96e6c7f80d24@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2016 18:58:07 -0000 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