Trying to install wget from FreeBSD repo ruined my pkg utility(my mistake). Is there a fix for this ?
-
Remove the FreeBSD repo. Then:
pkg-static install -f pkg
It should offer to downgrade to the pfSense 2.7.0 pkg version.
Steve
-
@stephenw10 Thank for the reply
Here is the log
2.7.0-RELEASE][admin@pfSense.mylab.net]/root: pkg-static install -f pkg Updating pfSense-core repository catalogue... pkg-static: An error occured while fetching package pkg-static: An error occured while fetching package repository pfSense-core has no meta file, using default settings pkg-static: An error occured while fetching package pkg-static: An error occured while fetching package Unable to update repository pfSense-core Updating pfSense repository catalogue... pkg-static: An error occured while fetching package pkg-static: An error occured while fetching package repository pfSense has no meta file, using default settings pkg-static: An error occured while fetching package pkg-static: An error occured while fetching package Unable to update repository pfSense Error updating repositories! 2.7.0-RELEASE][admin@pfSense.mylab.net]/root: pkg-static remove pkg Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: pkg: 1.20.7 Number of packages to be removed: 1 The operation will free 40 MiB. Proceed with deinstalling packages? [y/N]: y pkg-static: Cannot delete pkg itself without force flag [2.7.0-RELEASE][admin@pfSense.mylab.net]/root: pkg-static remove -f pkg Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: pkg: 1.20.7 Number of packages to be removed: 1 The operation will free 40 MiB. Proceed with deinstalling packages? [y/N]: y [1/1] Deinstalling pkg-1.20.7... [1/1] Deleting files for pkg-1.20.7: 100% You may need to manually remove /usr/local/etc/pkg.conf if it is no longer needed. [2.7.0-RELEASE][admin@pfSense.mylab.net]/root: pkg-static install -f pkg pkg-static: Command not found.
It seems that removing pkg also removed the pkg-static command
-
grrr by mistake I removed the package not the repo
What can I do now ? -
Check /var/cache/pkg. You may have one or both those packages still there and can install from the file directly using
pkg add
. Though if you have actually removed the pkg binary that's... a problem!
It's probably easier to backup the config and reinstall 2.7 clean. -
@stephenw10 thanks a lot, that worked, both versions of pkg were there
[2.7.0-RELEASE][admin@pfSense.mylab.net]/root: pkg add /var/cache/pkg/pkg-1.19.1_2.pkg Installing pkg-1.19.1_2... Extracting pkg-1.19.1_2: 100% [2.7.0-RELEASE][admin@pfSense.mylab.net]/root: pkg pkg: not enough arguments Usage: pkg [-v] [-d] [-l] [-N] [-j <jail name or id>|-c <chroot path>|-r <rootdir>] [-C <configuration file>] [-R <repo config dir>] [-o var=value] [-4|-6] <command> [<args>] For more information on available commands and options see 'pkg help'.
I hope pfsense is now back to its original files
-
-
@PF4PFS said in Trying to install wget from FreeBSD repo ruined my pkg utility(my mistake). Is there a fix for this ?:
I hope pfsense is now back to its original files
Lesson to be learned and shared with others -- do not add packages from non-Netgate repos
. This includes even the official FreeBSD repos. Doing so has a very high likelihood of breaking your pfSense installation due to changes in versions of particular binaries or shared libraries.
-
Yup if you enable the repo it will pull in any dependencies from there.
If you must do it I would download the pkgs from the FreeBSD repo and 'pkg add' them directly. If that results loads of additional dependencies being required it might be time to rethink!
-
I did read around here about people having problems after doing it but I thought wget with be rather simple :-) ..it was not :-)
-
When you run pkg it tries to update itself and right now the FreeBSD 14 repo has a significantly newer version. 1.2X has a few changes from 1.9X that you're hitting. But you should always be able to use pkg-static.