5

I was trying to find a package named libkf5kjs-dev. Now I know the exact name of the package, but when I went to the search page at packages.ubuntu.com I only knew that it started with the string libkf5. If I type this into the keyword field:

enter image description here

and press "Search", I get a lot of results but none of them matches libkf5kjs-dev. What am I missing here? How should I search to get the correct package?

Håkon Hægland
  • 3,843
  • 12
  • 44
  • 78

4 Answers4

7

Web interface

If you look closely you will see a message:

Your keyword was too generic, for optimizing reasons some results might have been suppressed. Please consider using a longer keyword or more keywords.

search for libkf5k and you'll find libkf5kjs-dev.

The reason

Since these kind of queries can easily be used to run DoS like attacks to the databases they're not supported by the web interface.


CLI

You can also use command line to search for packages specifically for your Ubuntu version (using regex):

$ apt-cache search --names-only ^libkf5 | grep js | grep dev
libkf5jsembed-dev - Embedded JS library for Qt
libkf5kjs-dev - Support for JS scripting in Qt applications
Ravexina
  • 54,268
  • 25
  • 157
  • 179
4

Running the "libkf5" search keyword on packages.ubuntu.com returns:

Your keyword was too generic, for optimizing reasons some results might have been suppressed. Please consider using a longer keyword or more keywords.

It looks like the website has an upper limit on the number of search results. I would suggest using apt-file (install using sudo apt install apt-file) instead to return all possible results:

$ apt-file search libkf5 | grep libkf5kjs-dev
libkf5kjs-dev: /usr/share/doc/libkf5kjs-dev/changelog.Debian.gz
libkf5kjs-dev: /usr/share/doc/libkf5kjs-dev/copyright
libkf5kjs-dev: /usr/share/lintian/overrides/libkf5kjs-dev

where you can see that libkf5kjs-dev can be found.

edwinksl
  • 23,569
  • 16
  • 74
  • 100
  • @HåkonHægland Yeah `apt-file` is a great tool :) – edwinksl Aug 04 '17 at 07:30
  • 3
    `apt-cache search` or `apt search` would be better, since you don't need to search filenames and `apt-file` isn't installed by default. – muru Aug 04 '17 at 07:32
  • 1
    Or just `apt list libkf5\*`. (This works properly because the `apt` command's `list` action [uses globs](http://manpages.ubuntu.com/manpages/xenial/en/man8/apt.8.html) rather than regular expressions.) `apt-file` is really for when one needs to list or search for what *files* packages provide, and it doesn't seem like a reasonable tool to use for this purpose. I suggest either including some of these other methods in your answer, including an explanation of why you think `apt-file` should be used, or both. – Eliah Kagan Aug 04 '17 at 14:31
  • @EliahKagan Feel free to write your own answer as I may not have time to update my answer. – edwinksl Aug 04 '17 at 19:09
3

If you don't mind opening a ~1.2MB webpage, the full list of packages of a given release can be viewed on https://packages.ubuntu.com. For example: https://packages.ubuntu.com/xenial/allpackages?format=txt.gz Then, just use your browser search feature.

muru
  • 193,181
  • 53
  • 473
  • 722
0

If you don't mind including everything in your source.list, globbing with something like this could work:

apt list "libkf5*"

apt search will include package description, which sometimes is not wanted:

list - list packages based on package names
search - search in package descriptions
show - show package details
install - install packages
reinstall - reinstall packages
remove - remove packages
autoremove - Remove automatically all unused packages
update - update list of available packages
upgrade - upgrade the system by installing/upgrading packages
full-upgrade - upgrade the system by removing/installing/upgrading packages
edit-sources - edit the source information file
satisfy - satisfy dependency strings
Pablo Bianchi
  • 14,308
  • 4
  • 74
  • 117