How can I search for a package which provides an uninstalled command?

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








up vote
5
down vote

favorite
2












I would like to search for which package provides an uninstalled command.



apt-cache search keyword


is good, but the search keyword can be all or part of a package name or any words used in its description, not necessary the name of a program/command.



Is there a better way?



For example, I can't tell which package contains the program xlock:



$ apt-cache search xlock
away - Terminal locking program
devrplay3 - rplay network audio system - basic library
librplay-perl - rplay network audio system - perl modules
librplay3 - rplay network audio system - shared libraries
librplay3-dev - rplay network audio system - development libraries
rplay-client - rplay network audio system - basic clients
rplay-contrib - rplay network audio system - contributed binaries
rplay-server - rplay network audio system - server
xautolock - Program launcher for idle X sessions


Thanks.










share|improve this question



























    up vote
    5
    down vote

    favorite
    2












    I would like to search for which package provides an uninstalled command.



    apt-cache search keyword


    is good, but the search keyword can be all or part of a package name or any words used in its description, not necessary the name of a program/command.



    Is there a better way?



    For example, I can't tell which package contains the program xlock:



    $ apt-cache search xlock
    away - Terminal locking program
    devrplay3 - rplay network audio system - basic library
    librplay-perl - rplay network audio system - perl modules
    librplay3 - rplay network audio system - shared libraries
    librplay3-dev - rplay network audio system - development libraries
    rplay-client - rplay network audio system - basic clients
    rplay-contrib - rplay network audio system - contributed binaries
    rplay-server - rplay network audio system - server
    xautolock - Program launcher for idle X sessions


    Thanks.










    share|improve this question

























      up vote
      5
      down vote

      favorite
      2









      up vote
      5
      down vote

      favorite
      2






      2





      I would like to search for which package provides an uninstalled command.



      apt-cache search keyword


      is good, but the search keyword can be all or part of a package name or any words used in its description, not necessary the name of a program/command.



      Is there a better way?



      For example, I can't tell which package contains the program xlock:



      $ apt-cache search xlock
      away - Terminal locking program
      devrplay3 - rplay network audio system - basic library
      librplay-perl - rplay network audio system - perl modules
      librplay3 - rplay network audio system - shared libraries
      librplay3-dev - rplay network audio system - development libraries
      rplay-client - rplay network audio system - basic clients
      rplay-contrib - rplay network audio system - contributed binaries
      rplay-server - rplay network audio system - server
      xautolock - Program launcher for idle X sessions


      Thanks.










      share|improve this question















      I would like to search for which package provides an uninstalled command.



      apt-cache search keyword


      is good, but the search keyword can be all or part of a package name or any words used in its description, not necessary the name of a program/command.



      Is there a better way?



      For example, I can't tell which package contains the program xlock:



      $ apt-cache search xlock
      away - Terminal locking program
      devrplay3 - rplay network audio system - basic library
      librplay-perl - rplay network audio system - perl modules
      librplay3 - rplay network audio system - shared libraries
      librplay3-dev - rplay network audio system - development libraries
      rplay-client - rplay network audio system - basic clients
      rplay-contrib - rplay network audio system - contributed binaries
      rplay-server - rplay network audio system - server
      xautolock - Program launcher for idle X sessions


      Thanks.







      apt package-management repository






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Apr 3 at 16:04

























      asked Apr 3 at 13:21









      Tim

      7,65342100167




      7,65342100167




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          8
          down vote



          accepted










          Install apt-file



          sudo apt install apt-file


          Perform an initial update of its database



          sudo apt-file update


          Then (for example)



          $ apt-file search 'bin/xclock'
          x11-apps: /usr/bin/xclock


          See also How do I find the package that provides a file?






          share|improve this answer




















          • Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
            – Tim
            Apr 3 at 15:58










          • @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
            – steeldriver
            Apr 3 at 16:04










          • Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
            – Tim
            Apr 3 at 16:06











          • I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
            – Tim
            Apr 3 at 16:23










          • @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
            – steeldriver
            Apr 3 at 17:15


















          up vote
          4
          down vote













          Normally on default installs of Ubuntu, when you type an uninstalled command in the terminal you should get a list of packages that provide it, or else a list of similarly-named commands if that specific command wasn't found; it seems that xlock is simply no longer provided in the main Ubuntu repositories. It was available for 12.04 (http://manpages.ubuntu.com/manpages/precise/en/man1/xlock.1.html), but no longer.



          For xlock:



          $ xlock
          No command 'xlock' found, did you mean:
          Command 'mlock' from package 'mlock' (universe)
          Command 'xclock' from package 'x11-apps' (main)
          Command 'vlock' from package 'vlock' (universe)
          Command 'lxlock' from package 'lxlock' (universe)
          Command 'wlock' from package 'sendfile' (universe)
          Command 'slock' from package 'suckless-tools' (universe)
          Command 'rlock' from package 'ruby-lockfile' (universe)
          Command 'flock' from package 'util-linux' (main)
          Command 'clock' from package 'xview-clients' (universe)


          Example for one not installed but available:



          $ rlock
          The program 'rlock' is currently not installed. You can install it by typing:
          sudo apt install ruby-lockfile





          share|improve this answer


















          • 2




            +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
            – Ali Razmdideh
            Apr 3 at 18:37


















          up vote
          0
          down vote













          Go to packages.ubuntu.com and scroll down to "Search the contents of packages". Enter the program name in the box and click Search. A list of packages containing files named that will be displayed, without you having to install apt-file.



          In this case, just like the other suggestions here, it will display nothing useful. That's because xlock came from the xlockmore package, xlockmore doesn't seem to have been shipped in Ubuntu since precise (released in 2012), and packages.ubuntu.com only has information for supported releases, currently back to trusty (released 2014).






          share|improve this answer




















            Your Answer







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

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

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            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%2faskubuntu.com%2fquestions%2f1021614%2fhow-can-i-search-for-a-package-which-provides-an-uninstalled-command%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
            8
            down vote



            accepted










            Install apt-file



            sudo apt install apt-file


            Perform an initial update of its database



            sudo apt-file update


            Then (for example)



            $ apt-file search 'bin/xclock'
            x11-apps: /usr/bin/xclock


            See also How do I find the package that provides a file?






            share|improve this answer




















            • Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
              – Tim
              Apr 3 at 15:58










            • @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
              – steeldriver
              Apr 3 at 16:04










            • Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
              – Tim
              Apr 3 at 16:06











            • I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
              – Tim
              Apr 3 at 16:23










            • @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
              – steeldriver
              Apr 3 at 17:15















            up vote
            8
            down vote



            accepted










            Install apt-file



            sudo apt install apt-file


            Perform an initial update of its database



            sudo apt-file update


            Then (for example)



            $ apt-file search 'bin/xclock'
            x11-apps: /usr/bin/xclock


            See also How do I find the package that provides a file?






            share|improve this answer




















            • Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
              – Tim
              Apr 3 at 15:58










            • @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
              – steeldriver
              Apr 3 at 16:04










            • Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
              – Tim
              Apr 3 at 16:06











            • I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
              – Tim
              Apr 3 at 16:23










            • @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
              – steeldriver
              Apr 3 at 17:15













            up vote
            8
            down vote



            accepted







            up vote
            8
            down vote



            accepted






            Install apt-file



            sudo apt install apt-file


            Perform an initial update of its database



            sudo apt-file update


            Then (for example)



            $ apt-file search 'bin/xclock'
            x11-apps: /usr/bin/xclock


            See also How do I find the package that provides a file?






            share|improve this answer












            Install apt-file



            sudo apt install apt-file


            Perform an initial update of its database



            sudo apt-file update


            Then (for example)



            $ apt-file search 'bin/xclock'
            x11-apps: /usr/bin/xclock


            See also How do I find the package that provides a file?







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Apr 3 at 13:40









            steeldriver

            63k1198166




            63k1198166











            • Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
              – Tim
              Apr 3 at 15:58










            • @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
              – steeldriver
              Apr 3 at 16:04










            • Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
              – Tim
              Apr 3 at 16:06











            • I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
              – Tim
              Apr 3 at 16:23










            • @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
              – steeldriver
              Apr 3 at 17:15

















            • Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
              – Tim
              Apr 3 at 15:58










            • @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
              – steeldriver
              Apr 3 at 16:04










            • Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
              – Tim
              Apr 3 at 16:06











            • I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
              – Tim
              Apr 3 at 16:23










            • @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
              – steeldriver
              Apr 3 at 17:15
















            Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
            – Tim
            Apr 3 at 15:58




            Thanks. In my example, xlock (not xclock) isn't installed, and I want to find out which package provides it. Does apt-file search only search among installed programs?
            – Tim
            Apr 3 at 15:58












            @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
            – steeldriver
            Apr 3 at 16:04




            @Tim no - AFAIK it searches all the (up to date) repositories in your currently configured APT sources
            – steeldriver
            Apr 3 at 16:04












            Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
            – Tim
            Apr 3 at 16:06





            Thanks. wondering why use apt-file search 'bin/xclock' instead of apt-file search xclock?
            – Tim
            Apr 3 at 16:06













            I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
            – Tim
            Apr 3 at 16:23




            I didn't find anything meaningful by sudo apt-file search 'bin/xlock' or sudo apt-file search 'xlock'.
            – Tim
            Apr 3 at 16:23












            @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
            – steeldriver
            Apr 3 at 17:15





            @Tim I used bin/xclock simply to narrow down the search - if you don't get any hits with bin/xlock then try with just xlock, If you don't get anything meaningful then there is no package in your repositories that provides a file of that name.
            – steeldriver
            Apr 3 at 17:15













            up vote
            4
            down vote













            Normally on default installs of Ubuntu, when you type an uninstalled command in the terminal you should get a list of packages that provide it, or else a list of similarly-named commands if that specific command wasn't found; it seems that xlock is simply no longer provided in the main Ubuntu repositories. It was available for 12.04 (http://manpages.ubuntu.com/manpages/precise/en/man1/xlock.1.html), but no longer.



            For xlock:



            $ xlock
            No command 'xlock' found, did you mean:
            Command 'mlock' from package 'mlock' (universe)
            Command 'xclock' from package 'x11-apps' (main)
            Command 'vlock' from package 'vlock' (universe)
            Command 'lxlock' from package 'lxlock' (universe)
            Command 'wlock' from package 'sendfile' (universe)
            Command 'slock' from package 'suckless-tools' (universe)
            Command 'rlock' from package 'ruby-lockfile' (universe)
            Command 'flock' from package 'util-linux' (main)
            Command 'clock' from package 'xview-clients' (universe)


            Example for one not installed but available:



            $ rlock
            The program 'rlock' is currently not installed. You can install it by typing:
            sudo apt install ruby-lockfile





            share|improve this answer


















            • 2




              +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
              – Ali Razmdideh
              Apr 3 at 18:37















            up vote
            4
            down vote













            Normally on default installs of Ubuntu, when you type an uninstalled command in the terminal you should get a list of packages that provide it, or else a list of similarly-named commands if that specific command wasn't found; it seems that xlock is simply no longer provided in the main Ubuntu repositories. It was available for 12.04 (http://manpages.ubuntu.com/manpages/precise/en/man1/xlock.1.html), but no longer.



            For xlock:



            $ xlock
            No command 'xlock' found, did you mean:
            Command 'mlock' from package 'mlock' (universe)
            Command 'xclock' from package 'x11-apps' (main)
            Command 'vlock' from package 'vlock' (universe)
            Command 'lxlock' from package 'lxlock' (universe)
            Command 'wlock' from package 'sendfile' (universe)
            Command 'slock' from package 'suckless-tools' (universe)
            Command 'rlock' from package 'ruby-lockfile' (universe)
            Command 'flock' from package 'util-linux' (main)
            Command 'clock' from package 'xview-clients' (universe)


            Example for one not installed but available:



            $ rlock
            The program 'rlock' is currently not installed. You can install it by typing:
            sudo apt install ruby-lockfile





            share|improve this answer


















            • 2




              +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
              – Ali Razmdideh
              Apr 3 at 18:37













            up vote
            4
            down vote










            up vote
            4
            down vote









            Normally on default installs of Ubuntu, when you type an uninstalled command in the terminal you should get a list of packages that provide it, or else a list of similarly-named commands if that specific command wasn't found; it seems that xlock is simply no longer provided in the main Ubuntu repositories. It was available for 12.04 (http://manpages.ubuntu.com/manpages/precise/en/man1/xlock.1.html), but no longer.



            For xlock:



            $ xlock
            No command 'xlock' found, did you mean:
            Command 'mlock' from package 'mlock' (universe)
            Command 'xclock' from package 'x11-apps' (main)
            Command 'vlock' from package 'vlock' (universe)
            Command 'lxlock' from package 'lxlock' (universe)
            Command 'wlock' from package 'sendfile' (universe)
            Command 'slock' from package 'suckless-tools' (universe)
            Command 'rlock' from package 'ruby-lockfile' (universe)
            Command 'flock' from package 'util-linux' (main)
            Command 'clock' from package 'xview-clients' (universe)


            Example for one not installed but available:



            $ rlock
            The program 'rlock' is currently not installed. You can install it by typing:
            sudo apt install ruby-lockfile





            share|improve this answer














            Normally on default installs of Ubuntu, when you type an uninstalled command in the terminal you should get a list of packages that provide it, or else a list of similarly-named commands if that specific command wasn't found; it seems that xlock is simply no longer provided in the main Ubuntu repositories. It was available for 12.04 (http://manpages.ubuntu.com/manpages/precise/en/man1/xlock.1.html), but no longer.



            For xlock:



            $ xlock
            No command 'xlock' found, did you mean:
            Command 'mlock' from package 'mlock' (universe)
            Command 'xclock' from package 'x11-apps' (main)
            Command 'vlock' from package 'vlock' (universe)
            Command 'lxlock' from package 'lxlock' (universe)
            Command 'wlock' from package 'sendfile' (universe)
            Command 'slock' from package 'suckless-tools' (universe)
            Command 'rlock' from package 'ruby-lockfile' (universe)
            Command 'flock' from package 'util-linux' (main)
            Command 'clock' from package 'xview-clients' (universe)


            Example for one not installed but available:



            $ rlock
            The program 'rlock' is currently not installed. You can install it by typing:
            sudo apt install ruby-lockfile






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 3 at 17:30

























            answered Apr 3 at 17:18









            JAB

            22529




            22529







            • 2




              +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
              – Ali Razmdideh
              Apr 3 at 18:37













            • 2




              +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
              – Ali Razmdideh
              Apr 3 at 18:37








            2




            2




            +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
            – Ali Razmdideh
            Apr 3 at 18:37





            +1 And also these outputs are made by command-not-found package thats installed by default on Ubuntu. I guess its good to say the name of this package.
            – Ali Razmdideh
            Apr 3 at 18:37











            up vote
            0
            down vote













            Go to packages.ubuntu.com and scroll down to "Search the contents of packages". Enter the program name in the box and click Search. A list of packages containing files named that will be displayed, without you having to install apt-file.



            In this case, just like the other suggestions here, it will display nothing useful. That's because xlock came from the xlockmore package, xlockmore doesn't seem to have been shipped in Ubuntu since precise (released in 2012), and packages.ubuntu.com only has information for supported releases, currently back to trusty (released 2014).






            share|improve this answer
























              up vote
              0
              down vote













              Go to packages.ubuntu.com and scroll down to "Search the contents of packages". Enter the program name in the box and click Search. A list of packages containing files named that will be displayed, without you having to install apt-file.



              In this case, just like the other suggestions here, it will display nothing useful. That's because xlock came from the xlockmore package, xlockmore doesn't seem to have been shipped in Ubuntu since precise (released in 2012), and packages.ubuntu.com only has information for supported releases, currently back to trusty (released 2014).






              share|improve this answer






















                up vote
                0
                down vote










                up vote
                0
                down vote









                Go to packages.ubuntu.com and scroll down to "Search the contents of packages". Enter the program name in the box and click Search. A list of packages containing files named that will be displayed, without you having to install apt-file.



                In this case, just like the other suggestions here, it will display nothing useful. That's because xlock came from the xlockmore package, xlockmore doesn't seem to have been shipped in Ubuntu since precise (released in 2012), and packages.ubuntu.com only has information for supported releases, currently back to trusty (released 2014).






                share|improve this answer












                Go to packages.ubuntu.com and scroll down to "Search the contents of packages". Enter the program name in the box and click Search. A list of packages containing files named that will be displayed, without you having to install apt-file.



                In this case, just like the other suggestions here, it will display nothing useful. That's because xlock came from the xlockmore package, xlockmore doesn't seem to have been shipped in Ubuntu since precise (released in 2012), and packages.ubuntu.com only has information for supported releases, currently back to trusty (released 2014).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 3 at 21:50









                hobbs

                904611




                904611



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1021614%2fhow-can-i-search-for-a-package-which-provides-an-uninstalled-command%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    Trouble downloading packages list due to a “Hash sum mismatch” error

                    How do so many people here on Academia.SE, and in general, afford lavish higher education programs?

                    Cutting all the characters after the last /