0

I'm working on a server, I was going to run update && upgrade, but I saw something that made me curious about what is going on. command-not-found, and command-not-found-data

$ sudo apt-get upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  command-not-found command-not-found-data landscape-common libkeyutils1
  linux-firmware python3-commandnotfound sosreport tcpdump
  ubuntu-advantage-tools
9 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 standard security update
Need to get 76.9 MB/77.3 MB of archives.
After this operation, 957 kB of additional disk space will be used.
Do you want to continue? [Y/n] n    

I've never heard of this program, it has no man page. it does have a vague listing in apt-cache search. what is this? on a web/ssh server, do I have any reason to care about this package?

2
  • 1
    It interfaces to your shell's command_not_found handle to provide helpful package suggestions for missing commands. See How to show apt-get install suggestions in command line? . There should be some documentation at /usr/share/doc/command-not-found/README.md Apr 11, 2022 at 19:38
  • $ meter will display three options to install a meter executable, assuming you have not yet installed one of them.
    – Hannu
    Apr 11, 2022 at 21:09

1 Answer 1

2

command-not-found is the package that provides hint messages like the example below when you type a name of a non-existent command in the shell:

raj@jarek-02:~$ tas

Command 'tas' not found, did you mean:

  command 'task' from deb taskwarrior (2.5.1+dfsg-9)
  command 'tap' from deb node-tap (12.0.1+ds-2)
  command 'as' from deb binutils (2.34-6ubuntu1.3)
  command 'tasm' from deb yasm (1.3.0-2ubuntu1)
  command 'tcs' from deb tcs (1-11.1)
  command 'tar' from deb tar (1.30+dfsg-7ubuntu0.20.04.2)
  command 'tqs' from deb ssake (4.0-3)
  command 'tao' from deb taopm (1.0-6build1)
  command 'tabs' from deb ncurses-bin (6.2-0ubuntu2)
  command 'ts' from deb moreutils (0.63-1)
  command 'trs' from deb konwert (1.8-13build1)
  command 'tac' from deb coreutils (8.30-3ubuntu2)

Try: sudo apt install <deb name>

raj@jarek-02:~$ 

Without command-not-found, you would simply get a message like:

raj@jarek-02:~$ tas
tas: command not found
raj@jarek-02:~$ 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .