Hi all,
I've run into this problem as well and appreciate the suggested fixes. The fixes suggested, by themselves, however did not fix my package hang problem. I was, however, able to find additional information, when augmented to these fixes, solved the hang problem in package manager. The root of the problem for me was that everytime I restored a backup configuration, the package manager would hang when trying to reinstall or update packages. The cause of the problem was due to a known problem with the squid package. Unless the squid service is stopped (disabled) prior to a package reinstall, the package manager will hang on a squid reinstall. My guess is that squid may not be the only package service where this may happen. To fix the problem, I performed the following steps:
Stop (disable) all package services to be reinstalled or updated.
Open command prompt from the Diagnostics Menu item.
Execute the following command to see which process has the database locked:
“ fstat /var/db/pkg/local.sqlite ”
Confirm process is locking database by executing the following command:
“ procstat -c (process number) ”
Look for partial listing (e.g., child processes) by executing the following command:
“ pstree (disply if any partial listing) ”
Kill processes, starting with child processes, by executing the following command:
“ kill (process number) ”.
Repeat steps 1 through 5 until until there are no longer any processes locking the database.
Ensure that the package database directory exists by executing the following command:
“ /bin/mkdir -p /var/db/pkg/ /root/var/db/pkg/ ”
Force an update of the package repository data by executing the following command:
“ /usr/local/sbin/pkg-static update -f ”
Force a reinstall of the pfSense® base package and kernel by executing the following command:
“ /usr/local/sbin/pkg-static install -yf pkg pfSense pfSense-kernel-pfSense ”
Refresh the php.ini and other files to ensure they are loading the correct modules by executing the following command:
“ /etc/rc.php_ini_setup ”
If any additional packages were installed, reinstall them manually using the GUI if possible, or by using pkg-static install from the command line using the following command:
“ /usr/local/sbin/pkg-static install -yf <additional-package> <another-additional-package> ”