How to find out information on an installed package

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











up vote
0
down vote

favorite












Is there a method for find out information about an installed package? Such as how it was installed such as via a package manager such as DNF, snap or compiled by the user?



Sometimes I can't remember how I installed a specific package but I always need to include this kind of information in bug reports etc. Is a tool that can provide this kind of information? If not any help in write a script to do this job would be great appreciated.







share|improve this question























    up vote
    0
    down vote

    favorite












    Is there a method for find out information about an installed package? Such as how it was installed such as via a package manager such as DNF, snap or compiled by the user?



    Sometimes I can't remember how I installed a specific package but I always need to include this kind of information in bug reports etc. Is a tool that can provide this kind of information? If not any help in write a script to do this job would be great appreciated.







    share|improve this question





















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Is there a method for find out information about an installed package? Such as how it was installed such as via a package manager such as DNF, snap or compiled by the user?



      Sometimes I can't remember how I installed a specific package but I always need to include this kind of information in bug reports etc. Is a tool that can provide this kind of information? If not any help in write a script to do this job would be great appreciated.







      share|improve this question











      Is there a method for find out information about an installed package? Such as how it was installed such as via a package manager such as DNF, snap or compiled by the user?



      Sometimes I can't remember how I installed a specific package but I always need to include this kind of information in bug reports etc. Is a tool that can provide this kind of information? If not any help in write a script to do this job would be great appreciated.









      share|improve this question










      share|improve this question




      share|improve this question









      asked Apr 19 at 11:35









      Bprodz

      558




      558




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          You need to ask whatever package manager could have been used - only the package manager stores meta-information about what packages has been installed, and which files are in the package. There's no way to get such information from a naked file.



          You didn't say what flavour of distribution you use, but I recommend always using a single package manager (apt for me), and putting stuff that is compiled by the user somewhere else (for me, /usr/local, managed with stow, and I keep a list of packages). This way it's easy to find out to which package a particular file belongs.



          If you use a dozen package managers or so (why?), you could write a script that queries each of them in turn.



          Edit



          I keep track of stuff I compiled from source by making a file for each package I compiled in /usr/local/packages/<packagename>. I need this anyway because it contains information about how I compiled it (often you need to make adjustments, fix a few things that won't compile with a newer gcc etc.) in case I need to compile it again when I upgrade it. And since I have this file, I also add information about where I downloaded the source, what version it is, what it does, what the name of the source tarball is, etc. I keep track of the installed files by installing everything into /usr/local/stow/<packagename>-<version> (which also sometimes needs adjustments to Makefiles, or ./configure --prefix, etc.), and then use stow to make links to it in /usr/local. I've described this in detail here.



          You can also make really deb or rpm packages out of stuff you compile yourself, but this is more work than keeping track of it with stow.






          share|improve this answer























          • Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
            – Bprodz
            Apr 19 at 11:57






          • 2




            This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
            – Knud Larsen
            Apr 19 at 16:30







          • 1




            And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
            – Knud Larsen
            Apr 19 at 16:35










          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%2f438706%2fhow-to-find-out-information-on-an-installed-package%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          You need to ask whatever package manager could have been used - only the package manager stores meta-information about what packages has been installed, and which files are in the package. There's no way to get such information from a naked file.



          You didn't say what flavour of distribution you use, but I recommend always using a single package manager (apt for me), and putting stuff that is compiled by the user somewhere else (for me, /usr/local, managed with stow, and I keep a list of packages). This way it's easy to find out to which package a particular file belongs.



          If you use a dozen package managers or so (why?), you could write a script that queries each of them in turn.



          Edit



          I keep track of stuff I compiled from source by making a file for each package I compiled in /usr/local/packages/<packagename>. I need this anyway because it contains information about how I compiled it (often you need to make adjustments, fix a few things that won't compile with a newer gcc etc.) in case I need to compile it again when I upgrade it. And since I have this file, I also add information about where I downloaded the source, what version it is, what it does, what the name of the source tarball is, etc. I keep track of the installed files by installing everything into /usr/local/stow/<packagename>-<version> (which also sometimes needs adjustments to Makefiles, or ./configure --prefix, etc.), and then use stow to make links to it in /usr/local. I've described this in detail here.



          You can also make really deb or rpm packages out of stuff you compile yourself, but this is more work than keeping track of it with stow.






          share|improve this answer























          • Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
            – Bprodz
            Apr 19 at 11:57






          • 2




            This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
            – Knud Larsen
            Apr 19 at 16:30







          • 1




            And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
            – Knud Larsen
            Apr 19 at 16:35














          up vote
          1
          down vote



          accepted










          You need to ask whatever package manager could have been used - only the package manager stores meta-information about what packages has been installed, and which files are in the package. There's no way to get such information from a naked file.



          You didn't say what flavour of distribution you use, but I recommend always using a single package manager (apt for me), and putting stuff that is compiled by the user somewhere else (for me, /usr/local, managed with stow, and I keep a list of packages). This way it's easy to find out to which package a particular file belongs.



          If you use a dozen package managers or so (why?), you could write a script that queries each of them in turn.



          Edit



          I keep track of stuff I compiled from source by making a file for each package I compiled in /usr/local/packages/<packagename>. I need this anyway because it contains information about how I compiled it (often you need to make adjustments, fix a few things that won't compile with a newer gcc etc.) in case I need to compile it again when I upgrade it. And since I have this file, I also add information about where I downloaded the source, what version it is, what it does, what the name of the source tarball is, etc. I keep track of the installed files by installing everything into /usr/local/stow/<packagename>-<version> (which also sometimes needs adjustments to Makefiles, or ./configure --prefix, etc.), and then use stow to make links to it in /usr/local. I've described this in detail here.



          You can also make really deb or rpm packages out of stuff you compile yourself, but this is more work than keeping track of it with stow.






          share|improve this answer























          • Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
            – Bprodz
            Apr 19 at 11:57






          • 2




            This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
            – Knud Larsen
            Apr 19 at 16:30







          • 1




            And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
            – Knud Larsen
            Apr 19 at 16:35












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          You need to ask whatever package manager could have been used - only the package manager stores meta-information about what packages has been installed, and which files are in the package. There's no way to get such information from a naked file.



          You didn't say what flavour of distribution you use, but I recommend always using a single package manager (apt for me), and putting stuff that is compiled by the user somewhere else (for me, /usr/local, managed with stow, and I keep a list of packages). This way it's easy to find out to which package a particular file belongs.



          If you use a dozen package managers or so (why?), you could write a script that queries each of them in turn.



          Edit



          I keep track of stuff I compiled from source by making a file for each package I compiled in /usr/local/packages/<packagename>. I need this anyway because it contains information about how I compiled it (often you need to make adjustments, fix a few things that won't compile with a newer gcc etc.) in case I need to compile it again when I upgrade it. And since I have this file, I also add information about where I downloaded the source, what version it is, what it does, what the name of the source tarball is, etc. I keep track of the installed files by installing everything into /usr/local/stow/<packagename>-<version> (which also sometimes needs adjustments to Makefiles, or ./configure --prefix, etc.), and then use stow to make links to it in /usr/local. I've described this in detail here.



          You can also make really deb or rpm packages out of stuff you compile yourself, but this is more work than keeping track of it with stow.






          share|improve this answer















          You need to ask whatever package manager could have been used - only the package manager stores meta-information about what packages has been installed, and which files are in the package. There's no way to get such information from a naked file.



          You didn't say what flavour of distribution you use, but I recommend always using a single package manager (apt for me), and putting stuff that is compiled by the user somewhere else (for me, /usr/local, managed with stow, and I keep a list of packages). This way it's easy to find out to which package a particular file belongs.



          If you use a dozen package managers or so (why?), you could write a script that queries each of them in turn.



          Edit



          I keep track of stuff I compiled from source by making a file for each package I compiled in /usr/local/packages/<packagename>. I need this anyway because it contains information about how I compiled it (often you need to make adjustments, fix a few things that won't compile with a newer gcc etc.) in case I need to compile it again when I upgrade it. And since I have this file, I also add information about where I downloaded the source, what version it is, what it does, what the name of the source tarball is, etc. I keep track of the installed files by installing everything into /usr/local/stow/<packagename>-<version> (which also sometimes needs adjustments to Makefiles, or ./configure --prefix, etc.), and then use stow to make links to it in /usr/local. I've described this in detail here.



          You can also make really deb or rpm packages out of stuff you compile yourself, but this is more work than keeping track of it with stow.







          share|improve this answer















          share|improve this answer



          share|improve this answer








          edited Apr 20 at 6:16


























          answered Apr 19 at 11:42









          dirkt

          14k2930




          14k2930











          • Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
            – Bprodz
            Apr 19 at 11:57






          • 2




            This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
            – Knud Larsen
            Apr 19 at 16:30







          • 1




            And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
            – Knud Larsen
            Apr 19 at 16:35
















          • Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
            – Bprodz
            Apr 19 at 11:57






          • 2




            This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
            – Knud Larsen
            Apr 19 at 16:30







          • 1




            And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
            – Knud Larsen
            Apr 19 at 16:35















          Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
          – Bprodz
          Apr 19 at 11:57




          Okay I see. Thanks for the info. I didn't mention my distros because I was looking for a 'general' solution (I use Ubuntu/apt and Fedora/dnf). I'm mainly use F27 + dnf, but where no packages are available I need to use snaps or compile from source. I perhaps I'll write a script to ask apt, dnf for info on an argument supplied on the commandline and show whether if matches were found. How do you keep track of stuff that you've complied from source? Is there any way to 'manually' add an entry to a package manager?
          – Bprodz
          Apr 19 at 11:57




          2




          2




          This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
          – Knud Larsen
          Apr 19 at 16:30





          This command will print a list with install time / with the last installed rpm package at line 1 : $ rpm -qa --last > last-packages.txt
          – Knud Larsen
          Apr 19 at 16:30





          1




          1




          And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
          – Knud Larsen
          Apr 19 at 16:35




          And similar for Ubuntu : $ ls -tl /var/lib/dpkg/info | grep list > list-deb.txt
          – Knud Larsen
          Apr 19 at 16:35












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f438706%2fhow-to-find-out-information-on-an-installed-package%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?