How to query non installed rpm file and only package name and version?












0















I have two different versions of rpm files(1.1.rpm, 2.1.rpm), so here i need to query the rpm and save the output in a text file (1.1.txt , 2.1.txt)and i need to compare both the txt file and show the difference in tabular column.



for eg:



Pkg Name                   |      1.1.txt              | 2.1.txt
-------------------------------+---------------------------+---------------------------
qq | 3.4.4. | 3.5.5
rr | 1.18.1 | 1.18.1


I tried this cmd for query



rpm -qplv file* > 1.1.txt


any idea how to do this?










share|improve this question



























    0















    I have two different versions of rpm files(1.1.rpm, 2.1.rpm), so here i need to query the rpm and save the output in a text file (1.1.txt , 2.1.txt)and i need to compare both the txt file and show the difference in tabular column.



    for eg:



    Pkg Name                   |      1.1.txt              | 2.1.txt
    -------------------------------+---------------------------+---------------------------
    qq | 3.4.4. | 3.5.5
    rr | 1.18.1 | 1.18.1


    I tried this cmd for query



    rpm -qplv file* > 1.1.txt


    any idea how to do this?










    share|improve this question

























      0












      0








      0








      I have two different versions of rpm files(1.1.rpm, 2.1.rpm), so here i need to query the rpm and save the output in a text file (1.1.txt , 2.1.txt)and i need to compare both the txt file and show the difference in tabular column.



      for eg:



      Pkg Name                   |      1.1.txt              | 2.1.txt
      -------------------------------+---------------------------+---------------------------
      qq | 3.4.4. | 3.5.5
      rr | 1.18.1 | 1.18.1


      I tried this cmd for query



      rpm -qplv file* > 1.1.txt


      any idea how to do this?










      share|improve this question














      I have two different versions of rpm files(1.1.rpm, 2.1.rpm), so here i need to query the rpm and save the output in a text file (1.1.txt , 2.1.txt)and i need to compare both the txt file and show the difference in tabular column.



      for eg:



      Pkg Name                   |      1.1.txt              | 2.1.txt
      -------------------------------+---------------------------+---------------------------
      qq | 3.4.4. | 3.5.5
      rr | 1.18.1 | 1.18.1


      I tried this cmd for query



      rpm -qplv file* > 1.1.txt


      any idea how to do this?







      shell-script






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 8 at 8:13









      Naik.Naik.

      12




      12






















          1 Answer
          1






          active

          oldest

          votes


















          3














          To obtain the name and version from an rpm package, you use the base rpm -qp along with the --queryformat option specifying the %{NAME} and %{VERSION} format specifiers. You can include the field-width modifiers (in the same manner as C printf) to provide formatting. You also want to redirect stderr to /dev/null to ignore any rpm signature errors.



          For example, to list the name and version for all rpm packages in the current directory:



          Example rpms:



          $ l1 *.rpm
          athena-jot-9.0-4.1.x86_64.rpm
          freetype2-devel-32bit-2.6.3-5.1.x86_64.rpm
          ft2demos-2.6.3-5.1.x86_64.rpm
          gtkwrite-0.1.2-2.1.x86_64.rpm
          libfreetype6-32bit-2.6.3-5.1.x86_64.rpm


          Running the command on those loose rpms provides:



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3


          To write it to your 1.1.txt file, just redirect the output, e.g.



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null > ~/tmp/1.1.txt

          $ cat ~/tmp/1.1.txt
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3





          share|improve this answer


























          • nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

            – Naik.
            Feb 8 at 9:44













          • No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

            – David C. Rankin
            Feb 8 at 9:54











          • i tried this is not helping me

            – Naik.
            Feb 11 at 17:23











          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f499421%2fhow-to-query-non-installed-rpm-file-and-only-package-name-and-version%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          3














          To obtain the name and version from an rpm package, you use the base rpm -qp along with the --queryformat option specifying the %{NAME} and %{VERSION} format specifiers. You can include the field-width modifiers (in the same manner as C printf) to provide formatting. You also want to redirect stderr to /dev/null to ignore any rpm signature errors.



          For example, to list the name and version for all rpm packages in the current directory:



          Example rpms:



          $ l1 *.rpm
          athena-jot-9.0-4.1.x86_64.rpm
          freetype2-devel-32bit-2.6.3-5.1.x86_64.rpm
          ft2demos-2.6.3-5.1.x86_64.rpm
          gtkwrite-0.1.2-2.1.x86_64.rpm
          libfreetype6-32bit-2.6.3-5.1.x86_64.rpm


          Running the command on those loose rpms provides:



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3


          To write it to your 1.1.txt file, just redirect the output, e.g.



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null > ~/tmp/1.1.txt

          $ cat ~/tmp/1.1.txt
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3





          share|improve this answer


























          • nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

            – Naik.
            Feb 8 at 9:44













          • No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

            – David C. Rankin
            Feb 8 at 9:54











          • i tried this is not helping me

            – Naik.
            Feb 11 at 17:23
















          3














          To obtain the name and version from an rpm package, you use the base rpm -qp along with the --queryformat option specifying the %{NAME} and %{VERSION} format specifiers. You can include the field-width modifiers (in the same manner as C printf) to provide formatting. You also want to redirect stderr to /dev/null to ignore any rpm signature errors.



          For example, to list the name and version for all rpm packages in the current directory:



          Example rpms:



          $ l1 *.rpm
          athena-jot-9.0-4.1.x86_64.rpm
          freetype2-devel-32bit-2.6.3-5.1.x86_64.rpm
          ft2demos-2.6.3-5.1.x86_64.rpm
          gtkwrite-0.1.2-2.1.x86_64.rpm
          libfreetype6-32bit-2.6.3-5.1.x86_64.rpm


          Running the command on those loose rpms provides:



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3


          To write it to your 1.1.txt file, just redirect the output, e.g.



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null > ~/tmp/1.1.txt

          $ cat ~/tmp/1.1.txt
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3





          share|improve this answer


























          • nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

            – Naik.
            Feb 8 at 9:44













          • No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

            – David C. Rankin
            Feb 8 at 9:54











          • i tried this is not helping me

            – Naik.
            Feb 11 at 17:23














          3












          3








          3







          To obtain the name and version from an rpm package, you use the base rpm -qp along with the --queryformat option specifying the %{NAME} and %{VERSION} format specifiers. You can include the field-width modifiers (in the same manner as C printf) to provide formatting. You also want to redirect stderr to /dev/null to ignore any rpm signature errors.



          For example, to list the name and version for all rpm packages in the current directory:



          Example rpms:



          $ l1 *.rpm
          athena-jot-9.0-4.1.x86_64.rpm
          freetype2-devel-32bit-2.6.3-5.1.x86_64.rpm
          ft2demos-2.6.3-5.1.x86_64.rpm
          gtkwrite-0.1.2-2.1.x86_64.rpm
          libfreetype6-32bit-2.6.3-5.1.x86_64.rpm


          Running the command on those loose rpms provides:



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3


          To write it to your 1.1.txt file, just redirect the output, e.g.



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null > ~/tmp/1.1.txt

          $ cat ~/tmp/1.1.txt
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3





          share|improve this answer















          To obtain the name and version from an rpm package, you use the base rpm -qp along with the --queryformat option specifying the %{NAME} and %{VERSION} format specifiers. You can include the field-width modifiers (in the same manner as C printf) to provide formatting. You also want to redirect stderr to /dev/null to ignore any rpm signature errors.



          For example, to list the name and version for all rpm packages in the current directory:



          Example rpms:



          $ l1 *.rpm
          athena-jot-9.0-4.1.x86_64.rpm
          freetype2-devel-32bit-2.6.3-5.1.x86_64.rpm
          ft2demos-2.6.3-5.1.x86_64.rpm
          gtkwrite-0.1.2-2.1.x86_64.rpm
          libfreetype6-32bit-2.6.3-5.1.x86_64.rpm


          Running the command on those loose rpms provides:



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3


          To write it to your 1.1.txt file, just redirect the output, e.g.



          $ rpm -qp --queryformat "%-24{NAME}%15{VERSION}n" *.rpm 2>/dev/null > ~/tmp/1.1.txt

          $ cat ~/tmp/1.1.txt
          athena-jot 9.0
          freetype2-devel-32bit 2.6.3
          ft2demos 2.6.3
          gtkwrite 0.1.2
          libfreetype6-32bit 2.6.3






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Feb 8 at 9:55

























          answered Feb 8 at 8:59









          David C. RankinDavid C. Rankin

          1414




          1414













          • nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

            – Naik.
            Feb 8 at 9:44













          • No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

            – David C. Rankin
            Feb 8 at 9:54











          • i tried this is not helping me

            – Naik.
            Feb 11 at 17:23



















          • nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

            – Naik.
            Feb 8 at 9:44













          • No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

            – David C. Rankin
            Feb 8 at 9:54











          • i tried this is not helping me

            – Naik.
            Feb 11 at 17:23

















          nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

          – Naik.
          Feb 8 at 9:44







          nice one, but here i did not install the rpm, so when i use this command it just print that rpm name and its version, not for the packages inside the rpm.

          – Naik.
          Feb 8 at 9:44















          No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

          – David C. Rankin
          Feb 8 at 9:54





          No need to install, you are -qp querying the package. They are just a list of rpms I have in a directory that I used for the example.

          – David C. Rankin
          Feb 8 at 9:54













          i tried this is not helping me

          – Naik.
          Feb 11 at 17:23





          i tried this is not helping me

          – Naik.
          Feb 11 at 17:23


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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%2funix.stackexchange.com%2fquestions%2f499421%2fhow-to-query-non-installed-rpm-file-and-only-package-name-and-version%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

          How to make a Squid Proxy server?

          第一次世界大戦

          Touch on Surface Book