# The mysterious REPO_AUTOUPDATE option in pkg.conf



## eternal_noob (Feb 16, 2022)

By default invoking either of `pkg install` or `pkg upgrade` will cause repository catalogues to be updated automatically, unless disabled by setting REPO_AUTOUPDATE to false in pkg.conf(5).

I wondered if anyone uses pkg with the REPO_AUTOUPDATE option set to false and for what reason.
If you use pkg with that option disabled, please tell me why.


----------



## Geezer (Feb 16, 2022)

No. Why would you want to set it to false?


----------



## eternal_noob (Feb 16, 2022)

This is a very good question. I smell a feature creep.


----------



## grahamperrin@ (Feb 16, 2022)

Geezer said:


> … Why would you want to set it to false?



Two use cases come to mind: 

an Internet connection is impossible, or unwanted
pkg-upgrade(8) in single user mode.
As far as I can tell, the `REPO_AUTOUPDATE` configuration variable originated in relation to pkg-version(8): 









						pkg version · Issue #396 · freebsd/pkg
					

When I issue 'pkg version -R' it does not actually use the remote repository for comparison; instead it uses the local cache of the remote repository, i.e. it checks local.sqlite against re...




					github.com
				




fixed in `pkg-1.1` in 2012.


----------



## Vull (Feb 16, 2022)

I guess I'd say that I do "use" it, but I use it by not changing it. Rather, I just leave it set to true. Obviously that's not what you mean here, so I'll vote "no."


----------



## zirias@ (Feb 16, 2022)

First of all, I wouldn't call something "feature creep" that amounts to just cleanly skipping some code based on a simple boolean flag.

The skipping is necessary anyways to make `pkg` commands dealing with remote repos work as an unprivileged user (without write permission to the local pkg databases).

A possible practical usecase is to avoid unnecessary requests when e.g. using pkg-rquery(8) a lot -- it doesn't make sense to check the remote repo each and every time. Of course, you can also use the commandline flag `-U` for that.


----------



## eternal_noob (Feb 16, 2022)

Vull said:


> I guess I'd say that I do "use" it, but I use it by not changing it.


Good point. Unfortunately, i can't edit the question anymore.


----------



## sko (Feb 16, 2022)

I suspect the main use case is to prevent a repo update upon `pkg search`. I usually forget to use the -U switch with that and then have to wait until the repo is updated, which can be rather annoying on a slow connection, especially if I only wanted to get an idea of what is available for a given keyword and didn't plan on installing anything (yet).


----------



## Geezer (Feb 16, 2022)

eternal_noob said:


> Vull said:
> 
> 
> > I guess I'd say that I do "use" it, but I use it by not changing it. Rather, I just leave it set to true. Obviously that's not what you mean here, so I'll vote "no."
> ...



This is one of those cases where _yes_ means _no_. A bit like talking with the wife, really.


----------



## Erichans (Feb 16, 2022)

Tuning of REPO_AUTOUPDATE maybe appropriate sometimes when used in Jails creation?


----------

