# how to restore files indicated freebsd-update IDS  ?



## tbyte (Oct 29, 2022)

After an upgrade from 11.4 to 13.1 `freebsd-update IDS` shows a lot of files that are with wrong checksums. That's fine but how to restore all those like 200+ files other than reinstalling the files ( I meant overwriting it with the contents of base.txz and not really reinstalling - I misspoke) ? Is there a way to do that automatically or the only way is by hand ?


----------



## VladiBG (Oct 29, 2022)

After upgrading the kernel and base you have to upgrade all installed pkg/ports. Read again the handbook.


----------



## tbyte (Oct 29, 2022)

VladiBG said:


> After upgrading the kernel and base you have to upgrade all installed pkg/ports. Read again the handbook.


Who's talking about the ports ? I'm using FreeBSD since 3.4 - please be constructive and don't tell me what to read.


> /usr/include/asn1_err.h has SHA256 hash 359620b51641afe4700bfd2690b2870ca70fb656c9f5ead4787cb9ea7f28d8fd, but should have SHA256 hash 5ea9ff7d8a8ab161b247ed73dce000901ca23b4d230b17dc899930a49f70fcde.
> /usr/include/cms_asn1.h has SHA256 hash 4cb806dd40594a5c96aeb4d6677cd9460e53746eb7a399a3705e755b99632afd, but should have SHA256 hash 1e20c086447a972c37ddd213aa87a370a3fe6eabc1801bfb6de0113d064df86e.
> /usr/include/crmf_asn1.h has SHA256 hash 1d4d7f68dc30a90a330f2514a3c0420cfe8c9002953ff8c0a52c04734ab2c4bb, but should have SHA256 hash 4a41cb13bfeb155cd9d5fec817e8179f19ff3c2b021161c55079c965158879a1.
> /usr/include/digest_asn1.h has SHA256 hash b5f57658230cca67ad4fdef80a2d32333f2d006ea72799351482e2943a2ddf1e, but should have SHA256 hash 24c7b72d3cefd80af19de4bf3cc8fcd2d268cec1ccf84809d22864ec75d9c250.
> ...


Do those look like they have anything to do with the ports ?


----------



## mer (Oct 29, 2022)

I don't have a direct answer for your question, but is it possible that the files are from an outdated source tree, source tree didn't get updated, old upgrade from source perhaps?


----------



## VladiBG (Oct 29, 2022)

A typical Balkan fellow citizen response 


tbyte said:


> Who's talking about the ports ?


I'm talking about the userland applications which may be installed via pkg/ports. Those files are under /usr/local . In your first post you didn't specify for which files you have mismatched checksums.
Expected mismatch checksum are only for some kernel modules and password databases or groups like /etc/group /etc/passwrd /etc/pwd.db as those files are usually modified after the installation.
When you have mismatched checksums in /usr/include then most likely you didn't finish the upgrade process from 11.4 to 13.1.  Run again freebsd-upgrade install then reboot and run it again. After that reinstall all userland applications via pkg or ports depending of your env.

In short:

`freebsd-update install
shutdown -r now
freebsd-update install
shutdown -r now
pkg bootstrap -f
freebsd-update -af
shutdown -r now
freebsd-update IDS`

All this is well explained in chapter 24 in handbook that you can find here:








						Chapter 25. Updating and Upgrading FreeBSD
					

Information about how to keep a FreeBSD system up-to-date with freebsd-update or Git, how to rebuild and reinstall the entire base system, etc




					docs.freebsd.org


----------



## tbyte (Oct 29, 2022)

VladiBG said:


> A typical Balkan fellow citizen response
> 
> I'm talking about the userland applications which may be installed via pkg/ports. Those files are under /usr/local . In your first post you didn't specify for which files you have mismatched checksums.
> Expected mismatch checksum are only for some kernel modules and password databases or groups like /etc/group /etc/passwrd /etc/pwd.db as those files are usually modified after the installation.
> ...


First of all it seems you didn't even understand the question so in your typical Balkan response you wrote a ton of stuff that have nothing to do with the specific question.
Second this is just one of like 1000 FreeBSD systems of mine. But go ahead quote me more from the holy Handbook 
Third `freebsd-update IDS` have NOTHING to do with the ports/pkgs only with the base system. It seems that you lack a basic understanding of the how FreeBSD operates.
Fourth - I appreciate it but please stop trying to help me. I'm sure there are other people who will appreciate it even more!



mer said:


> I don't have a direct answer for your question, but is it possible that the files are from an outdated source tree, source tree didn't get updated, old upgrade from source perhaps?


It was -STABLE system before that. But I don't need help top fix that system . It's a 2 min thing to fix it. What I'm asking is if there is an automatic (easier) way to do what I did by hand?
PS: I wonder how dangerous will be something like for example command like `freebsd-update restore /bin /usr/bin /usr/include` to restore whole directories ? Of course it will be very dangerous to do it on /etc for example unless there is some N/y question for every overwrite.


----------



## VladiBG (Oct 29, 2022)

tbyte said:


> It was -STABLE system before that


`freebsd-update` support only binary updates between releases. If you want to switch to 13.1-RELEASE from 11.4-STABLE you will need to build from source. After that you can use freebsd-update.


----------



## tbyte (Oct 29, 2022)

VladiBG said:


> `freebsd-update` support only binary updates between releases. If you want to switch to 13.1-RELEASE from 11.4-STABLE you will need to build from source. After that you can use freebsd-update.


Please stop  `freebsd-update --currently-running 11.4 upgrade -F -r 13.1`


----------



## VladiBG (Oct 29, 2022)

That's why you have incorrectly updated base and mismatched checksums. You need to update via source to 13.1-RELEASE.

freebsd-update(8)


> The *freebsd-update*    tool is    used to    fetch, install,    and rollback binary
> updates to    the FreeBSD base system.  Note that updates are    only available
> if    they are being built for the FreeBSD release and architecture being
> used; in particular, the FreeBSD Security Team only builds    updates    for
> ...


----------



## tbyte (Oct 29, 2022)

VladiBG said:


> That's why you have incorrectly updated base and mismatched checksums. You need to update via source to 13.1-RELEASE.
> 
> freebsd-update(8)


*I fixed that system long ago and fixing it wasn't the point of the post anyway*.
And *no *I don't have to do that  . Do you know what this is http://ftp.freebsd.org/pub/FreeBSD/releases/amd64/13.1-RELEASE/ ? You just download the base.txz and voila you have all you need to fix your system if you know what you are doing. As simple as that. I hope it will be useful to you too someday!


----------

