Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Pack Manager Fail to Upgrade / Un-install / Install / Re-install

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    6 Posts 3 Posters 8.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • slkamathS
      slkamath
      last edited by slkamath

      Hi All,

      Hope all are doing very good. Take care all of you.

      Sorry to say while upgrading 2.4.3 to 2.4.5 not checked any package update is available & forgot to take backup too.
      alt text

      Now couple of package upgrade is available still I can't make upgrade. It is hanging in package re-installing page.
      alt text
      alt text

      I tried using ssh - 13) Update from console & ran few shell commands but no luck.

      <pre>7) Ping host 16) Restart PHP-FPM
      8) Shell

      Enter an option: 13

      Another instance is already running... Aborting!
      pfSense - Netgate Device ID: 7783eef791997d71aaef

      *** Welcome to pfSense 2.4.5-RELEASE (amd64) on LEP2FW1 ***</pre>

      Anything can be done now? or re-installation is only the option?

      Can anyone help me to solve this invisible error?

      Few screenshots attached for your understanding.

      Thanks in advance.

      Lokesh Kamath

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by

        Hi,

        Try https://docs.netgate.com/pfsense/en/latest/install/upgrade-troubleshooting.html

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • slkamathS
          slkamath
          last edited by

          Thanks for your reply.

          I tried that before posting here.

          <pre>pkg-static clean -ay; pkg-static install -fy pkg pfSense-repo pfSense-upgrade
          Nothing to do.
          Updating pfSense-core repository catalogue...
          pfSense-core repository is up to date.
          Updating pfSense repository catalogue...
          pfSense repository is up to date.
          All repositories are up to date.
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          pkg-static: Cannot get an advisory lock on a database, it is locked by another process
          </pre>

          <pre>pkg-static upgrade -f
          Updating pfSense-core repository catalogue...
          pfSense-core repository is up to date.
          Updating pfSense repository catalogue...
          pfSense repository is up to date.
          All repositories are up to date.
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          process with pid 15653 still holds the lock
          pkg-static: Cannot get an advisory lock on a database, it is locked by another process
          </pre>

          GertjanG 1 Reply Last reply Reply Quote 0
          • GertjanG
            Gertjan @slkamath
            last edited by

            @slkamath said in Pack Manager Fail to Upgrade / Un-install / Install / Re-install:

            Nothing to do.

            More clear should be :
            Can't do.

            Because :

            @slkamath said in Pack Manager Fail to Upgrade / Un-install / Install / Re-install:

            pkg-static: Cannot get an advisory lock on a database, it is locked by another process

            A pkg-xxx instance is already running, which locks out any subsequent update processes.

            Try this :
            Reboot.
            After reboot, do not visit the GUI, go direcly to the console SSH access.
            Then use the commands from https://docs.netgate.com/pfsense/en/latest/install/upgrade-troubleshooting.html

            No "help me" PM's please. Use the forum, the community will thank you.
            Edit : and where are the logs ??

            1 Reply Last reply Reply Quote 0
            • slkamathS
              slkamath
              last edited by slkamath

              @Gertjan Thank you very much for your kind information. Much appreciated.

              My issue resolved. Can see the images in below links

              Pic 1
              Pic 2

              I have done the few things. Thanks to Joshua Smith who given the info 5 years back in the below link

              starts with https - redmine(dot)ixsystems(dot)com/issues/7599

              Quick info: this may help for someone in near future.

              Command to run in Shell Prompt:

              fstat /var/db/pkg/local.sqlite

              procstat -c (process number)

              pstree (disply if any partial listing)

              kill (process number)

              pkg upgrade -n

              after this please refer below link.

              https://docs.netgate.com/pfsense/en/latest/install/upgrade-troubleshooting.html

              Once again thanks to everyone who helped me to resolve my issue.โœŒ ๐Ÿ‘ ๐Ÿ™ ๐Ÿ˜Š ๐Ÿ˜… ๐Ÿ˜„

              Lokesh Kamath

              1 Reply Last reply Reply Quote 1
              • P
                PurpleReign
                last edited by

                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:

                1. Stop (disable) all package services to be reinstalled or updated.
                2. Open command prompt from the Diagnostics Menu item.
                3. Execute the following command to see which process has the database locked:
                  โ€œ fstat /var/db/pkg/local.sqlite โ€
                4. Confirm process is locking database by executing the following command:
                  โ€œ procstat -c (process number) โ€
                5. Look for partial listing (e.g., child processes) by executing the following command:
                  โ€œ pstree (disply if any partial listing) โ€
                6. Kill processes, starting with child processes, by executing the following command:
                  โ€œ kill (process number) โ€.
                7. Repeat steps 1 through 5 until until there are no longer any processes locking the database.
                8. Ensure that the package database directory exists by executing the following command:
                  โ€œ /bin/mkdir -p /var/db/pkg/ /root/var/db/pkg/ โ€
                9. Force an update of the package repository data by executing the following command:
                  โ€œ /usr/local/sbin/pkg-static update -f โ€
                10. 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 โ€
                11. 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 โ€
                12. 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> โ€
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post
                Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.