In ubuntu, if I type a command for a application that is not installed, but that it knows about from a db, it gives me a message like this:

~ $ kate
The program 'kate' is currently not installed.  You can install it by typing:
sudo apt-get install kate

Is there a way to get a similar message in Arch Linux?


Was looking for exactly the same, found brilliant solution here: https://bbs.archlinux.org/viewtopic.php?pid=874678#p874678

When installing pkgtools, more info pops out:

(2/2) installing pkgtools
- Make sure to run pkgfile --update before use
- pkgfile includes a "command not found" hook for both zsh and bash.

  This will automatically run pkgfile whenever you run
  a command which the shell cannot find. If you want
  this functionality, set CMD_SEARCH_ENABLED to 1 in
  /etc/pkgtools/pkgfile.conf (or per-user by copying
  that file to ${XDG_CONFIG_HOME}/pkgtools/pkgfile.conf), then
  in your current shell run:
  source /etc/profile

- An entry has been placed in /etc/cron.daily to run pkgfile --update
  If you do not want this functionality, set UPDATE_CRON=0 in /etc/pkgtools/pkgfile.conf

So this seems to be part of python, in ubuntu its in:
in the following function:

def advise(self, command, ignore_installed=False):
    " give advice where to find the given command to stderr "

I found the launchpad project that implements this: https://launchpad.net/command-not-found

Hope this helps

  • The code relies on a database. I assume that this is generated by examining all the binary packages for binaries installed to the default path dirs. Does such a database already exist for arch? Generating such a database would require downloading all the packages, a resource I don't have. – Gary van der Merwe Sep 20 '11 at 7:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.