Quantcast

How to use cached packages

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to use cached packages

Patrick Powell
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.

--
Patrick Powell                 Astart Technologies
[hidden email]            1530 Jamacha Rd, Suite X
Network and System             San Diego, CA 92019
   Consulting                   Cell 858-518-7581 FAX 858-751-2435
Web: papowell at astart dot com

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use cached packages

Freddie Cash-8
On Thu, Apr 20, 2017 at 11:58 AM, Patrick Powell <[hidden email]>
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 believe you can specify multiple packages on the command-line and it
will install them all.  If there are required dependencies, you'll have to
specify them on the command-line as well.  If you specify all the packages
on the CLI, then it won't check the remote repo.

There's also a flag you can add to prevent it from doing a
behind-the-scenes "pkg upgrade" before the​ install.  Ah yes, it's -U or
--no-repo-update.


--
Freddie Cash
[hidden email]
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use cached packages

Miroslav Lachman
Freddie Cash wrote on 2017/04/20 22:17:

> On Thu, Apr 20, 2017 at 11:58 AM, Patrick Powell <[hidden email]>
> 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"

> ​I believe you can specify multiple packages on the command-line and it
> will install them all.  If there are required dependencies, you'll have to
> specify them on the command-line as well.  If you specify all the packages
> on the CLI, then it won't check the remote repo.
>
> There's also a flag you can add to prevent it from doing a
> behind-the-scenes "pkg upgrade" before the​ install.  Ah yes, it's -U or
> --no-repo-update.

Miroslav Lachman

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use cached packages

Freddie Cash-8
On Thu, Apr 20, 2017 at 1:36 PM, Miroslav Lachman <[hidden email]> wrote:

> Freddie Cash wrote on 2017/04/20 22:17:
>
>> On Thu, Apr 20, 2017 at 11:58 AM, Patrick Powell <[hidden email]>
>> 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 or by matching against package names
(or
     origins) in the repository catalogues using shell globbing or 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.  :)​

--
Freddie Cash
[hidden email]
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use cached packages

Miroslav Lachman
Freddie Cash wrote on 2017/04/20 22:39:

> On Thu, Apr 20, 2017 at 1:36 PM, Miroslav Lachman <[hidden email]
> <mailto:[hidden email]>>wrote:
>
>     Freddie Cash wrote on 2017/04/20 22:17:
>
>         On Thu, Apr 20, 2017 at 11:58 AM, Patrick Powell
>         <[hidden email] <mailto:[hidden email]>>
>         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

_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to use cached packages

Mike Clarke-17
In reply to this post by Freddie Cash-8
On Thu, 20 Apr 2017 13:17:35 -0700
Freddie Cash <[hidden email]> wrote:

> ​If you have the .txz/.tbz package file, then it's a simple:
>
> # pkg install /path/to/firefox-versions-blahblah.txz

But the version in the cache could be earlier than the version that was
previously installed, in which case you might have dependency problems
if it requires earlier versions of dependencies than those already
installed on your system.

--
Mike Clarke
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[hidden email]"
Loading...