# How to fix "pkg.conf no longer supported"?



## mukund.swaminathan (Mar 1, 2015)

I am using GHOST-BSD and I tried installing www/chromium from the ports but i get this error, so i tried installing VLC media player but it shows the same error.  How _do I _fix this error?

```
root@ghostbsd ~# pkg install chromium
pkg: PACKAGESITE in pkg.conf is no longer supported.  Convert to the new repository style.  See pkg.conf(5)
pkg: Cannot parse configuration file!
root@ghostbsd ~# pkg install vlc
pkg: PACKAGESITE in pkg.conf is no longer supported.  Convert to the new repository style.  See pkg.conf(5)
pkg: Cannot parse configuration file!
root@ghostbsd ~#
```


----------



## hukadan (Mar 1, 2015)

Hi,
PACKAGESITE was a variable used to store the repository address (see here). I guess you still have this variable defined in your pkg.conf file. According to Thread solved-pkg-update-failure.48287, you should remove this line from your pkg.conf file. You have all the information needed in pkg.conf(5) in order to set your repository properly (see *REPOSITORY CONFIGURATION* section).


----------



## kpa (Mar 1, 2015)

The easiest way to solve this problem is to remove /usr/local/etc/pkg.conf completely and let ports-mgmt/pkg to use the defaults for all settings that should be correct for most users.

`# rm /usr/local/etc/pkg.conf`


----------



## mukund.swaminathan (Mar 1, 2015)

hukadan said:


> Hi,
> PACKAGESITE was a variable used to store the repository address (see here). I guess you still have this variable defined in your pkg.conf file. According to Thread solved-pkg-update-failure.48287, you should remove this line from your pkg.conf file. You have all the information needed in pkg.conf(5) in order to set your repository properly (see *REPOSITORY CONFIGURATION* section).


When I tried `rm /usr/local/etc/pkg.conf`. It removed it (I think so ) but when I try installing Chromium and VLC it says this:

```
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
root@ghostbsd ~# pkg install chromium
No active remote repositories configured.
root@ghostbsd ~# pkg install vlc
No active remote repositories configured.
root@ghostbsd ~#
```


----------



## hukadan (Mar 1, 2015)

As stated in the pkg.conf(5), you have to setup a repository. What are the results of `ls /etc/pkg /usr/local/etc/pkg/repos` ?

Quoting pkg.conf(5) :


> To use a repository you will need at least one repository configuration
> file.
> 
> Repository configuration files are searched for in order of the directo-
> ...


----------



## mukund.swaminathan (Mar 1, 2015)

hukadan said:


> As stated in the pkg.conf(5), you have to setup a repository. What are the results of `ls /etc/pkg /usr/local/etc/pkg/repos` ?
> 
> Quoting pkg.conf(5) :


It is not there the file does not exist.
Here the error:

```
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
root@ghostbsd ~#  ls /etc/pkg /usr/local/etc/pkg/repos
ls: /etc/pkg: No such file or directory
ls: /usr/local/etc/pkg/repos: No such file or directory
root@ghostbsd ~#
```

I think since I'm using GHOST-BSD some files are missing I guess. I ran a command and is shows that there is no portmaster file present. Here the result of it. I think you should take a look.


```
root@ghostbsd /u/ports# ls
distfiles packages
root@ghostbsd /u/ports#
```


----------



## hukadan (Mar 1, 2015)

Ok. That's weird. So, create the pkg(8) folder with `mkdir -p /etc/pkg`, and create a FreeBSD.conf file in it with the following content :

```
# $FreeBSD: releng/10.1/etc/pkg/FreeBSD.conf 263938 2014-03-30 15:29:54Z bdrewery $
#
# To disable this repository, instead of modifying or removing this file,
# create a /usr/local/etc/pkg/repos/FreeBSD.conf file:
#
#  mkdir -p /usr/local/etc/pkg/repos
#  echo "FreeBSD: { enabled: no }" > /usr/local/etc/pkg/repos/FreeBSD.conf
#
FreeBSD: {
  url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}
```
I left all the comments since they can be useful if you plan to have a custom configuration file in the /usr/local/etc/pkg/repos/ folder.

Then, try `pkg update`. I am not a GhostBSD user myself, so I do not know if you have a specific url to choose.


----------



## mukund.swaminathan (Mar 1, 2015)

I created the file and put it in /usr/local/etc/pkg/repos/ and then did the update, I think it does not work. Here:

```
root@ghostbsd ~# pkg update
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%  968 B  1.0kB/s  00:01  
pkg: Error loading trusted certificates
pkg: repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: 100%  5 MiB 183.7kB/s  00:29  
pkg: Error loading trusted certificates
pkg: Unable to update repository FreeBSD
root@ghostbsd ~#
```


----------



## hukadan (Mar 1, 2015)

> pkg: Error loading trusted certificates


I guess this is because you do not have the keys in /usr/share/keys/pkg. Have look at Thread solved-pkg-keys-thanks-pkubaj.44370 (also note the remark of kpa in that thread concerning mergemaster(8) if it can be applied to GhostBSD), may be the solution proposed could work for you.


----------



## junovitch@ (Mar 2, 2015)

All supported FreeBSD releases gained support for the official package repositories with this errata notice early 2014.  FreeBSD 10.x came with this supported out of the box.
https://www.freebsd.org/security/advisories/FreeBSD-EN-14:03.pkg.asc

PACKAGESITE was deprecated in ports-mgmt/pkg version 1.2 released in November 2013.
https://svnweb.freebsd.org/ports/he...le?revision=334937&view=markup&pathrev=334937

Your system is most likely very out of date.  Which version of FreeBSD are you using and what does `pkg -v` return?  You should start with using freebsd-update(8) to update to the latest version then you will be able to safely `pkg update` after from the public package repository.


----------



## rtwingfield (Dec 11, 2015)

kpa said:


> The easiest way to solve this problem is to remove /usr/local/etc/pkg.conf completely and let ports-mgmt/pkg to use the defaults for all settings that should be correct for most users.
> 
> `# rm /usr/local/etc/pkg.conf`



This worked for me following an upgrade from FreeBSD v9.1 thru v9.2 to 10.2.

From /usr/ports/devel/pkgconf 
I ran `# make reinstall`.  The pkg.conf file was recreated and the port successfully reinstalled.


----------



## SirDice (Dec 16, 2015)

rtwingfield said:


> From /usr/ports/devel/pkgconf
> I ran `# make reinstall`.  The pkg.conf file was recreated and the port successfully reinstalled.


That port has nothing to do with ports-mgmt/pkg or /usr/local/etc/pkg.conf. It's more likely that reinstalling devel/pkgconf actually updated and reinstalled port-mgmt/pkg in the process.


----------



## kpa (Dec 16, 2015)

SirDice said:


> That port has nothing to do with ports-mgmt/pkg or /usr/local/etc/pkg.conf. It's more likely that reinstalling devel/pkgconf actually updated and reinstalled port-mgmt/pkg in the process.



That's exactly what happened since ports-mgmt/pkg is forced to be a build dependency for all ports. Launching a build of any port will first check for the need to rebuild ports-mgmt/pkg.


----------

