# pkg.conf is deprecated



## mariourk (Nov 27, 2013)

Hi,

When I was updating some packages with portmaster, I got this error:

```
pkg: PACKAGESITE in pkg.conf is deprecated. Please create a repository configuration file
```
I'm not sure what this means and what I should do :\ 

This is what /usr/local/etc/pkg.conf says:

```
# System-wide configuration file for pkg(1)
# For more information on the file format and
# options please refer to the pkg.conf(5) man page

# Configuration options
PACKAGESITE         : http://pkg.freebsd.org/${ABI}/latest
#PKG_DBDIR          : /var/db/pkg
#PKG_CACHEDIR       : /var/cache/pkg
#PORTSDIR           : /usr/ports
#PUBKEY             : /etc/ssl/pkg.conf
#HANDLE_RC_SCRIPTS   : NO
#PKG_MULTIREPOS     : NO
#ASSUME_ALWAYS_YES   : NO
#SYSLOG             : YES
#SHLIBS             : NO
#AUTODEPS           : NO
#PORTAUDIT_SITE     : http://portaudit.FreeBSD.org/auditfile.tbz

# Repository definitions
#repos:
#  default : http://example.org/pkgng/
#  repo1 : http://somewhere.org/pkgng/repo1/
#  repo2 : http://somewhere.org/pkgng/repo2/
```
It seems identical to the pkg.conf on another FreeBSD 9.1 server, that doesn't complain about anything.


----------



## SirDice (Nov 27, 2013)

The syntax of the file changed, this has nothing to do with the version of FreeBSD but with the version of ports-mgmt/pkg.


----------



## mariourk (Nov 27, 2013)

So... What should I do to fix this? /usr/ports/UPDATING doens't mention this issue.


----------



## mariourk (Nov 27, 2013)

I followed the instructions I found here. It looks like that did the trick.


----------



## SirDice (Nov 27, 2013)

Yeah, I went looking in UPGRADING too, I would have expected some information there. My pkg hasn't changed yet, I haven't updated for a while, but is the correct format in pkg.conf(5)? I may need to change my /usr/local/etc/pkg.conf too some time soon I guess :e


----------



## kpa (Nov 27, 2013)

It's almost all there but it fails to mention the braces that have to enclose the settings. This is how it should be now so that pkg doesn't complain:


```
FreeBSD: { 
    url             : "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
    enabled         : yes,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
```

On stable/10 the file to edit is /etc/pkg/FreeBSD.conf, took me while to figure that out.


----------



## tzoi516 (Nov 27, 2013)

I have mine setup similarly, except I'm using the URL that came with FreeBSD 10.0-BETA3. I still get the error even if I use the ABI URL.


----------



## kpa (Nov 27, 2013)

Do you still have a PACKAGESITE set in /usr/local/etc/pkg.conf? You should edit that out if you do. In fact redo the file completely by copying the pkg.conf.sample over what you have now:


```
mv/usr/local/etc/pkg.conf /usr/local/etc/pkg.conf.old
cp /usr/local/etc/pkg.conf.sample /usr/local/etc/pkg.conf
chmod 640 /usr/local/etc/pkg.conf
```


----------



## tzoi516 (Nov 27, 2013)

What's the difference between that and /etc/pkgFreeBSD.conf? pkg.conf.sample doesn't even have a URL or PACKAGESITE line for my FreeBSD 10.0-BETA3 install.

/etc/pkgFreeBSD.conf:

```
# $FreeBSD: stable/10/etc/pkg/FreeBSD.conf 257572 2013-11-03 13:00:12Z bdrewery $
FreeBSD: {
  url: "pkg+http://pkg.freebsd.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "none",
  fingerprints: "/usr/share/keys/pkg",
  enabled: "yes"
}
```

pkg.conf.sample:

