Linux

在 Fedora 25 上為所有類型的手冊頁執行幫助手冊頁時出錯

  • February 20, 2017
[user1@testMachine ~]$ lsb_release -a

LSB Version:    :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: Fedora
Description:    Fedora release 25 (Twenty Five)
Release:    25
Codename:   TwentyFive

[user1@testMachine ~]$ man wget
sed: can't read 2>/dev/null: No such file or directory
sed: can't read |: No such file or directory
sed: can't read less: No such file or directory

man: command exited with status 2: sed -e '/^[[:space:]]*$/{ N; /^[[:space:]]*\n[[:space:]]*$/D; }' | (cd <fd 3> && LESS=-ix8RmPm Manual page wget(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$PM Manual page wget(1) ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\%.. (press h for help or q to quit)$-iMSx4 -FXR MAN_PN=wget(1) sed s/\([[:space:]]\+[0-9.\-]\+\)$/\1/;s/\([[:space:]]\+[0-9.\-]\+[[:space:]]\)/\1/g;s/|/|/g;s/^\([-+]\+\)/\1/ 2>/dev/null | less)

甚至很多幫助命令都不起作用,並顯示相同的錯誤頁面。

你應該這樣做export MANPAGER=less,在此之後檢查它是否/usr/bin/man wget有效,如果是這樣,請非常仔細地查看你的 RC 文件以查找 MANPAGER 和 PAGER 的覆蓋。

您可以嘗試重新安裝 man 包:

yum reinstall man

您看到的錯誤讓我感到害怕…… 2>/dev/null 會向 /dev/null 發送錯誤消息(基本上已經消失)只有很少的充分理由這樣做。

您是否檢查which man並檢查它是否是二進製文件?

引用自:https://serverfault.com/questions/830814