# pkg upgrade "Not found" (looking for wrong version)



## usdmatt (Oct 22, 2018)

Posting a question for once...

I have a system which was running 11.1 which I thought I'd update. At first I just wanted to make sure all the software was up to date so ran `pkg upgrade`. Unfortunately it's producing the following error -


```
pkg: http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly/All/sqlite3-3.24.0_1.txz: Not Found
```

Looking on the pkg server, it appears the version in the quarterly branch is 3.25.1. Running the update on another server works fine. Somehow it seems this server has the wrong version listed in the metadata, and I'm not sure how to fix it.

I upgraded to 11.2 just in case that had an effect (needed to do this anyway), and I've also ran `pkg clean`, although I think that's more to do with downloaded package files than the package metadata itself.

Anyone know how I've managed to end up with pkg trying to install a version it doesn't have, or what I can do to fix it?


----------



## ShelLuser (Oct 22, 2018)

So you recently tried this on FreeBSD version 11.1, right?  Then the answer is simple: that version has been EOL for a few months which means that you will no longer be able to update the ports and I suspect the same to apply to the binary repository.

Once you upgraded to 11.2 you should no longer have this problem.

(Edit): I base this conclusion on the contents of /etc/pkg/FreeBSD.conf, in specific this line:

```
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
```
(note: quarterly or latest doesn't matter within this context)


----------



## SirDice (Oct 22, 2018)

usdmatt said:


> Anyone know how I've managed to end up with pkg trying to install a version it doesn't have, or what I can do to fix it?


Your locally cached repository info is probably out of sync, try `pkg update -f`.


----------



## usdmatt (Oct 22, 2018)

> Your locally cached repository info is probably out of sync, try pkg update -f.



Thanks SirDice, that's what I needed to force it to re-download the metadata.


----------



## SirDice (Oct 22, 2018)

ShelLuser said:


> I base this conclusion on the contents of /etc/pkg/FreeBSD.conf, in specific this line:


The $ABI string is the same for 11.1 and 11.2, both are "FreeBSD:11:amd64" and would therefor point to the same repository.


----------



## ikbendeman (Oct 29, 2018)

I had a similar issue recently, due to library versioning after upgrading base from source. I solved it by:
`pkg delete -f pkg && cd /usr/ports/ports-mgmt/pkg && make install clean`
I actually ran pkg delete -af but neither here nor there..
You could also try `cd /usr/ports/ports-mgmt/pkg && make reinstall clean`


----------



## SirDice (Oct 29, 2018)

ikbendeman said:


> I had a similar issue recently, due to library versioning after upgrading base from source.


The proper way would be:

```
pkg-static install -f pkg
pkg upgrade -f
```


----------



## ikbendeman (Oct 29, 2018)

I tried this, but alas pkg wouldn't run at first; after I did a make deinstall, even the auto download/install of pkg still had errors, but after that it would at least delete itself... anyways, compiling from ports worked for me... I don't tend to use binary management, anyways... but thanks for the heads up, could be handy in a VM. Also, long time, no see.


----------



## SirDice (Oct 29, 2018)

ikbendeman said:


> but alas pkg wouldn't run at first


That's why pkg-static(8) exists.


----------



## ikbendeman (Oct 29, 2018)

I'll man it at somepoint... I've been using portmaster pretty much exclusively since FreeBSD 7.0


----------