```
# System-wide configuration file for pkg(8)
# For more information on the file format and
# options please refer to the pkg.conf(5) man page

# Configuration options
#PKG_DBDIR	    : /var/db/pkg
#PKG_CACHEDIR	    : /var/cache/pkg
#PORTSDIR	    : /usr/ports
#PUBKEY		    : /etc/ssl/pkg.conf
#HANDLE_RC_SCRIPTS  : NO
#ASSUME_ALWAYS_YES  : NO
#SYSLOG		    : YES
#SHLIBS		    : NO
#AUTODEPS	    : NO
#PORTAUDIT_SITE	    : http://portaudit.FreeBSD.org/auditfile.tbz
#PKG_PLUGINS_DIR    : /usr/local/lib/pkg/plugins
#PKG_ENABLE_PLUGINS : YES
#PLUGINS	    : [commands/mystat]
#REPO_AUTOUPDATE    : YES
ALIAS              : {
  all-depends: query %dn-%dv,
  annotations: info -A,
  build-depends: info -qd,
  download: fetch,
  iinfo: info -i -g -x,
  isearch: search -i -g -x,
  leaf: query -e "%a == 0" "%n-%v",
  leaf: query -e "%a == 0" "%n-%v",
  list: info -ql,
  origin: info -qo,
  provided-depends: info -qb,
  raw: info -R,
  required-depends: info -qr,
  shared-depends: info -qB,
  show: info -f -k,
  size: info -sq,
  }
```


----------



## kpa (Nov 27, 2013)

The /etc/pkg/FreeBSD.conf is the system provided configuration for the official package repository. You should edit that if you still get the warning about the enabled setting:


```
enabled: YES
```

The /usr/local/etc/pkg.conf.sample is a sample configuration file as the name suggests. It's copied to /usr/local/etc/pkg.conf when installing ports-mgmt/pkg if there's no /usr/local/etc/pkg.conf present. You're not supposed to have a PACKAGESITE setting anymore in pkg.conf with PKG v1.2 but use the system provided repository configurations in /etc/pkg or your own custom repositories at /usr/local/etc/pkg/repos.


----------



## tzoi516 (Nov 27, 2013)

OK, now it's odd. I put back /etc/pkg/FreeBSD.conf the original way, and used the sample file for /usr/local/etc/pkg.conf and I now get this:


```
pkg: /etc/pkg//FreeBSD.conf file is using a deprecated format. Please replace it with the following:
====== BEGIN /etc/pkg//FreeBSD.conf ======
FreeBSD : {
    url : "pkg+http://pkg.freebsd.org/${ABI}/latest",
    enabled : true,
    mirror_type : "SRV",
    signature_type : "FINGERPRINTS",
    fingerprints : "/usr/share/keys/pkg",
}

====== END /etc/pkg//FreeBSD.conf ======

Updating repository catalogue

digests.txz                                                                                                                   0%    0     0.0KB/s   0.0KB/s   --:-- ETA
digests.txz                                                                                                                  17%  170KB 170.0KB/s 170.0KB/s   00:04 ETA
digests.txz                                                                                                                  50%  480KB 184.0KB/s 310.0KB/s   00:02 ETA
digests.txz                                                                                                                  74%  710KB 188.6KB/s 230.0KB/s   00:01 ETA
digests.txz                                                                                                                 100%  948KB 237.0KB/s 238.0KB/s   00:04    
pkg: No signature found
pkg: Unable to find catalogs
```

And /etc/pkg/FreeBSD.conf is exactly like it's listed above. Not worried about the signature since I'm using a beta, but unable to find catalogs is odd.


----------



## tzoi516 (Nov 27, 2013)

I fat fingered and deleted a file. I've been searching the forums, Google, and DuckDuckGo but haven't found the answer. What is the repository URL for FreeBSD 10.0-BETA3? From what I remembered it looked like this:

```
url        : "pkg+http://pkg.freebsd.org/freebsd:10:amd64:??/????
```
Thanks.


----------



## kpa (Nov 27, 2013)

"pkg+http://pkg.freebsd.org/${ABI}/latest" is the correct one, however it won't work with PKG v1.2 until the repository has been rebuilt with the same version of pkg. There are however other problems that make the package repository unusable for 10.0-BETA versions. You'll have to wait until the problems are sorted out.


----------



## tzoi516 (Nov 27, 2013)

OK, thanks. I will say that other type of URL was working without issue until today. Guess I'll wait. Thanks again.


----------



## kpa (Nov 27, 2013)

The new version 1.2.1 of ports-mgmt/pkg is out and it should fix the biggest problems at least for those who build their own packages. I have no idea if you can use the 10.0-BETA repositories yet with this version of pkg.


----------



