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

How to run pkg upgrade from Diagnostics → Command Prompt

General pfSense Questions
6
31
3.0k
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.
  • D
    DominikHoffmann
    last edited by Mar 5, 2024, 7:24 PM

    Today I received this notification email:

    Notifications in this message: 1
    ================================
    
    09:00:17 Some packages are part of the base system and will not show up in Package Manager. If any such updates are listed below, run `pkg upgrade` from the shell to install them:
    
    curl: 8.5.0 -> 8.6.0 [pfSense]
    unbound: 1.18.0_1 -> 1.19.1 [pfSense]
    

    My question is whether it is okay to run pkg upgrade from Diagnostics → Command Prompt. Are there potential problems this might create?

    1 Reply Last reply Reply Quote 0
    • S
      stephenw10 Netgate Administrator
      last edited by Mar 5, 2024, 10:59 PM

      Better to run it from an interactive prompt like via SSH. But if you have to you can upgrade with the -y switch like: pkg-static upgrade -y.

      Steve

      D 1 Reply Last reply Mar 6, 2024, 12:18 AM Reply Quote 1
      • D
        DominikHoffmann @stephenw10
        last edited by Mar 6, 2024, 12:18 AM

        @stephenw10 said in How to run pkg upgrade from Diagnostics → Command Prompt:

        Better to run it from an interactive prompt like via SSH. But if you have to you can upgrade with the -y switch like: pkg-static upgrade -y.

        Steve

        What is the potential downside of running the command from the GUI? Also, why do you suggest pkg-static, as opposed to pkg?

        G 1 Reply Last reply Mar 6, 2024, 6:53 AM Reply Quote 0
        • S
          stephenw10 Netgate Administrator
          last edited by stephenw10 Mar 6, 2024, 1:05 AM Mar 6, 2024, 1:02 AM

          If the install fails for some unexpected reason you will only see anything in the GUI if the command completes. Otherwise the page will just hang and eventually timeout. It's unlikely though those pkg upgrades are pretty widely used.
          But at an SSH prompt you can see any errors and abort the process.

          pkg-static is safer as it uses static linked libs so will always run. If an install has pulled in newer libs from a newer available version pkg may error out. It does it immediately and just returns an error though so it's unlikely to cause a problem when used discretely like that. The pfSense system scripts use pkg-static because when used as part of a script it will abort the script if it fails.

          D 1 Reply Last reply Mar 6, 2024, 3:35 AM Reply Quote 1
          • D
            DominikHoffmann @stephenw10
            last edited by Mar 6, 2024, 3:35 AM

            @stephenw10: Shouldn’t then the emailed notification use the png-static nomenclature, too?

            1 Reply Last reply Reply Quote 0
            • S
              stephenw10 Netgate Administrator
              last edited by Mar 6, 2024, 4:21 AM

              When you use the pkg command directly it would just safely fail. But the email says to run it from the shell not via the webgui. And I believe that is generated by a 3rd party script?

              D 1 Reply Last reply Mar 6, 2024, 4:29 AM Reply Quote 1
              • D
                DominikHoffmann @stephenw10
                last edited by Mar 6, 2024, 4:29 AM

                @stephenw10: Ah, yes! It is the script from the post by @luckman212, titled “Auto update check, checks for updates to base system + packages and sends email alerts”.

                1 Reply Last reply Reply Quote 1
                • G
                  Gertjan @DominikHoffmann
                  last edited by Mar 6, 2024, 6:53 AM

                  @DominikHoffmann said in How to run pkg upgrade from Diagnostics → Command Prompt:

                  What is the potential downside of running the command from the GUI?

                  In one word : gravity 😊
                  See it like this : you can potentially create the situation where you are sawing that tree branch while sitting on it.

                  When you receive a mail from the "luckman" script, and it announces :

                  @DominikHoffmann said in How to run pkg upgrade from Diagnostics → Command Prompt:

                  curl: 8.5.0 -> 8.6.0 [pfSense]
                  unbound: 1.18.0_1 -> 1.19.1 [pfSense]

                  Then you know why it says :

                  Some packages are part of the base system and will not show up in (pfSense GUI) Package Manager

                  as these two, unbound and curl, are system (FreeBSD) packages, NOT pfSense GUI packages, the ones that are shown here ;

                  login-to-view

                  So, this applies :

                  If any such updates are listed below, run pkg upgrade from the shell to install them

                  With 'shell' he means : console or SSH.

                  My advise : whatever happens : make sure, at any time, that you have a working console access.
                  If the console access works for you, chances are very great you might never need it.
                  The day you need console access is not the day you want to make it work first.

                  Set up SSH access, as this is the "next best" access. SSH access can be done from the same place as where you can access the GUI. So no need to crawl in front of the pfSense device with the small USB cable, or hook up a keyboard and screen to your pfSense box.

                  With SSH, when login, you see (the same) this :

                  0) Logout (SSH only)                  9) pfTop
                  1) Assign Interfaces                 10) Filter Logs
                  2) Set interface(s) IP address       11) Restart webConfigurator
                  3) Reset webConfigurator password    12) PHP shell + Netgate pfSense Plus tools
                  4) Reset to factory defaults         13) Update from console
                  5) Reboot system                     14) Disable Secure Shell (sshd)
                  6) Halt system                       15) Restore recent configuration
                  7) Ping host                         16) Restart PHP-FPM
                  8) Shell
                  
                  Enter an option:
                  

                  Use option 13 and you'll be good.

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

                  S 1 Reply Last reply Mar 6, 2024, 12:18 PM Reply Quote 1
                  • S
                    SwissSteph @Gertjan
                    last edited by SwissSteph Mar 6, 2024, 12:18 PM Mar 6, 2024, 12:18 PM

                    @Gertjan
                    I'm bouncing back on your answer, because when I connect in SSH (not with the original user "admin" but mine which also has admin rights) I don't have the menu that comes back automatically, I only have this (in my Windows system)

                    login-to-view

                    Any idea? or how to launch it manually when I'm connected via SSH?

                    Thanks for your help

                    I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                    ... And now I'm living with a Netgate 8200
                    ... And sorry for my bad English...

                    G 1 Reply Last reply Mar 6, 2024, 4:11 PM Reply Quote 0
                    • S
                      stephenw10 Netgate Administrator
                      last edited by stephenw10 Mar 6, 2024, 12:58 PM Mar 6, 2024, 12:58 PM

                      You can run /etc/rc.initial to bring up the menu. Though some options there require the admin/root user.

                      S 2 Replies Last reply Mar 6, 2024, 12:59 PM Reply Quote 0
                      • S
                        SwissSteph @stephenw10
                        last edited by Mar 6, 2024, 12:59 PM

                        @stephenw10
                        Thanks for the quick reply :-) ... it actually works for me.

                        I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                        ... And now I'm living with a Netgate 8200
                        ... And sorry for my bad English...

                        1 Reply Last reply Reply Quote 0
                        • G
                          Gertjan @SwissSteph
                          last edited by Mar 6, 2024, 4:11 PM

                          @SwissSteph said in How to run pkg upgrade from Diagnostics → Command Prompt:

                          Any idea?

                          Windows has a ssh client ? [ I even don't want to know ^^ ]

                          Yeah, go here.
                          Don't worry, the site look like the something from another centry, but it host worlds most important admn on planet earth.
                          Putty.
                          It's a the best SSH client (IMHO of course). Some extra tools come with it.

                          login-to-view

                          Run it, enter the IP of pfSense, port 22 (SSH) and save that as a favourite.
                          Then Connect.
                          The first time it will ask if you trust the device (your pfSense) : accept.
                          Done : connected.
                          Login with "root" (!) don't hassle with other created users or so, pfSense is a router firewall, not a multi user devices server type thing.
                          The password is the GUI password.

                          Later on, you'll ditch the user/password login. Real ;) admins use :

                          login-to-view

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

                          D J 2 Replies Last reply Mar 6, 2024, 4:15 PM Reply Quote 1
                          • D
                            DominikHoffmann @Gertjan
                            last edited by Mar 6, 2024, 4:15 PM

                            @Gertjan said in How to run pkg upgrade from Diagnostics → Command Prompt:

                            It's a the best SSH client (IMHO of course). Some extra tools come with it.

                            I do like macOS Terminal!

                            😁

                            N 1 Reply Last reply Mar 6, 2024, 5:02 PM Reply Quote 0
                            • N
                              NollipfSense @DominikHoffmann
                              last edited by Mar 6, 2024, 5:02 PM

                              @DominikHoffmann said in How to run pkg upgrade from Diagnostics → Command Prompt:

                              I do like macOS Terminal!

                              Me also, as well.

                              pfSense+ 23.09 Lenovo Thinkcentre M93P SFF Quadcore i7 dual Raid-ZFS 128GB-SSD 32GB-RAM PCI-Intel i350-t4 NIC, -Intel QAT 8950.
                              pfSense+ 23.09 VM-Proxmox, Dell Precision Xeon-W2155 Nvme 500GB-ZFS 128GB-RAM PCIe-Intel i350-t4, Intel QAT-8950, P-cloud.

                              G 1 Reply Last reply Mar 6, 2024, 5:22 PM Reply Quote 0
                              • G
                                Gertjan @NollipfSense
                                last edited by Mar 6, 2024, 5:22 PM

                                @NollipfSense @DominikHoffmann

                                login-to-view

                                seems very 'MSoft' to me.

                                Really, guys, I agree, but can I advise @DominikHoffmann to create a Mac clone to get access to its build in ssh 😊

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

                                S 1 Reply Last reply Mar 7, 2024, 6:06 AM Reply Quote 0
                                • S
                                  SwissSteph @Gertjan
                                  last edited by Mar 7, 2024, 6:06 AM

                                  @Gertjan
                                  yes, SSH command in a terminal session under Windows

                                  I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                                  ... And now I'm living with a Netgate 8200
                                  ... And sorry for my bad English...

                                  1 Reply Last reply Reply Quote 0
                                  • S
                                    SwissSteph @stephenw10
                                    last edited by Mar 7, 2024, 8:18 AM

                                    @stephenw10

                                    I come back to your answer and my answer where I said that this command worked (which is still the case).

                                    But why doesn't this menu appear by itself? I set the original "user" "admin" to disabled and created another "admin" with another name, is that why the menu doesn't appear by itself?

                                    I've also installed the "sudo" package, if this information helps to solve my problem.

                                    I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                                    ... And now I'm living with a Netgate 8200
                                    ... And sorry for my bad English...

                                    G 1 Reply Last reply Mar 7, 2024, 8:44 AM Reply Quote 0
                                    • G
                                      Gertjan @SwissSteph
                                      last edited by Mar 7, 2024, 8:44 AM

                                      @SwissSteph said in How to run pkg upgrade from Diagnostics → Command Prompt:

                                      But why doesn't this menu appear by itself? I set the original "user" "admin" to disabled and created another "admin" with another name, is that why the menu doesn't appear by itself?

                                      =>

                                      @stephenw10 said in How to run pkg upgrade from Diagnostics → Command Prompt:

                                      You can run /etc/rc.initial to bring up the menu. Though some options there require the admin/root user.

                                      See also : Admin Access.

                                      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
                                      • S
                                        stephenw10 Netgate Administrator
                                        last edited by Mar 7, 2024, 2:24 PM

                                        The admin user is set to use the console menu as it's shell directly. For other users you need to add it to the tcsh config. Which can now easily be done because of: https://redmine.pfsense.org/issues/14746
                                        For example when logged in as that user run: echo /etc/rc.initial >> ~/.tcshrc.local
                                        Then logout and back in.

                                        Steve

                                        S 2 Replies Last reply Mar 8, 2024, 6:06 AM Reply Quote 0
                                        • S
                                          SwissSteph @stephenw10
                                          last edited by Mar 8, 2024, 6:06 AM

                                          @stephenw10

                                          Steve,

                                          Thanks for your reply, it works perfectly!!!

                                          Have a nice day 👍

                                          I started with two "no-name" pfsense, one for use at home and the other as a backup in case of problems (which can happen when you're new to pfsense).
                                          ... And now I'm living with a Netgate 8200
                                          ... And sorry for my bad English...

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