# FreeBSD upgrade from 12 to 12.2, after incorrect hash, it start download all patches again.



## mfaridi (Jan 9, 2021)

I want to upgrade FreeBSD 12 to FreeBSD 12.1 after I run this command 



```
freebsd-update upgrade -r 12.2-RELEASE
```
it starts download 13000 patches, after download patches I see an error about hash, and in some patches, I see an error about incorrect hash and I have to start this process again, and the system start again to download 13000 patches again.
I want freebsd-update download only incorrect hash and do not start download all patches again. download all patches take times and bandwidth.
I want the freebsd-update command to keep all correct downloaded patches and only download incorrect patches.


----------



## SirDice (Jan 9, 2021)

mfaridi said:


> I want freebsd-update download only incorrect hash and do not start download all patches again. download all patches take times and bandwidth.


Downloaded patch files are cached in /var/db/freebsd-update/files. So it doesn't download them all again. It may run a check on them though.


----------



## mfaridi (Jan 9, 2021)

SirDice said:


> Downloaded patch files are cached in /var/db/freebsd-update/files. So it doesn't download them all again. It may run a check on them though.


Thanks, but after I run freebsd-update again, it starts download all of them and it counting how much files are downloading, 
after I see an error about incorrect hash it can not download 57000 files and the upgrade is failing.


----------



## mfaridi (Jan 10, 2021)

After failed freebsd-update, I run it again and I see

```
Fetching metadata signature for 12.2-RELEASE from update.FreeBSD.org... done. 
Fetching metadata index... done. 
Fetching 1 metadata patches. done. 
Applying metadata patches... done. 
Fetching 1 metadata files... done. 
Inspecting system... done. 
Fetching files from 12.0-RELEASE for merging... done. 
Preparing to download files... done. 
Fetching 12180 patches.....10....20....30....40....50....60....70....80....90....100....110....120.
```
Freebsd-update starts to get all patches again.


----------



## seabug (Jun 4, 2021)

it seems, this issue still exist. I try to upgrade a 12.1 System at my customer to 12.2.
First time it went through until it applied all the patches and downloaded 12000 files,
but now it is hanging exactly at the same stage for several times:

```
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... done.
Fetching files from 12.1-RELEASE for merging... done.
Preparing to download files... done.
Fetching 66 patches.....10....20....30....40....50....60... done.
Applying patches... done.
Fetching 6065 files... ....10....20..
...6040....6050....6060.. failed.
```
No further error message. 
Before I started the upgrade, I did freebsd-update fetch and install and I restarted the system.
Can anyone help ?


----------



## SirDice (Jun 4, 2021)

seabug said:


> it seems, this issue still exist.


No, the files are good on the servers. It's more likely that you have a dodgy internet connection. Or perhaps a company proxy that's caching broken files? I've also seen some reports from people that had an overzealous IPS that caused issues with the downloads.


----------



## seabug (Jun 24, 2021)

SirDice said:


> No, the files are good on the servers. It's more likely that you have a dodgy internet connection. Or perhaps a company proxy that's caching broken files? I've also seen some reports from people that had an overzealous IPS that caused issues with the downloads.


it seems the problem was the new firewall, the customer was playing around with. It produced a lot of very weired errors. Finally they opened all the ports for me and it is working well now.


----------



## astyle (Jun 24, 2021)

Just chiming in, but I seem to recall that the download servers actually provide a couple verification files (sha256 and md5 come to mind). Try downloading those verification files to some separate, empty folder, maybe, and then use that to  verify your downloads manually?

I know that's a lot of work, but I'd rather do that than try to clean up the mess that results from too much automation and a small error somewhere along the way that creeps in and gums up the entire works.

Oh, and I'd suggest ZFS snapshotting as an easy way to go back to pre-mess state.


----------

