Solved Screwed up system

I was hoping to update php from 5.65 to 7.0 on my remote VPS FreeBSD system and lo and behold pkg updated itself to a version which is incompatible with my version of FreeBSD (10.1) which I know is out of date.

Is it possible to install a back level version of pkg?

Apparently the only thing I can do is to update FreeBSD using make buildworld and make buildkernel.... except I don't have any files under /usr/src.

What do I do?
 
This is basically why I rely on ports-mgmt/portmaster: I set it up so that whenever I install a port it'll always create a backup package first. So when things go from bad to worst I can sort it out using /usr/ports/packages/portmaster-backup.

Anyway, the main thing here is to always ensure that you're using a currently supported release on a production environment. Unless you have a backup somewhere I don't see how you could get an older version.

What you could try is checking ports-mgmt/pkg and try to build the port manually. That shouldn't give you too much problems considering the fact that the port doesn't have many dependencies:

Code:
root@macron:/usr/ports/ports-mgmt/pkg # make all-depends-list
root@macron:/usr/ports/ports-mgmt/pkg #
Hope this can help.
 
Many thanks. The problem is that pkg has been updated to 1.10.0 and when running any pkg command I get

Code:
/usr/local/lib/libpkg.so.4: Undefined symbol "openat"

ports-mgmt/pkg builds 1.9.4 but then says that it is already installed. And if I do manage to install that version at some point, won't pkgautomatically update it self?

What I think I need is to get hold of /usr/src, but I'm not sure how to do that.
 
ports-mgmt/pkg builds 1.9.4 but then says that it is already installed. And if I do manage to install that version at some point, won't pkgautomatically update it self?
Easily solved, from the directory run this: # make deinstall reinstall clean. That will fix it. And no, pkg won't magically upgrade itself. Remember: you're using FreeBSD here, not Windows 10 :D

What I think I need is to get hold of /usr/src, but I'm not sure how to do that.
That is most definitely the main thing to do here. Do not underestimate the importance of running a current OS version, especially with a live (networked) system. SirDice already showed you how you can get the current source tree above.
 
Looks like I didn't need to build kernel and world after all... I was going by other posts by people with similar problems. I took the plunge and ran freebsd-update and now am on a current release, so thanks to everyone who helped.
 
I took the plunge and ran freebsd-update and now am on a current release
To avoid possible confusion, it's a supported release. When you talk about current releases people assume you're talking about -CURRENT. Which is, by definition, never a supported version.
 
Back
Top