ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Using dnf-automatic to keep Fedora up to date

    IT Discussion
    fedora dnf updates dnf-automatic fedora 26 systemd systemd timers
    10
    36
    5.8k
    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.
    • JaredBuschJ
      JaredBusch
      last edited by JaredBusch

      No sane person manually updates all of their stuff all of the time.

      In the Fedora realm, I use dnf-automatic.
      http://dnf.readthedocs.io/en/latest/automatic.html
      The below instructions are for Fedora 26 and newer as the exact name of the timer changed from what it previously was.

      Update: 2018/12/04

      As of Fedora 28 (possibly 27), the original timer and service name was implemented.

      dnf install -y dnf-automatic
      

      Now you need to edit the /etc/dnf/automatic.conf file to do what you want.
      Generally I change the following fields from their default values to this.

      apply_updates = yes
      emit_via = email
      email_from = [email protected]
      email_to = [email protected]
      email_host = your.smtp.server
      

      Optionally, edit the timer frequency. I leave it at the default of 1 day.

      nano /usr/lib/systemd/system/dnf-automatic.timer
      

      Sart and Enable the timer.

      systemctl enable --now dnf-automatic.timer
      

      You can list the time to see the status

      systemctl list-timers --all
      

      It will look like this

      NEXT                         LEFT       LAST                         PASSED       UNIT                         ACTIVATES
      Tue 2017-11-21 22:42:15 CST  52min left Tue 2017-11-21 21:42:15 CST  7min ago     dnf-makecache.timer          dnf-makecache.servi
      Wed 2017-11-22 20:47:10 CST  22h left   Tue 2017-11-21 20:47:10 CST  1h 2min ago  systemd-tmpfiles-clean.timer systemd-tmpfiles-cl
      n/a                          n/a        Tue 2017-11-21 21:47:57 CST  1min 59s ago dnf-automatic.timer  dnf-automatic.service
      n/a                          n/a        n/a                          n/a          sysstat-collect.timer        sysstat-collect.ser
      n/a                          n/a        n/a                          n/a          sysstat-summary.timer        sysstat-summary.ser
      
      5 timers listed.
      
      

      I typically reboot at this point and then check the timer again to make sure it is running as expected.

      systemctl list-timers
      NEXT                         LEFT          LAST PASSED UNIT                         ACTIVATES
      Tue 2017-11-21 22:00:00 CST  5min left     n/a  n/a    sysstat-collect.timer        sysstat-collect.service
      Tue 2017-11-21 22:04:18 CST  9min left     n/a  n/a    dnf-makecache.timer          dnf-makecache.service
      Tue 2017-11-21 22:09:18 CST  14min left    n/a  n/a    systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
      Tue 2017-11-21 22:54:18 CST  59min left    n/a  n/a    dnf-automatic.timer  dnf-automatic.service
      Wed 2017-11-22 00:07:00 CST  2h 12min left n/a  n/a    sysstat-summary.timer        sysstat-summary.service
      
      1 Reply Last reply Reply Quote 10
      • ObsolesceO
        Obsolesce
        last edited by

        Very helpful, thanks!

        1 Reply Last reply Reply Quote 0
        • BRRABillB
          BRRABill
          last edited by

          If there are no updates to install, do you still get an e-mail reporting this?

          Or only if there are updates installed?

          BRRABillB JaredBuschJ 2 Replies Last reply Reply Quote 0
          • DustinB3403D
            DustinB3403
            last edited by

            Nice guide, does this also work on the downstream forks of Fedora?

            scottalanmillerS 1 Reply Last reply Reply Quote 0
            • scottalanmillerS
              scottalanmiller @DustinB3403
              last edited by

              @dustinb3403 said in Using dnf-automatic to keep Fedora up to date:

              Nice guide, does this also work on the downstream forks of Fedora?

              As long as they use the standard DNF packages, yes.

              1 Reply Last reply Reply Quote 0
              • BRRABillB
                BRRABill @BRRABill
                last edited by

                @brrabill said in Using dnf-automatic to keep Fedora up to date:

                If there are no updates to install, do you still get an e-mail reporting this?

                Or only if there are updates installed?

                So, everything was set up properly, apparently. Because I just ran it manually again and received an e-mail.

                Have to get used to Linux, where if it doesn't say anything, it worked!

                1 Reply Last reply Reply Quote 0
                • JaredBuschJ
                  JaredBusch @BRRABill
                  last edited by

                  @brrabill said in Using dnf-automatic to keep Fedora up to date:

                  If there are no updates to install, do you still get an e-mail reporting this?

                  Or only if there are updates installed?

                  No, only when it does something.

                  1 Reply Last reply Reply Quote 0
                  • BRRABillB
                    BRRABill
                    last edited by

                    @jaredbusch

                    As others have said, but never hurts to repeat ... great writeup.

                    1 Reply Last reply Reply Quote 0
                    • JaredBuschJ
                      JaredBusch
                      last edited by

                      Guide updated to reflect timer name change back to original.

                      1 Reply Last reply Reply Quote 1
                      • DashrenderD
                        Dashrender
                        last edited by

                        I'm surprised this isn't a default setting.

                        black3dynamiteB JaredBuschJ 2 Replies Last reply Reply Quote 1
                        • JaredBuschJ
                          JaredBusch
                          last edited by JaredBusch

                          After upgrading to Fedora 29, my system was not updating regularly.

                          Looking at systemctl list-timers --all I could see the timer was there but not scheduled to run.

                          I have no idea what broke, because after researching, I found that they reintroduced the original naming, but the specific timers should have still been functioning.

                          Whatever. I removed the -install and started the original.

                          systemctl stop dnf-automatic-install.timer
                          systemctl disable dnf-automatic-install.timer
                          systemctl enable --now dnf-automatic.timer
                          
                          1 Reply Last reply Reply Quote 4
                          • black3dynamiteB
                            black3dynamite @Dashrender
                            last edited by black3dynamite

                            @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                            I'm surprised this isn't a default setting.

                            Or at least provide an option during installation.

                            @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                            After upgrading to Fedora 29, my system was not updating regularly.

                            Looking at systemctl list-timers --all I could see the timer was there but not scheduled to run.

                            I have no idea what broke, because after researhcing, I found that they reintroduced the original nameing, but the specific timers should have still been functioning.

                            Whatever. I removed the -install and started the original.

                            systemctl stop dnf-automatic-install.timer
                            systemctl disable dnf-automatic-install.timer
                            systemctl enable --now dnf-automatic.timer
                            

                            Yep, I was also experience the same thing too.

                            1 Reply Last reply Reply Quote 0
                            • JaredBuschJ
                              JaredBusch @Dashrender
                              last edited by JaredBusch

                              @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                              I'm surprised this isn't a default setting.

                              Default for who or what?

                              If you install Fedora 29 + Cinnamon desktop, there is a GUI updater installed by default.

                              DashrenderD 1 Reply Last reply Reply Quote 0
                              • DashrenderD
                                Dashrender @JaredBusch
                                last edited by

                                @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                                @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                I'm surprised this isn't a default setting.

                                Defualt for who or what?

                                If you install Fedora 29 + Cinnamon desktop, there is a GUI updater installed by default.

                                In this day and age - I more expect things to autoupdate themselves for consumers... of course Fedora... so it is really a consumer thing? Is there a difference between client and server? I think we've had that conversation before.. though I don't recall the exact output.

                                Now I'm ready for your impending /FFS

                                JaredBuschJ 1 Reply Last reply Reply Quote 0
                                • JaredBuschJ
                                  JaredBusch @Dashrender
                                  last edited by

                                  @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                  Now I'm ready for your impending /FFS

                                  :face_with_stuck-out_tongue:

                                  @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                  In this day and age - I more expect things to autoupdate themselves for consumers... of course Fedora... so it is really a consumer thing?

                                  I just said there was something installed by default on Desktop. Not this, but something.

                                  @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                  Is there a difference between client and server? I think we've had that conversation before.. though I don't recall the exact output.

                                  There is no difference. It is all in the initial install choices you make. The desktop ISO has a different installer I believe. But that doesn't change the underpinning.

                                  1 Reply Last reply Reply Quote 0
                                  • JaredBuschJ
                                    JaredBusch
                                    last edited by

                                    @Dashrender now to address auto updates for server.

                                    That also comes down to how you install.

                                    I always, 100% of the time, start from the NetInstall ISO and choose the Minimal option during install.

                                    That means there isn't jack shit setup by default.

                                    I honestly have no idea what any of the other options install.

                                    DashrenderD 1 Reply Last reply Reply Quote 0
                                    • DashrenderD
                                      Dashrender @JaredBusch
                                      last edited by

                                      @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                                      @Dashrender now to address auto updates for server.

                                      That also comes down to how you install.

                                      I always, 100% of the time, start from the NetInstall ISO and choose the Minimal option during install.

                                      That means there isn't jack shit setup by default.

                                      I honestly have no idea what any of the other options install.

                                      I wouldn't expect you to auto install updates on Server...

                                      and my expectation is only for workstations.. and since Linux OSes don't really truly have a difference, then I guess a default type setting on it is not likely... of course, as you said - it could be one of the options you mentioned..

                                      JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 0
                                      • JaredBuschJ
                                        JaredBusch @Dashrender
                                        last edited by JaredBusch

                                        @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                        @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                                        @Dashrender now to address auto updates for server.

                                        That also comes down to how you install.

                                        I always, 100% of the time, start from the NetInstall ISO and choose the Minimal option during install.

                                        That means there isn't jack shit setup by default.

                                        I honestly have no idea what any of the other options install.

                                        I wouldn't expect you to auto install updates on Server...

                                        and my expectation is only for workstations.. and since Linux OSes don't really truly have a difference, then I guess a default type setting on it is not likely... of course, as you said - it could be one of the options you mentioned..

                                        FFS The Cinnamon desktop install DOES.. I said this many times...

                                        DashrenderD 1 Reply Last reply Reply Quote 0
                                        • DashrenderD
                                          Dashrender @JaredBusch
                                          last edited by

                                          @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                                          @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                          @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                                          @Dashrender now to address auto updates for server.

                                          That also comes down to how you install.

                                          I always, 100% of the time, start from the NetInstall ISO and choose the Minimal option during install.

                                          That means there isn't jack shit setup by default.

                                          I honestly have no idea what any of the other options install.

                                          I wouldn't expect you to auto install updates on Server...

                                          and my expectation is only for workstations.. and since Linux OSes don't really truly have a difference, then I guess a default type setting on it is not likely... of course, as you said - it could be one of the options you mentioned..

                                          FFS The Cinnamon desktop install DOES.. I said this many times...

                                          I think you mentioned it gives you a GUI, nothing about it automatically setups up auto updates.

                                          1 Reply Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller @Dashrender
                                            last edited by

                                            @Dashrender said in Using dnf-automatic to keep Fedora up to date:

                                            @JaredBusch said in Using dnf-automatic to keep Fedora up to date:

                                            @Dashrender now to address auto updates for server.

                                            That also comes down to how you install.

                                            I always, 100% of the time, start from the NetInstall ISO and choose the Minimal option during install.

                                            That means there isn't jack shit setup by default.

                                            I honestly have no idea what any of the other options install.

                                            I wouldn't expect you to auto install updates on Server...

                                            What? Why not? I sure would. You'd need a pretty good reason to avoid updates at their most critical spot.

                                            DustinB3403D JaredBuschJ 2 Replies Last reply Reply Quote 2
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post