Apropos command not showing output - "nothing appropriate"

Ref:Command line help section
Hello Community/Support,
Tried running the below:

apropos modpr
-bash: apropos: command not found

Post this, tried getting the package:

sudo apt-get update
sudo apt install -y man-db

The command now works but always returns nothing appropriate:

 apropos modpr
modpr: nothing appropriate.

Tried updating the database but no luck:
sudo mandb

apropos modpr
modpr: nothing appropriate.

Can you pls suggest how to proceed?

Hi @aditya.garg

Are you trying to run this on one of our labs or Ubuntu playgrounds?

The keyword modpr is expected to at least return the brief description for modprobe. The modeprobe command is used to add or remove kernel modules. If you are using it on one of KK labs, it is possible that access to certain commands, including modprobe, may be restricted due to security reasons.

Regards.

@aditya.garg what lab are you running? In the Linux basics course I just ran the Linux kernel Modules Boot and Filetypes lab. In that lab, if I run apropos, I get a different result:

bob@caleston-lp10:~$ apropos modpr
modprobe (8)         - Add and remove modules from the Linux Kernel
modprobe.d (5)       - Configuration directory for modprobe

apropos, in order to work, needs to have its database generated using the mandb command in Ubuntu; this might be true in a Redhat flavored system as well. In the lab I tried, this has already been done.

I had the same problem. Man pages worked, but when I used apropos I always got “nothing appropriate”, even for the most common commands (e.g apropos ls: nothing appropriate)

I looked up mandb (“man mandb” ironically), and saw that one of the options is -c to create or update the man database. I tried it and it worked! I now get lists of appropriate commands when I use apropos.

The command I used was:

sudo mandb -c

(so, you almost had it right)

When I ran it, it output a bunch of messages as it did its thing and then returned,

119 man subdirectories contained newer manual pages.
10152 manual pages were added.
0 stray cats were added.

…and that did the trick.

I hope that’s helpful!