$ sudo freebsd-update upgrade -r 10.2Fetching metadata signature for 10.1-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.The following components of FreeBSD seem to be installed:kernel/generic src/src world/base world/lib32The following components of FreeBSD do not seem to be installed:world/doc world/gamesDoes this look reasonable (y/n)? yFetching metadata signature for 10.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 10.1-RELEASE for merging... done.Preparing to download files... done.Fetching 1 patches. done.Applying patches... done.Fetching 4626 files... 5f019a418777cb657afa2135ec50532d4a61f8c6b1373e4e4f6b173f3aa98741 has incorrect hash.I retried it several times, but it keeps failing. In the error message, the hash itself differs. The number of files to be fetched also decreases.What do you recommend to solve the update problem?Is it possible to purge the caches? Or should I use another server (instead of the default one: update.FreeBSD.org)?
Upgrade from FreeBSD 10.1 to 10.2 fails because of incorrect hash
freebsd
The corrupt file is stored in /var/db/freebsd-update/  The files are named for their hash.  You may be able to proceed simply by deleting the file that was downloaded incorrectly, so that your next run if freebsd-update downloads it again.sudo rm /var/db/freebsd-update/5f019a418777cb657afa2135ec50532d4a61f8c6b1373e4e4f6b173f3aa98741.gzI have always found that a re-download was sufficient. In my experience, it's the download process, not the file at the mirror, which is the problem.That said, if the file is in fact corrupt on the mirror, then downloading the same file won't help, and you should try selecting a different mirror as Mark suggested.