Score:2

No manual entry for chdir

in flag

I tried to look up for this common error, but I was shocked to find out there is no one simple solution, all are very specific to the issue.

My issue is, on Ubuntu 20.04 LTS, that I try to run man chdir, but get this error message No manual entry for chdir.

I tried this set of commands:

sudo apt-get install -y man-pages
sudo apt-get install -y man-db
mandb

Yet, it didn't help. Please, what am I missing out?

N0rbert avatar
zw flag
Are you running Ubuntu inside Docker container?
Investing TS avatar
in flag
No, actually it's inside VirtualBox
Score:2
hr flag

The following chdir-related manpages should be available:

$ man -k chdir
chdir (2)            - change working directory
chdir (3posix)       - change working directory

(man section 2 is for kernel-provided system calls, whereas section 3 is for calls provided by external libraries).

We can see where a man page lives (on a system that does have it) using man -w:

$ man -w chdir
/usr/share/man/man2/chdir.2.gz

$ man -s 3posix -w chdir
/usr/share/man/man3/chdir.3posix.gz

Then let's see what packages provide them:

$ dpkg -S $(man -w chdir) $(man -s 3posix -w chdir)
manpages-dev: /usr/share/man/man2/chdir.2.gz
manpages-posix-dev: /usr/share/man/man3/chdir.3posix.gz

So you likely need to install the manpages-dev package:

Description: Manual pages about using GNU/Linux for development
 These man pages describe the Linux programming interface, including these two sections:
  2 = Linux system calls.
  3 = Library calls (note that a more comprehensive source of information
      may be found in the glibc-doc and glibc-doc-reference packages).
Investing TS avatar
in flag
Very very nice! Thank you for the elaborate explanation.
hr flag
@InvestingTS you're welcome - I guess I should have qualified that you *might* want the POSIX man page, depending on what information you are looking for
Score:0
ae flag

If you are missing and searching for only a handful of man-pages, refer to @steeldriver's very helpful answer. However, if you are missing all man-pages as well as in need of all of them, you are probably using a minimal system image. In that case, you can restore all the necessities in one step with the unminimize command.

Antti Rytsölä avatar
za flag
do you know if there's a way to get the man pages back without unminimizing everything ?
ae flag
@AnttiRytsölä according to [this](https://copyfuture.com/blogs-details/202207121726449764) post the unminimize command is a shell script with multiple steps, the first of which seems to restore the man pages. I guess you could easily kill the script just after that. I haven't tried this though.
Antti Rytsölä avatar
za flag
With thanks to X Zhang, I had a look at the unminimize script. the server packages will only be installed if the ubuntu package "ubuntu-server" is installed. I had not, so it installed only mans, docs and translations.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.