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

    pkg update -f and pkf upgrade -f

    Scheduled Pinned Locked Moved General pfSense Questions
    23 Posts 3 Posters 2.0k 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.
    • bmeeksB
      bmeeks @kevindd992002
      last edited by

      @kevindd992002 said in pkg update -f and pkf upgrade -f:

      @bmeeks said in pkg update -f and pkf upgrade -f:

      @kevindd992002 said in pkg update -f and pkf upgrade -f:

      @bmeeks said in pkg update -f and pkf upgrade -f:

      @kevindd992002 said in pkg update -f and pkf upgrade -f:

      The next update will modify/rewrite most of the files, I understand that. What I don't understand is why the need to do a pkg upgrade -f after the upgrade. What does this accomplish?

      Ah, I understand your question a bit better now. All pkg upgrade -f does is force the pkg utility to reinstall all the concurrently installed package files whether they are "current" or not. Normally the utility will only install (or download and write files to disk) when there are newer versions posted on whatever remote repository pkg is pointed at. The "-f" flag just tells pkg to download and rewrite all of the installed package files regardless if they are already current.

      So the effect with that switch is everything pkg initially installed is installed again. This would touch all of those files and rewrite their physical content to disk.

      Yeah, I figured that that's what it will do by reading this ☺

      Now, as I understand it you also need to update the catalogue before doing an upgrade. That's where pkg update -f comes in. This says that the -f switch will force a full download of the repository. Without it, does it just do a differential download of some sort?

      Yes, it always attempts to minimize the amount of downloaded/installed data when possible. The -f switch overrides that behavior. If you are familiar with how the Linux package managers work (apt, rpm, etc.) it's the same idea. The normal behavior downloads the smallest bits possible to accomplish the task.

      pkg on FreeBSD is the equivalent of apt on Ubuntu.

      Yes, I do have a Debian system and I use apt update and apt upgrade. The only difference is that they don't have a -f switch which got me confused.

      They have a --force switch or something similar. Been a while since I've needed to use either from the command line.

      1 Reply Last reply Reply Quote 0
      • K
        kevindd992002
        last edited by

        apt-get does, but not apt. Anyway, will doing a pkg update -f do any potential damage compared to just letting its thing do without the switch?

        bmeeksB 1 Reply Last reply Reply Quote 0
        • bmeeksB
          bmeeks @kevindd992002
          last edited by bmeeks

          @kevindd992002 said in pkg update -f and pkf upgrade -f:

          apt-get does, but not apt. Anyway, will doing a pkg update -f do any potential damage compared to just letting its thing do without the switch?

          No, so long as you have not manually monkeyed with the repo.conf file and say pointed it at some other remote repository that might contain different versions of stuff. But with a stock pfSense installation there is no harm in using the -f switch other than just downloading and rewriting data that strictly does not require such.

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