From owner-freebsd-ports@freebsd.org Thu Apr 20 21:18:38 2017 Return-Path: Delivered-To: freebsd-ports@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 50AB8D483A0 for ; Thu, 20 Apr 2017 21:18:38 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (elsa.codelab.cz [94.124.105.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 127C8C29 for ; Thu, 20 Apr 2017 21:18:37 +0000 (UTC) (envelope-from 000.fbsd@quip.cz) Received: from elsa.codelab.cz (localhost [127.0.0.1]) by elsa.codelab.cz (Postfix) with ESMTP id 24BAE28462; Thu, 20 Apr 2017 23:18:35 +0200 (CEST) Received: from illbsd.quip.test (ip-86-49-16-209.net.upcbroadband.cz [86.49.16.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by elsa.codelab.cz (Postfix) with ESMTPSA id 030DC28454; Thu, 20 Apr 2017 23:18:32 +0200 (CEST) Subject: Re: How to use cached packages To: Freddie Cash Cc: Patrick Powell , FreeBSD Ports ML References: <58F91BB7.5020008@quip.cz> From: Miroslav Lachman <000.fbsd@quip.cz> Message-ID: <58F925A8.7030702@quip.cz> Date: Thu, 20 Apr 2017 23:18:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Apr 2017 21:18:38 -0000 Freddie Cash wrote on 2017/04/20 22:39: > On Thu, Apr 20, 2017 at 1:36 PM, Miroslav Lachman <000.fbsd@quip.cz > >wrote: > > Freddie Cash wrote on 2017/04/20 22:17: > > On Thu, Apr 20, 2017 at 11:58 AM, Patrick Powell > > > wrote: > > I ran into a problem where I needed to reinstall a package. > However, I > did not have network access to the pkg repository. I did > have a system > which had all of the pkgs which I needed in the pkg cache. > I can easily > copy these to the system, as well as the pkg database, etc. > > So: is there a SIMPLE way to have pkg check to see if a pkg > is already in > the pkg cache and use that before trying to go to the > repository? > > Is there a SIMPLE way to prevent pkg from trying to check > the pkg > repository for an update? > > I strongly suspect that something like: > > pkg --do_not_check_for_latest_version --use_cached_pkg > install firefox > > Any help on this before I tear out the three strands of hair > I have left > would be appreciated. > > > > ​If you have the .txz/.tbz package file, then it's a simple: > > # pkg install /path/to/firefox-versions-blahblah.txz > > > I think it is "pkg add /var/cache/pkg/firefox-versions-blahblah.txz" > > > ​Both work. "pkg add" is there for backward compat with the old way > (pkg_add). "pkg install" can install from remote repos or local files. > From the man pages: > > ​DESCRIPTION > pkg install is used for installation of packages from package > reposito- > ries or local archives. Multiple package names can be specified > on the > command line, either explicitly orby matching against package > names (or > origins) in the repositorycatalogues using shell globbingor regular > expressions. > > > DESCRIPTION > pkg add installs packages from either a local source or a remote one. > > When installing from a remote source you need to specify the > protocol to > use when fetching the package. > > > ​For ease of use, "pkg install" works for everything. :)​ I do not remember exactly why I am using pkg add. Maybe pkg install did not work for me in the past (when downgrading from /var/cache/pkg) or maybe because pkg add will not try to fetch from repo defined in /usr/local/etc/ Anyway good to know both works :) Miroslav Lachman