Debian: get package name for installed file

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











up vote
3
down vote

favorite












I'm connected via SSH to a PC running Linux kernel 3.11.1:



root@alix:~# uname -r
3.11.1


how can I find out which package installed this specific file or kernel version respectively?



I tried



root@alix:/boot# dpkg -S vmlinuz-3.11.1 
dpkg-query: no path found matching pattern *vmlinuz-3.11.1*


Other installed kernel versions can be found with dpkg -S:



root@alix:/boot# dpkg -S vmlinuz-3.2.23
linux-image-3.2.23-ath5kmod: /boot/vmlinuz-3.2.23-ath5kmod


My purpose: I would like to install the corresponding Linux headers for version 3.11.1 to compile a kernel module for it. apt-cache search linux-headers lists 15 different header versions but not that one for 3.11.1.



Thank you very much.










share|improve this question

























    up vote
    3
    down vote

    favorite












    I'm connected via SSH to a PC running Linux kernel 3.11.1:



    root@alix:~# uname -r
    3.11.1


    how can I find out which package installed this specific file or kernel version respectively?



    I tried



    root@alix:/boot# dpkg -S vmlinuz-3.11.1 
    dpkg-query: no path found matching pattern *vmlinuz-3.11.1*


    Other installed kernel versions can be found with dpkg -S:



    root@alix:/boot# dpkg -S vmlinuz-3.2.23
    linux-image-3.2.23-ath5kmod: /boot/vmlinuz-3.2.23-ath5kmod


    My purpose: I would like to install the corresponding Linux headers for version 3.11.1 to compile a kernel module for it. apt-cache search linux-headers lists 15 different header versions but not that one for 3.11.1.



    Thank you very much.










    share|improve this question























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I'm connected via SSH to a PC running Linux kernel 3.11.1:



      root@alix:~# uname -r
      3.11.1


      how can I find out which package installed this specific file or kernel version respectively?



      I tried



      root@alix:/boot# dpkg -S vmlinuz-3.11.1 
      dpkg-query: no path found matching pattern *vmlinuz-3.11.1*


      Other installed kernel versions can be found with dpkg -S:



      root@alix:/boot# dpkg -S vmlinuz-3.2.23
      linux-image-3.2.23-ath5kmod: /boot/vmlinuz-3.2.23-ath5kmod


      My purpose: I would like to install the corresponding Linux headers for version 3.11.1 to compile a kernel module for it. apt-cache search linux-headers lists 15 different header versions but not that one for 3.11.1.



      Thank you very much.










      share|improve this question













      I'm connected via SSH to a PC running Linux kernel 3.11.1:



      root@alix:~# uname -r
      3.11.1


      how can I find out which package installed this specific file or kernel version respectively?



      I tried



      root@alix:/boot# dpkg -S vmlinuz-3.11.1 
      dpkg-query: no path found matching pattern *vmlinuz-3.11.1*


      Other installed kernel versions can be found with dpkg -S:



      root@alix:/boot# dpkg -S vmlinuz-3.2.23
      linux-image-3.2.23-ath5kmod: /boot/vmlinuz-3.2.23-ath5kmod


      My purpose: I would like to install the corresponding Linux headers for version 3.11.1 to compile a kernel module for it. apt-cache search linux-headers lists 15 different header versions but not that one for 3.11.1.



      Thank you very much.







      debian kernel dpkg header-file






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 17 '14 at 11:06









      Benedikt

      183




      183




















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          3
          down vote



          accepted










          You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages



          dpkg -l | grep 'linux-image'
          dpkg -l | grep 'linux-image' | grep '3.11'


          To find the kernel headers package for your running kernel:



          apt-cache search linux-headers-`uname -r`





          share|improve this answer






















          • I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
            – Benedikt
            Jun 17 '14 at 11:13











          • Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
            – Creek
            Jun 17 '14 at 11:22











          • The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
            – Benedikt
            Jun 17 '14 at 11:25











          • I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
            – Benedikt
            Jun 17 '14 at 11:30










          • Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
            – Creek
            Jun 17 '14 at 11:34

















          up vote
          0
          down vote













          My original problem was that there were no appropriate kernel headers available for the currently installed Linux kernel (3.11.1).



          Finally, I solved this issue in four steps:



          1. Removed the kernels which were installed via apt-get.


          2. Removed custom kernels:



            • /boot/vmlinuz*KERNEL-VERSION*

            • /boot/initrd*KERNEL-VERSION*

            • /boot/System-map*KERNEL-VERSION*

            • /boot/config-KERNEL-VERSION

            • /lib/modules/KERNEL-VERSION/

            • See here for a detailed description.


          3. Installed kernel and corresponding headers which are shipped per default by package manager apt-get (it's version 3.2.0-4-486).


          4. Update grub via update-grub.

          Now, I can compile and use the required Linux kernel module. Thanks Creek to point me in the right direction. :)






          share|improve this answer



























            up vote
            0
            down vote













            Use dlocate(1) command from dlocate package:



            $ dlocate /boot/vmlinuz-*
            linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64
            linux-image-4.9.0-7-amd64: /boot/vmlinuz-4.9.0-7-amd64


            dlocate takes file name as an argument and returns name of the package that owns/provides given file.






            share|improve this answer





























              up vote
              0
              down vote













              apt-get install linux-headers should get you the headers for all installed kernels






              share|improve this answer




















                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%2f137590%2fdebian-get-package-name-for-installed-file%23new-answer', 'question_page');

                );

                Post as a guest






























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                3
                down vote



                accepted










                You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages



                dpkg -l | grep 'linux-image'
                dpkg -l | grep 'linux-image' | grep '3.11'


                To find the kernel headers package for your running kernel:



                apt-cache search linux-headers-`uname -r`





                share|improve this answer






















                • I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
                  – Benedikt
                  Jun 17 '14 at 11:13











                • Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
                  – Creek
                  Jun 17 '14 at 11:22











                • The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
                  – Benedikt
                  Jun 17 '14 at 11:25











                • I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
                  – Benedikt
                  Jun 17 '14 at 11:30










                • Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
                  – Creek
                  Jun 17 '14 at 11:34














                up vote
                3
                down vote



                accepted










                You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages



                dpkg -l | grep 'linux-image'
                dpkg -l | grep 'linux-image' | grep '3.11'


                To find the kernel headers package for your running kernel:



                apt-cache search linux-headers-`uname -r`





                share|improve this answer






















                • I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
                  – Benedikt
                  Jun 17 '14 at 11:13











                • Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
                  – Creek
                  Jun 17 '14 at 11:22











                • The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
                  – Benedikt
                  Jun 17 '14 at 11:25











                • I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
                  – Benedikt
                  Jun 17 '14 at 11:30










                • Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
                  – Creek
                  Jun 17 '14 at 11:34












                up vote
                3
                down vote



                accepted







                up vote
                3
                down vote



                accepted






                You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages



                dpkg -l | grep 'linux-image'
                dpkg -l | grep 'linux-image' | grep '3.11'


                To find the kernel headers package for your running kernel:



                apt-cache search linux-headers-`uname -r`





                share|improve this answer














                You can list every installed package with dpkg -l and filter through the results with grep for the kernel packages



                dpkg -l | grep 'linux-image'
                dpkg -l | grep 'linux-image' | grep '3.11'


                To find the kernel headers package for your running kernel:



                apt-cache search linux-headers-`uname -r`






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Jun 17 '14 at 11:19

























                answered Jun 17 '14 at 11:08









                Creek

                3,56611127




                3,56611127











                • I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
                  – Benedikt
                  Jun 17 '14 at 11:13











                • Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
                  – Creek
                  Jun 17 '14 at 11:22











                • The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
                  – Benedikt
                  Jun 17 '14 at 11:25











                • I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
                  – Benedikt
                  Jun 17 '14 at 11:30










                • Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
                  – Creek
                  Jun 17 '14 at 11:34
















                • I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
                  – Benedikt
                  Jun 17 '14 at 11:13











                • Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
                  – Creek
                  Jun 17 '14 at 11:22











                • The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
                  – Benedikt
                  Jun 17 '14 at 11:25











                • I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
                  – Benedikt
                  Jun 17 '14 at 11:30










                • Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
                  – Creek
                  Jun 17 '14 at 11:34















                I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
                – Benedikt
                Jun 17 '14 at 11:13





                I tried that before. dpkg -l | grep "linux-image" lists the following packages: linux-image-3.2.0-3-486, linux-image-3.2.23, linux-image-3.2.23-ath5kmod, 3.2.23-ath5kmod-10.00.Custom, linux-image-486 But package for kernel 3.11.1 is missing. Therefore, I'm slightly confused.
                – Benedikt
                Jun 17 '14 at 11:13













                Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
                – Creek
                Jun 17 '14 at 11:22





                Not sure why the package isn't coming up. See my updated answer to find the headers for your running kernel
                – Creek
                Jun 17 '14 at 11:22













                The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
                – Benedikt
                Jun 17 '14 at 11:25





                The problem is that there is also no correct header for the version 3.11.1. Is a "meta-package" responsible for installing the kernel version 3.11.1? For instance, "linux-image-486" is listed as meta-package.
                – Benedikt
                Jun 17 '14 at 11:25













                I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
                – Benedikt
                Jun 17 '14 at 11:30




                I guess this PC is pretty misconfigured and now I have to clean up this mess. :(
                – Benedikt
                Jun 17 '14 at 11:30












                Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
                – Creek
                Jun 17 '14 at 11:34




                Here's a link for installing the deb packages for 3.11.1, but I would personally stick with a kernel that's supported by the package manager
                – Creek
                Jun 17 '14 at 11:34












                up vote
                0
                down vote













                My original problem was that there were no appropriate kernel headers available for the currently installed Linux kernel (3.11.1).



                Finally, I solved this issue in four steps:



                1. Removed the kernels which were installed via apt-get.


                2. Removed custom kernels:



                  • /boot/vmlinuz*KERNEL-VERSION*

                  • /boot/initrd*KERNEL-VERSION*

                  • /boot/System-map*KERNEL-VERSION*

                  • /boot/config-KERNEL-VERSION

                  • /lib/modules/KERNEL-VERSION/

                  • See here for a detailed description.


                3. Installed kernel and corresponding headers which are shipped per default by package manager apt-get (it's version 3.2.0-4-486).


                4. Update grub via update-grub.

                Now, I can compile and use the required Linux kernel module. Thanks Creek to point me in the right direction. :)






                share|improve this answer
























                  up vote
                  0
                  down vote













                  My original problem was that there were no appropriate kernel headers available for the currently installed Linux kernel (3.11.1).



                  Finally, I solved this issue in four steps:



                  1. Removed the kernels which were installed via apt-get.


                  2. Removed custom kernels:



                    • /boot/vmlinuz*KERNEL-VERSION*

                    • /boot/initrd*KERNEL-VERSION*

                    • /boot/System-map*KERNEL-VERSION*

                    • /boot/config-KERNEL-VERSION

                    • /lib/modules/KERNEL-VERSION/

                    • See here for a detailed description.


                  3. Installed kernel and corresponding headers which are shipped per default by package manager apt-get (it's version 3.2.0-4-486).


                  4. Update grub via update-grub.

                  Now, I can compile and use the required Linux kernel module. Thanks Creek to point me in the right direction. :)






                  share|improve this answer






















                    up vote
                    0
                    down vote










                    up vote
                    0
                    down vote









                    My original problem was that there were no appropriate kernel headers available for the currently installed Linux kernel (3.11.1).



                    Finally, I solved this issue in four steps:



                    1. Removed the kernels which were installed via apt-get.


                    2. Removed custom kernels:



                      • /boot/vmlinuz*KERNEL-VERSION*

                      • /boot/initrd*KERNEL-VERSION*

                      • /boot/System-map*KERNEL-VERSION*

                      • /boot/config-KERNEL-VERSION

                      • /lib/modules/KERNEL-VERSION/

                      • See here for a detailed description.


                    3. Installed kernel and corresponding headers which are shipped per default by package manager apt-get (it's version 3.2.0-4-486).


                    4. Update grub via update-grub.

                    Now, I can compile and use the required Linux kernel module. Thanks Creek to point me in the right direction. :)






                    share|improve this answer












                    My original problem was that there were no appropriate kernel headers available for the currently installed Linux kernel (3.11.1).



                    Finally, I solved this issue in four steps:



                    1. Removed the kernels which were installed via apt-get.


                    2. Removed custom kernels:



                      • /boot/vmlinuz*KERNEL-VERSION*

                      • /boot/initrd*KERNEL-VERSION*

                      • /boot/System-map*KERNEL-VERSION*

                      • /boot/config-KERNEL-VERSION

                      • /lib/modules/KERNEL-VERSION/

                      • See here for a detailed description.


                    3. Installed kernel and corresponding headers which are shipped per default by package manager apt-get (it's version 3.2.0-4-486).


                    4. Update grub via update-grub.

                    Now, I can compile and use the required Linux kernel module. Thanks Creek to point me in the right direction. :)







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Jun 18 '14 at 6:55









                    Benedikt

                    183




                    183




















                        up vote
                        0
                        down vote













                        Use dlocate(1) command from dlocate package:



                        $ dlocate /boot/vmlinuz-*
                        linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64
                        linux-image-4.9.0-7-amd64: /boot/vmlinuz-4.9.0-7-amd64


                        dlocate takes file name as an argument and returns name of the package that owns/provides given file.






                        share|improve this answer


























                          up vote
                          0
                          down vote













                          Use dlocate(1) command from dlocate package:



                          $ dlocate /boot/vmlinuz-*
                          linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64
                          linux-image-4.9.0-7-amd64: /boot/vmlinuz-4.9.0-7-amd64


                          dlocate takes file name as an argument and returns name of the package that owns/provides given file.






                          share|improve this answer
























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            Use dlocate(1) command from dlocate package:



                            $ dlocate /boot/vmlinuz-*
                            linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64
                            linux-image-4.9.0-7-amd64: /boot/vmlinuz-4.9.0-7-amd64


                            dlocate takes file name as an argument and returns name of the package that owns/provides given file.






                            share|improve this answer














                            Use dlocate(1) command from dlocate package:



                            $ dlocate /boot/vmlinuz-*
                            linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64
                            linux-image-4.9.0-7-amd64: /boot/vmlinuz-4.9.0-7-amd64


                            dlocate takes file name as an argument and returns name of the package that owns/provides given file.







                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Aug 27 at 7:18

























                            answered Aug 26 at 10:36









                            Onlyjob

                            37428




                            37428




















                                up vote
                                0
                                down vote













                                apt-get install linux-headers should get you the headers for all installed kernels






                                share|improve this answer
























                                  up vote
                                  0
                                  down vote













                                  apt-get install linux-headers should get you the headers for all installed kernels






                                  share|improve this answer






















                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    apt-get install linux-headers should get you the headers for all installed kernels






                                    share|improve this answer












                                    apt-get install linux-headers should get you the headers for all installed kernels







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Aug 27 at 8:16









                                    Jasen

                                    2,054713




                                    2,054713



























                                         

                                        draft saved


                                        draft discarded















































                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f137590%2fdebian-get-package-name-for-installed-file%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?