ubuntu无法使用man

今天使用腾讯云服务器,安装的是ubuntu18.04.4 LTS版本,使用一下命令下载了man相关的。

安装相关软件

sudo apt-get install manpages
sudo apt-get install manpages-de
sudo apt-get install manpages-de-dev
sudo apt-get install manpages-dev

每个包的用途:

manpages 包含 GNU/Linux 的基本操作
manpages-dev 包含 GNU/Linux 的基本操作API
manpages-posix 包含 POSIX 所定义公用程序的方法
manpages-posix-dev 包含 POSIX 的 header files 和 library calls 的用法

Linux man中的man就是manual的缩写,用来查看系统中自带的各种参考手册,但是手册页分为好几个部分
如下所示:(注:手册页,很重要的,一般我们也都没有用上,不过有时候,你就会发现你用上了)

手册分类:

1 Executable programs or shell commands
普通的命令(系统命令)

2 System calls (functions provided by the kernel)
系统调用,如open,write之类的(通过这个,至少可以很方便的查到调用这个函数,需要加什么头文件)

3 Library calls (functions within program libraries)
是库函数,如printf,fread(c标准函数)

4 Special files (usually found in /dev)
特殊文件,也就是/dev下的各种设备文件

5 File formats and conventions eg /etc/passwd
指文件的格式,比如passwd, 就会说明这个文件中各个字段的含义

6 Games
给游戏留的,由各个游戏自己定义

7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
附件还有一些变量,比如向environ这种全局变量在这里就有说明

8 System administration commands (usually only for root)
系统管理用的命令,这些命令只能由root使用,如ifconfig

9 Kernel routines [Non standard

遇到的问题

在这里插入图片描述
Manual page ls(1) line ?/? (END) (press h for help or q to quit)man: nroff: Bad system call (core dumped)
man: tbl: Bad system call (core dumped)
man: preconv: Bad system call (core dumped)
Manual page ls(1) line ?/? (END) (press h for help or q to quit)

man: command exited with status 159: (cd /usr/share/man && /usr/lib/man-db/zsoelim) | (cd /usr/share/man && /usr/lib/man-db/manconv -f UTF-8:ISO-8859-1 -t UTF-8//IGNORE) | (cd /usr/share/man && preconv -e UTF-8) | (cd /usr/share/man && tbl) | (cd /usr/share/man && nroff -mandoc -rLL=206n -rLT=206n -Tutf8)
找到的原因是man 2.8.3的版本与linux 的SECCOMP 机制有冲突
在这里插入图片描述
果然我安装的man的版本是2.8.3的,解决方法如下:
在环境变量里面设置禁用MAN 的SECCOMP
1、打开bashrc文件

vim ~/.bashrc

2、在文件的最后加入如下内容,并保存退出

export MAN_DISABLE_SECCOMP=1

3、使刚设置的环境变量生效

source ~/.bashrc

版权声明:本文为u011557841原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。