## jrm@ (Nov 27, 2013)

Running as root, I don't see the warning, but commands like `sudo pkg version -Ivl'<'` still display the warning shown in the first post of the thread.


----------



## tzoi516 (Nov 28, 2013)

I'm still getting the same errors about not finding the catalog.


----------



## ikbendeman (Nov 29, 2013)

*I*s anyone else getting 

```
arting check for build dependencies
===>>> Gathering dependency list for lang/gcc49 from ports
===>>> Launching child to update gcc-4.9.0.20131020_1 to gcc49-4.9.0.20131124

===>>> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20131020_1 >> gcc-4.9.0.20
```
since the new PKGNG? Unrelated: what's up with the change to phpBB? I love PHP, but I liked our forum before :\


----------



## fonz (Nov 29, 2013)

ikbendeman said:
			
		

> Unrelated: what's up with the change to phpBB? I love PHP, but I liked our forum before :/


See here perhaps?


----------



## wmoreno3 (Nov 30, 2013)

mariourk said:
			
		

> I followed the instructions I found here. It looks like that did the trick.


Hi, thank you for the link, I could fix my pkg message about "DEPRECATED"


----------



## vankooch (Dec 2, 2013)

Hi,

I've changed my pkg configuration, as mentioned. And pkg does not give me any error, but no matter what command I execute pkg is only updating, see:


```
pkg upgrade
Updating repository catalogue

pkg install zsh
Updating repository catalogue

pkg version
Updating repository catalogue

# only this works
pkg info
pkg-1.2.1                      New generation package manager
```

Is that a bug in PKGNG or am I doing something wrong? I've built a repository with poudriere including PKGNG 1.2.1 running on FreeBSD 9.2*.*

Thx Thanks.

*Update:*
Ok I found the problem. The new FreeBSD.conf needs to be under /etc/pkg/FreeBSD.conf and not under /usr/local/etc/pkg/FreeBSD.conf*.*

So now I have the new configuration running without any problems under FreeBSD 9.2*.*

pkg.conf under /usr/local/etc/pkg.cong and FreeBSD.conf under /etc/pkg/FreeBSD.conf*.*


----------



## kpa (Dec 2, 2013)

Run `pkg -vv` and see if your own repository is listed in the last lines of the output, something like in my output:


```
Repositories:
  FreeBSD: { 
    url             : "pkg+http://pkg.FreeBSD.org/freebsd:10:x86:32/latest",
    enabled         : no,
    mirror_type     : "SRV",
    signature_type  : "FINGERPRINTS",
    fingerprints    : "/usr/share/keys/pkg"
  }
  rdnzl: { 
    url             : "http://freebsd10.rdnzl.info/packages/stable10i386-default",
    enabled         : yes,
    signature_type  : "PUBKEY",
    pubkey          : "/usr/local/etc/ssl/certs/pkg.cert"
  }
```


----------



## cabriofahrer (Dec 4, 2013)

According to https://wiki.freebsd.org/pkgng the location of FreeBSD.conf is /usr/local/etc/pkg/repos/ or is it not?

Also another thing: I followed the instructions of https://wiki.freebsd.org/i386-Wine, but if I do a `pkg -vv` as described above, I only get this repository:


```
Repositories:
  FreeBSD: { 
    url             : "pkg+http://pkg.FreeBSD.org/freebsd:9:x86:64/latest",
    enabled         : yes,
    mirror_type     : "SRV"
  }
```

But I do have a wine.conf and a wine.cert in the correct path:


```
root@amd64:/usr/local/etc/pkg/repos # ls
FreeBSD.conf	wine.cert	wine.conf
root@amd64:/usr/local/etc/pkg/repos #
```

So what am I missing here?


----------



## kpa (Dec 4, 2013)

There are two directories that are searched for repository configuration files, /etc/pkg and /usr/local/etc/pkg/repos. On FreeBSD 10 the FreeBSD.conf is in /etc/pkg by default on a fresh install and is also installed there when upgrading from an earlier version to FreeBSD 10. On earlier versions of FreeBSD you have to create it yourself at /usr/local/etc/pkg/repos. Post the contents of this wine.conf file please.

Edit: If you have a /usr/local/etc/pkg.conf you should reset it to the defaults when using ports-mgmt/pkg version 1.2.1. There should be a file /usr/local/etc/pkg.conf.sample that can be copied over your own pkg.conf to reset it to defaults.


