# Simple HTTP pkg Repository Config?



## dave (Dec 13, 2013)

Hi,

I have read the pkg.conf man page, the Github readme, the wiki pages, and I just can't get this to work. I have created a location on an internal server with some packages and the repository files. I want to use that location as a repository with pkg. I have a fresh install of 10 RC1 running.

```
#cat /letc/pkg/repos/FreeBSD-Local.conf
FreeBSD-Local: {
  url: pkg+http://10.1.1.7/freebsd/arm/pkgs/releng/10.0/
}
```


```
# pkg update
Updating repository catalogue
pkg: http://pkg.FreeBSD.org/freebsd:10:armv6:32:el:eabi:softfp/latest/digests.txz: Not Found
pkg: Unable to find catalogs
```

I get the same result with both pkg+http and just http.

I want to disable the use of the default pkg site (because there are no ARM packages there), and enable the HTTP location instead. Why is this so difficult? Am I missing something?

Thanks.


----------



## kpa (Dec 13, 2013)

Disable the official repo at /etc/pkg/FreeBSD.conf:


```
enabled: no
```

Do not use pkg+http on your own repositories because that implies the use of SRV DNS records to find the mirrors, use only http.


```
url: http://10.1.1.7/freebsd/arm/pkgs/releng/10.0/
```

Can you access your repository with a web browser with the URL that uses only http? If you can not you have a misconfiguration somewhere, the web server or the URL address is wrong.


----------



## dave (Dec 13, 2013)

OK, I got somewhere by disabling the default FreeBSD repository in /etc/pkg: `mv /etc/pkg/FreeBSD.conf /etc/pkg/FreeBSD.conf.old` but why should I have to remove the default repository in order to have a second?


----------



## kpa (Dec 13, 2013)

No need to remove the configuration file, just disable the repository in it. The idea is that you can use multiple repositories at the same time, that's why you are offered the possibility to have multiple repositories enabled.


----------



## kpa (Dec 13, 2013)

One thing to check if you can access the repository with a web browser is that the URL should take you directly to a directory with these entries:


```
All/
Latest/
digests.txz
packagesite.txz
```


----------



## SirDice (Dec 13, 2013)

You also need to run pkg repo /where/my/packages/are to create the catalogue files.


----------



## dave (Dec 13, 2013)

Thanks everyone.  There was no problem with my HTTP repository, I had already done all that stuff.  It worked fine after I disabled the default repository.

But this still leaves me scratching my head.



			
				kpa said:
			
		

> No need to remove the configuration file, just disable the repository in it. The idea is that you can use multiple repositories at the same time, that's why you are offered the possibility to have multiple repositories enabled.



If I can use multiple repositories at the same time, then why do I have to disable the default one in order to add another?  If there are no pkgs packages for my architecture in the default repository then should it not just fail over to the next one?


----------

