Is there a Yum Option that Creates an Error if a Package is Missing?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite












I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.



Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?



yum --disablerepo=* --enablerepo=myrepo --nogpgcheck 
--installroot=/var/some/place/test install
abasdfasfeafseasfeasef bash coreutils utils-linux

Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package **abasdfasfeafseasfeasef** available.
No package **utils-linux** available.

<snip>

Complete!


I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.










share|improve this question



























    up vote
    5
    down vote

    favorite












    I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.



    Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?



    yum --disablerepo=* --enablerepo=myrepo --nogpgcheck 
    --installroot=/var/some/place/test install
    abasdfasfeafseasfeasef bash coreutils utils-linux

    Loaded plugins: fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
    No package **abasdfasfeafseasfeasef** available.
    No package **utils-linux** available.

    <snip>

    Complete!


    I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.










    share|improve this question

























      up vote
      5
      down vote

      favorite









      up vote
      5
      down vote

      favorite











      I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.



      Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?



      yum --disablerepo=* --enablerepo=myrepo --nogpgcheck 
      --installroot=/var/some/place/test install
      abasdfasfeafseasfeasef bash coreutils utils-linux

      Loaded plugins: fastestmirror, langpacks
      Loading mirror speeds from cached hostfile
      No package **abasdfasfeafseasfeasef** available.
      No package **utils-linux** available.

      <snip>

      Complete!


      I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.










      share|improve this question















      I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.



      Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?



      yum --disablerepo=* --enablerepo=myrepo --nogpgcheck 
      --installroot=/var/some/place/test install
      abasdfasfeafseasfeasef bash coreutils utils-linux

      Loaded plugins: fastestmirror, langpacks
      Loading mirror speeds from cached hostfile
      No package **abasdfasfeafseasfeasef** available.
      No package **utils-linux** available.

      <snip>

      Complete!


      I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.







      yum configuration






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Oct 31 '14 at 21:36









      Anthon

      59.3k1798161




      59.3k1798161










      asked Oct 31 '14 at 21:32









      Randy

      1263




      1263




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          3
          down vote













          Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:



          yum -y install epel-release && 
          yum -y install dnf


          Then on a missing package you'll get an error:



          dnf -y install foobar
          Error: no package matched: foobar





          share|improve this answer




















          • Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
            – kbolino
            May 10 at 0:08

















          up vote
          0
          down vote













          I don't know about yum, but you can ask whether a package is installed using rpm -q my_package .... It will exit with failure status if any of the packages are missing.



          $ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
          package abasdfasfeafseasfeasef is not installed
          bash-4.1.2-9.el6_2.x86_64
          coreutils-8.4-19.el6.x86_64
          package utils-linux is not installed
          $ echo $?
          1
          $ rpm -q bash
          bash-4.1.2-9.el6_2.x86_64
          $ echo $?
          0





          share|improve this answer




















          • In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
            – Randy
            Oct 31 '14 at 21:43










          • How about rpm --root=/var/some/place/test -q ...?
            – Jander
            Oct 31 '14 at 22:06


















          up vote
          0
          down vote













          yum --setopt=skip_missing_names_on_install=False <commands-here>






          share|improve this answer








          New contributor




          NoUserException 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: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f165326%2fis-there-a-yum-option-that-creates-an-error-if-a-package-is-missing%23new-answer', 'question_page');

            );

            Post as a guest






























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            3
            down vote













            Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:



            yum -y install epel-release && 
            yum -y install dnf


            Then on a missing package you'll get an error:



            dnf -y install foobar
            Error: no package matched: foobar





            share|improve this answer




















            • Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
              – kbolino
              May 10 at 0:08














            up vote
            3
            down vote













            Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:



            yum -y install epel-release && 
            yum -y install dnf


            Then on a missing package you'll get an error:



            dnf -y install foobar
            Error: no package matched: foobar





            share|improve this answer




















            • Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
              – kbolino
              May 10 at 0:08












            up vote
            3
            down vote










            up vote
            3
            down vote









            Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:



            yum -y install epel-release && 
            yum -y install dnf


            Then on a missing package you'll get an error:



            dnf -y install foobar
            Error: no package matched: foobar





            share|improve this answer












            Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:



            yum -y install epel-release && 
            yum -y install dnf


            Then on a missing package you'll get an error:



            dnf -y install foobar
            Error: no package matched: foobar






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 5 '17 at 3:02









            ctindel

            312




            312











            • Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
              – kbolino
              May 10 at 0:08
















            • Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
              – kbolino
              May 10 at 0:08















            Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
            – kbolino
            May 10 at 0:08




            Your first snippet gives another answer on its own: just use yum -y install foo && yum -y install bar && ... -- yum install will fail if it it's given just 1 package and it can't install that package
            – kbolino
            May 10 at 0:08












            up vote
            0
            down vote













            I don't know about yum, but you can ask whether a package is installed using rpm -q my_package .... It will exit with failure status if any of the packages are missing.



            $ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
            package abasdfasfeafseasfeasef is not installed
            bash-4.1.2-9.el6_2.x86_64
            coreutils-8.4-19.el6.x86_64
            package utils-linux is not installed
            $ echo $?
            1
            $ rpm -q bash
            bash-4.1.2-9.el6_2.x86_64
            $ echo $?
            0





            share|improve this answer




















            • In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
              – Randy
              Oct 31 '14 at 21:43










            • How about rpm --root=/var/some/place/test -q ...?
              – Jander
              Oct 31 '14 at 22:06















            up vote
            0
            down vote













            I don't know about yum, but you can ask whether a package is installed using rpm -q my_package .... It will exit with failure status if any of the packages are missing.



            $ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
            package abasdfasfeafseasfeasef is not installed
            bash-4.1.2-9.el6_2.x86_64
            coreutils-8.4-19.el6.x86_64
            package utils-linux is not installed
            $ echo $?
            1
            $ rpm -q bash
            bash-4.1.2-9.el6_2.x86_64
            $ echo $?
            0





            share|improve this answer




















            • In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
              – Randy
              Oct 31 '14 at 21:43










            • How about rpm --root=/var/some/place/test -q ...?
              – Jander
              Oct 31 '14 at 22:06













            up vote
            0
            down vote










            up vote
            0
            down vote









            I don't know about yum, but you can ask whether a package is installed using rpm -q my_package .... It will exit with failure status if any of the packages are missing.



            $ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
            package abasdfasfeafseasfeasef is not installed
            bash-4.1.2-9.el6_2.x86_64
            coreutils-8.4-19.el6.x86_64
            package utils-linux is not installed
            $ echo $?
            1
            $ rpm -q bash
            bash-4.1.2-9.el6_2.x86_64
            $ echo $?
            0





            share|improve this answer












            I don't know about yum, but you can ask whether a package is installed using rpm -q my_package .... It will exit with failure status if any of the packages are missing.



            $ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
            package abasdfasfeafseasfeasef is not installed
            bash-4.1.2-9.el6_2.x86_64
            coreutils-8.4-19.el6.x86_64
            package utils-linux is not installed
            $ echo $?
            1
            $ rpm -q bash
            bash-4.1.2-9.el6_2.x86_64
            $ echo $?
            0






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 31 '14 at 21:39









            Jander

            11.3k43256




            11.3k43256











            • In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
              – Randy
              Oct 31 '14 at 21:43










            • How about rpm --root=/var/some/place/test -q ...?
              – Jander
              Oct 31 '14 at 22:06

















            • In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
              – Randy
              Oct 31 '14 at 21:43










            • How about rpm --root=/var/some/place/test -q ...?
              – Jander
              Oct 31 '14 at 22:06
















            In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
            – Randy
            Oct 31 '14 at 21:43




            In my situation, I know that the package is not installed because I am installing into a local directory (--installroot option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
            – Randy
            Oct 31 '14 at 21:43












            How about rpm --root=/var/some/place/test -q ...?
            – Jander
            Oct 31 '14 at 22:06





            How about rpm --root=/var/some/place/test -q ...?
            – Jander
            Oct 31 '14 at 22:06











            up vote
            0
            down vote













            yum --setopt=skip_missing_names_on_install=False <commands-here>






            share|improve this answer








            New contributor




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





















              up vote
              0
              down vote













              yum --setopt=skip_missing_names_on_install=False <commands-here>






              share|improve this answer








              New contributor




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



















                up vote
                0
                down vote










                up vote
                0
                down vote









                yum --setopt=skip_missing_names_on_install=False <commands-here>






                share|improve this answer








                New contributor




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









                yum --setopt=skip_missing_names_on_install=False <commands-here>







                share|improve this answer








                New contributor




                NoUserException 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




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









                answered 13 mins ago









                NoUserException

                101




                101




                New contributor




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





                New contributor





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






                NoUserException 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















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f165326%2fis-there-a-yum-option-that-creates-an-error-if-a-package-is-missing%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?