How to get a list of all pending security updates?












7















I need to list (not count or install) all pending security updates on an Ubuntu 14.04 system. I've read the post How to create a list of of only security updates with apt-get? and its accepted answer (apt-show-versions | grep upgradeable | grep security) does indeed give me a list.



However, that command lists 62 pending security updates. /usr/lib/update-notifier/apt-check tells me that I have 75 pending security updates, but doesn't seem to have a way to list them. How can I reconcile these two numbers? Is one of the two commands doing something other than what I want?










share|improve this question



























    7















    I need to list (not count or install) all pending security updates on an Ubuntu 14.04 system. I've read the post How to create a list of of only security updates with apt-get? and its accepted answer (apt-show-versions | grep upgradeable | grep security) does indeed give me a list.



    However, that command lists 62 pending security updates. /usr/lib/update-notifier/apt-check tells me that I have 75 pending security updates, but doesn't seem to have a way to list them. How can I reconcile these two numbers? Is one of the two commands doing something other than what I want?










    share|improve this question

























      7












      7








      7


      1






      I need to list (not count or install) all pending security updates on an Ubuntu 14.04 system. I've read the post How to create a list of of only security updates with apt-get? and its accepted answer (apt-show-versions | grep upgradeable | grep security) does indeed give me a list.



      However, that command lists 62 pending security updates. /usr/lib/update-notifier/apt-check tells me that I have 75 pending security updates, but doesn't seem to have a way to list them. How can I reconcile these two numbers? Is one of the two commands doing something other than what I want?










      share|improve this question














      I need to list (not count or install) all pending security updates on an Ubuntu 14.04 system. I've read the post How to create a list of of only security updates with apt-get? and its accepted answer (apt-show-versions | grep upgradeable | grep security) does indeed give me a list.



      However, that command lists 62 pending security updates. /usr/lib/update-notifier/apt-check tells me that I have 75 pending security updates, but doesn't seem to have a way to list them. How can I reconcile these two numbers? Is one of the two commands doing something other than what I want?







      apt updates






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 19 '16 at 17:45









      user3553031user3553031

      146116




      146116






















          4 Answers
          4






          active

          oldest

          votes


















          6














          If you are just looking to do this quickly once, instead of creating a separate repository and scripting up some automation and all that. Great if you aren't supposed to be making changes while auditing a system or whatever.



          These two commands will spit out the list. Pipe to wc -l to see how many are behind. ;-)



          grep security /etc/apt/sources.list > /tmp/security.list
          sudo apt-get upgrade -oDir::Etc::Sourcelist=/tmp/security.list -oDir::Etc::SourceParts=/some/valid/dir/false -s


          Still valid for older distros or if you have update repos off, but security on:



          sudo apt-get upgrade -s| grep ^Inst |grep Security 





          share|improve this answer


























          • why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

            – myrdd
            Jan 7 at 11:04











          • @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

            – flickerfly
            Jan 8 at 17:00













          • so the latter solution should always work, no?

            – myrdd
            Jan 9 at 8:43



















          2














          This worked for me:



          sudo unattended-upgrade --dry-run -d 2> /dev/null | awk '/Checking/ { print $2 }'





          share|improve this answer





















          • 1





            Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

            – delf
            Aug 27 '18 at 14:04



















          0














          sudo apt list --upgradable |grep "/$(lsb_release -cs)-security"


          This lists all available updates which come via the security repository.






          share|improve this answer































            0














            sudo apt-get -s --no-download dist-upgrade -V | grep "^Inst.*security.*$" | cut -d " " -f 2


            With some help from this question






            share|improve this answer








            New contributor




            lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.




















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f774805%2fhow-to-get-a-list-of-all-pending-security-updates%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              4 Answers
              4






              active

              oldest

              votes








              4 Answers
              4






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              6














              If you are just looking to do this quickly once, instead of creating a separate repository and scripting up some automation and all that. Great if you aren't supposed to be making changes while auditing a system or whatever.



              These two commands will spit out the list. Pipe to wc -l to see how many are behind. ;-)



              grep security /etc/apt/sources.list > /tmp/security.list
              sudo apt-get upgrade -oDir::Etc::Sourcelist=/tmp/security.list -oDir::Etc::SourceParts=/some/valid/dir/false -s


              Still valid for older distros or if you have update repos off, but security on:



              sudo apt-get upgrade -s| grep ^Inst |grep Security 





              share|improve this answer


























              • why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

                – myrdd
                Jan 7 at 11:04











              • @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

                – flickerfly
                Jan 8 at 17:00













              • so the latter solution should always work, no?

                – myrdd
                Jan 9 at 8:43
















              6














              If you are just looking to do this quickly once, instead of creating a separate repository and scripting up some automation and all that. Great if you aren't supposed to be making changes while auditing a system or whatever.



              These two commands will spit out the list. Pipe to wc -l to see how many are behind. ;-)



              grep security /etc/apt/sources.list > /tmp/security.list
              sudo apt-get upgrade -oDir::Etc::Sourcelist=/tmp/security.list -oDir::Etc::SourceParts=/some/valid/dir/false -s


              Still valid for older distros or if you have update repos off, but security on:



              sudo apt-get upgrade -s| grep ^Inst |grep Security 





              share|improve this answer


























              • why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

                – myrdd
                Jan 7 at 11:04











              • @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

                – flickerfly
                Jan 8 at 17:00













              • so the latter solution should always work, no?

                – myrdd
                Jan 9 at 8:43














              6












              6








              6







              If you are just looking to do this quickly once, instead of creating a separate repository and scripting up some automation and all that. Great if you aren't supposed to be making changes while auditing a system or whatever.



              These two commands will spit out the list. Pipe to wc -l to see how many are behind. ;-)



              grep security /etc/apt/sources.list > /tmp/security.list
              sudo apt-get upgrade -oDir::Etc::Sourcelist=/tmp/security.list -oDir::Etc::SourceParts=/some/valid/dir/false -s


              Still valid for older distros or if you have update repos off, but security on:



              sudo apt-get upgrade -s| grep ^Inst |grep Security 





              share|improve this answer















              If you are just looking to do this quickly once, instead of creating a separate repository and scripting up some automation and all that. Great if you aren't supposed to be making changes while auditing a system or whatever.



              These two commands will spit out the list. Pipe to wc -l to see how many are behind. ;-)



              grep security /etc/apt/sources.list > /tmp/security.list
              sudo apt-get upgrade -oDir::Etc::Sourcelist=/tmp/security.list -oDir::Etc::SourceParts=/some/valid/dir/false -s


              Still valid for older distros or if you have update repos off, but security on:



              sudo apt-get upgrade -s| grep ^Inst |grep Security 






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 20 '18 at 9:37









              Piloos

              32




              32










              answered Nov 4 '16 at 21:10









              flickerflyflickerfly

              4,78262043




              4,78262043













              • why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

                – myrdd
                Jan 7 at 11:04











              • @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

                – flickerfly
                Jan 8 at 17:00













              • so the latter solution should always work, no?

                – myrdd
                Jan 9 at 8:43



















              • why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

                – myrdd
                Jan 7 at 11:04











              • @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

                – flickerfly
                Jan 8 at 17:00













              • so the latter solution should always work, no?

                – myrdd
                Jan 9 at 8:43

















              why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

              – myrdd
              Jan 7 at 11:04





              why do you write ”Still valid for older distros or if you have update repos off, but security on“? if the piped solution does not work, maybe add the -V (-verbose-versions) option?

              – myrdd
              Jan 7 at 11:04













              @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

              – flickerfly
              Jan 8 at 17:00







              @myrdd Because the first uses features that weren't available on distros that were going out of style back in 2016. Might not be a thing anymore.

              – flickerfly
              Jan 8 at 17:00















              so the latter solution should always work, no?

              – myrdd
              Jan 9 at 8:43





              so the latter solution should always work, no?

              – myrdd
              Jan 9 at 8:43













              2














              This worked for me:



              sudo unattended-upgrade --dry-run -d 2> /dev/null | awk '/Checking/ { print $2 }'





              share|improve this answer





















              • 1





                Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

                – delf
                Aug 27 '18 at 14:04
















              2














              This worked for me:



              sudo unattended-upgrade --dry-run -d 2> /dev/null | awk '/Checking/ { print $2 }'





              share|improve this answer





















              • 1





                Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

                – delf
                Aug 27 '18 at 14:04














              2












              2








              2







              This worked for me:



              sudo unattended-upgrade --dry-run -d 2> /dev/null | awk '/Checking/ { print $2 }'





              share|improve this answer















              This worked for me:



              sudo unattended-upgrade --dry-run -d 2> /dev/null | awk '/Checking/ { print $2 }'






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 3 '17 at 12:44









              David Foerster

              27.9k1364110




              27.9k1364110










              answered Nov 3 '17 at 12:23









              Samuel JamesSamuel James

              1212




              1212








              • 1





                Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

                – delf
                Aug 27 '18 at 14:04














              • 1





                Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

                – delf
                Aug 27 '18 at 14:04








              1




              1





              Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

              – delf
              Aug 27 '18 at 14:04





              Shows all available updates, but doesnt limit to security-updates if i'm not mistaken. Still helpful.

              – delf
              Aug 27 '18 at 14:04











              0














              sudo apt list --upgradable |grep "/$(lsb_release -cs)-security"


              This lists all available updates which come via the security repository.






              share|improve this answer




























                0














                sudo apt list --upgradable |grep "/$(lsb_release -cs)-security"


                This lists all available updates which come via the security repository.






                share|improve this answer


























                  0












                  0








                  0







                  sudo apt list --upgradable |grep "/$(lsb_release -cs)-security"


                  This lists all available updates which come via the security repository.






                  share|improve this answer













                  sudo apt list --upgradable |grep "/$(lsb_release -cs)-security"


                  This lists all available updates which come via the security repository.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 30 '18 at 12:02









                  zerwaszerwas

                  3,34311618




                  3,34311618























                      0














                      sudo apt-get -s --no-download dist-upgrade -V | grep "^Inst.*security.*$" | cut -d " " -f 2


                      With some help from this question






                      share|improve this answer








                      New contributor




                      lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.

























                        0














                        sudo apt-get -s --no-download dist-upgrade -V | grep "^Inst.*security.*$" | cut -d " " -f 2


                        With some help from this question






                        share|improve this answer








                        New contributor




                        lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.























                          0












                          0








                          0







                          sudo apt-get -s --no-download dist-upgrade -V | grep "^Inst.*security.*$" | cut -d " " -f 2


                          With some help from this question






                          share|improve this answer








                          New contributor




                          lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.










                          sudo apt-get -s --no-download dist-upgrade -V | grep "^Inst.*security.*$" | cut -d " " -f 2


                          With some help from this question







                          share|improve this answer








                          New contributor




                          lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer






                          New contributor




                          lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 10 hours ago









                          lolcodelolcode

                          1013




                          1013




                          New contributor




                          lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          lolcode is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f774805%2fhow-to-get-a-list-of-all-pending-security-updates%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              香粉寮

                              GameSpot