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

    How to clear, reset or Delete Squid Config?

    Scheduled Pinned Locked Moved pfSense Packages
    5 Posts 3 Posters 20.3k 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.
    • U
      ubit
      last edited by

      anyone can help me to delete the Squid 3 configuration….
      my squid 3 proxy/cache was not working so i remove the package from System->Package Manager i need to install squid 2 but the old settings from Squid 3 still there and do not let me config Squid 2 as it should...
      any idea how to Delete, Clear o Reset that settings?

      1 Reply Last reply Reply Quote 0
      • KOMK
        KOM
        last edited by

        SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

        Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          @KOM:

          SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

          Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

          The settings are in config.xml, not there, so you can remove "/usr/local/pkg/squid*". If you want to reinstall the packages after, make sure to reinstall squid first before trying to reinstall squidGuard.

          As for the settings, if you want to remove those, try this from Diagnostics > Command in the PHP Execute box:

          $squid_sections = array("squid", "squidnac", "squidcache", "squidauth", "squidextauth", "squidtraffic", "squidupstream", "squidusers");
          foreach ($squid_sections as $sec) {
          	if (is_array($config['installedpackages'][$sec]))
          		unset($config['installedpackages'][$sec]);
          }
          write_config("Removed Squid");
          
          

          Or to remove squid, squidguard, lightsquid, and anything else with 'squid' in its package name:

          foreach (array_keys($config['installedpackages']) as $sec) {
          	if (strpos($sec, "squid") !== false)
          		unset($config['installedpackages'][$sec]);
          }
          write_config("Removed all squid-related settings");
          
          

          Not perfect but it should get the job done.

          Either that, or backup the config, edit the settings out, then restore.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 1
          • U
            ubit
            last edited by

            @KOM:

            SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

            Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

            Thank you!!

            1 Reply Last reply Reply Quote 0
            • U
              ubit
              last edited by

              @jimp:

              @KOM:

              SSH in and delete /var/squid, /usr/local/pkg/squid.* and /usr/local/pkg/squid_.

              Don't delete /usr/local/pkg/squid* or you will lose your Squidguard settings, if it's installed.

              The settings are in config.xml, not there, so you can remove "/usr/local/pkg/squid*". If you want to reinstall the packages after, make sure to reinstall squid first before trying to reinstall squidGuard.

              As for the settings, if you want to remove those, try this from Diagnostics > Command in the PHP Execute box:

              $squid_sections = array("squid", "squidnac", "squidcache", "squidauth", "squidextauth", "squidtraffic", "squidupstream", "squidusers");
              foreach ($squid_sections as $sec) {
              	if (is_array($config['installedpackages'][$sec]))
              		unset($config['installedpackages'][$sec]);
              }
              write_config("Removed Squid");
              
              

              Or to remove squid, squidguard, lightsquid, and anything else with 'squid' in its package name:

              foreach (array_keys($config['installedpackages']) as $sec) {
              	if (strpos($sec, "squid") !== false)
              		unset($config['installedpackages'][$sec]);
              }
              write_config("Removed all squid-related settings");
              
              

              Not perfect but it should get the job done.

              Either that, or backup the config, edit the settings out, then restore.

              it works! thanks a lot!

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.