# Installing packages from repositories



## Emniz (Aug 9, 2022)

I have two repositories: ftp and local. Ftp does not have all the packages and there is no way to download the missing ones. For this, a local repository was added. When installing pkg packages, strange things happen. The installer wants to install packages that are in ftp from the local, but they are not there. With ftp a similar problem. It doesn't seem to check if the package is in the given repository or not. How is it fixed?


----------



## SirDice (Aug 9, 2022)

FTP support on pkg(8) is deprecated. https://www.mail-archive.com/ports@freebsd.org/msg01261.html

Not entirely sure if it's been removed yet, I haven't used FTP for quite some time.


----------



## Emniz (Aug 9, 2022)

SirDice said:


> FTP support on pkg(8) is deprecated. https://www.mail-archive.com/ports@freebsd.org/msg01261.html
> 
> Not entirely sure if it's been removed yet, I haven't used FTP for quite some time.


Ftp works on 13.1. Packages try to install from the wrong places.


----------



## zirias@ (Aug 9, 2022)

pkg itself is installed from packages, so what matters is the pkg version, not the version of your base system.

But more important than that: What kind of repositories are these, how do you create them? (The official repositories have all packages, so it must be something different). And how does your pkg configuration look like?


----------



## Emniz (Aug 9, 2022)

zirias@ said:


> pkg itself is installed from packages, so what matters is the pkg version, not the version of your base system.
> 
> But more important than that: What kind of repositories are these, how do you create them? (The official repositories have all packages, so it must be something different). And how does your pkg configuration look like?




```
ftplocal: { 
  url: "file:///temp-ftpfs/", 
  mirror_type: NONE,
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg", 
  enabled: yes
}

local: { 
  url: "file:///mnt/Reposit/", 
  mirror_type: NONE,
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg", 
  enabled: yes
}
```

There is no way to use the internet as package downloaders. Ftp contain files and packages from the official repository. Local also. When you connect one of them, the download occurs without problems. But there is a lack of packages in both cases.


----------



## jmos (Aug 9, 2022)

Emniz said:


> The installer wants to install packages that are in ftp from the local, but they are not there.


A `pkg update` doens't help?

A repository includes a file packagesite.pkg that tells pkg which packages a repository contains, which version numbers they have etc.; Looks like you've modified your repository without updating those package informations…


----------



## SirDice (Aug 9, 2022)

ftplocal isn't an FTP repository though, not from pkg(8)'s point of view at least.

What you're looking for is probably the priority. Both repositories have the same priority. Which is likely going to cause issues. 

```
PRIORITY: integer        Set the priority of the repository.
                                           Higher values are preferred.
                                           Default: 0.
```



jmos said:


> A repository includes a file packagesite.pkg that tells pkg which packages a repository contains, which version numbers they have etc.; Looks like you've modified your repository without updating those package informations…


Yes, that needs updating too. See pkg-repo(8).


----------