----------



## SirDice (Dec 4, 2013)

The old pkg.conf will still work but you get a lot of deprecated warnings and you may need to `pkg update` once by hand. Ideally you should remove /usr/local/etc/pkg.conf and create a /usr/local/etc/pkg/repos/myrepo.conf. It should look something like this:

```
myrepo: {
 URL: http://my.repo.server/packages/
 ENABLED: true
 MIRROR_TYPE: none
}
```

That way you can have multiple repositories.


----------



## cabriofahrer (Dec 4, 2013)

Contents and location of wine.conf:


```
$ cd /usr/local/etc/pkg/repos/
$ ls
FreeBSD.conf	wine.cert	wine.conf
$ more wine.conf
wine:
  URL:          http://ftp.freebsd.org/pub/FreeBSD/ports/local-distfiles/dbn/repos/wine/${ABI}/latest
  ENABLED:      yes
  MIRROR_TYPE:  HTTP
  PUBKEY:       /usr/local/etc/pkg/repos/wine.cert
$
```

I have also backed up my old pkg.conf and placed pkg.conf.sample in its place. It should all be fine like that, I do not get any deprecated messages anymore. But as I posted before, the additional Wine repository is not taken into consideration.


----------



## kpa (Dec 4, 2013)

The contents of the configuration file need to be enclosed in braces like this:


```
rdnzl: {
    url             : "file:///usr/local/poudriere/data/packages/stable10i386-default",
    enabled         : yes,
    signature_type  : "PUBKEY",
    pubkey          : "/usr/local/etc/ssl/certs/pkg.cert"
  }
```

Unfortunately pkg doesn't report the lack of braces as an error properly but ignores the file silently.


----------



## fonz (Dec 4, 2013)

kpa said:
			
		

> Unfortunately pkg doesn't report the lack of braces as an error properly but ignores the file silently.


That sounds like something worthy of being reported, either on the freebsd-ports@ mailing list or through a PR.


----------



## kpa (Dec 4, 2013)

https://github.com/freebsd/pkg/issues/669


----------



## cabriofahrer (Dec 4, 2013)

Well thank you so much, that was it!


----------



## fonz (Dec 4, 2013)

kpa said:
			
		

> https://github.com/freebsd/pkg/issues/669


Thanks. Surely it will be fixed soon enough, assuming _bapt_ et al. are aware of it.


----------



## jrm@ (Dec 22, 2013)

jrm said:
			
		

> Running as root, I don't see the warning, but commands like `sudo pkg version -Ivl'<'` still display the warning shown in the first post of the thread.


This was  driving me nuts.  I checked and rechecked my configuration files, but I was still getting the error about PACKAGESITE being deprecated.  Well, it turns out I had a PACKAGESITE environment variable.  After unsetting it, all is well.


----------



## lemonkey (Apr 14, 2014)

FYI, if you just installed 10.0-RELEASE, you won't be able to find any packages besides pkg until you run `pkg update`.


----------



## cb3990 (Jun 9, 2014)

Hi,
     I am facing this same issue. I was having issue with openssl ca certificates and was trying to resolve it and one of the sites asked me to setenv PACKAGESITE to setenv PACKAGESITE 
ftp://ftp2.freebsd.org/pub/FreeBSD/port ... le/Latest/ (I'm new to Unix AND FreeBSD) and then... this error. 

  I did not have pkg.cong in /usr/local/etc. I only had pkg.conf.sample I followed the steps in different forums and copied that same file to pkg.conf in the directory and copied FreeBSD.conf to /usr/local/etc/pkg/repos (I had to create /pkg/repos) and I DONOT see PACKAGESITE in any of these files but am still getting the error. I am obviously missing something here. Any suggestions?


----------



## kpa (Jun 9, 2014)

Unset PACKAGESITE in shell environment, problem solved.


----------



## royce (Jul 12, 2014)

For future searchers, note that my "PACKAGESITE is deprecated" error was hard to track down because I actually had PACKAGESITE defined as an environment variable in a forgotten shell profile!

Check both root and user profiles for wayward PACKAGESITE if you can't find it defined in any of your pkg.conf and kin.


----------

