目录
(3.1)apt-cache search pkg-name
(3.2)apt-file search file-name(重要)
(3.4)apt-cache policy package_name
(3.5)apt-cache depends pkg-name(重要)
(3.6)apt-cache rdepends package_name(重要)
(4.2)apt-get upgrade (+pkg-name)
(4.3)apt-get dist-upgrade (+pkg-name)
(4.4)sudo apt-get install pkg-name(重要)
(4.5)sudo apt-get install pkg-name --reinstall
(4.6)sudo apt-get install -f pkg-name(重要)
(4.8)apt-get build-dep pkg-name
(4.10)apt-get purge remove pkg-name
(4.11)apt-get autoremove pkg-name
前言
在使用Linux系统时,会发现软件管理并不如Windows下那么方便直接。Windows下可以直接使用360或是腾讯管家之类的软件对系统下的软件进行统一管理:安装、更新、卸载等操作,那么Linux也有类似的工具,debian系列是apt管家工具,而Redhat是dnf(或yum)等。
平台说明:
vmware安装的Ubuntu16.04.2系统
一、apt简介
下面介绍主要来源于:百度百科
Advanced Packaging Tool(apt)是Linux下的一款安装包管理工具,是一个客户/服务器系统。
最初,linux系统下只有.tar.gz的打包文件,用户必须编译每个他想在GNU/Linux上运行的软件。用户们普遍认为系统很有必要提供一种方法来管理这些安装在机器上的软件包。当Debian诞生时,这样一个管理工具也就应运而生,它被命名为dpkg。从而著名的“package”概念第一次出现在GNU/Linux系统中,稍后Red Hat才决定开发自己的“rpm”包管理系统。
很快一个新的问题难倒了GNU/Linux制作者,他们需要一个快速、实用、高效的方法来安装软件包,当软件包更新时,这个工具应该能自动管理关联文件和维护已有配置文件。Debian再次率先解决了这个问题,APT(Advanced Packaging Tool)作为dpkg的前端诞生了。APT后来还被Conectiva改造用来管理rpm,并被其它Linux发行版本采用为它们的软件包管理工具。
APT由几个名字以“apt-”打头的程序组成,如:apt-get、apt-cache 和apt-cdrom等处理软件包的命令行工具。
Linux命令—apt,也是其它用户前台程序的后端,如dselect 和aptitude。
注意:
作为操作的一部分,APT使用一个文件列出可获得软件包的镜像站点地址,这个文件就是/etc/apt/sources.list。
用户可以将apt理解为Windows下腾讯管家等类似的软件。
二、工作原理
APT是一个客户/服务器系统。
在服务器上先复制所有DEB包(DEB是Debian软件包格式的文件扩展名),然后用APT的分析工具(genbasedir)根据每个DEB 包的包头(Header)信息对所有的DEB包进行分析,并将该分析结果记录在一个文件中,这个文件称为DEB 索引清单,APT服务器的DEB索引清单置于base文件夹内。一旦APT 服务器内的DEB有所变动,一定要使用genbasedir产生新的DEB索引清单。客户端在进行安装或升级时先要查询DEB索引清单,从而可以获知所有具有依赖关系的软件包,并一同下载到客户端以便安装。
当客户端需要安装、升级或删除某个软件包时,客户端计算机取得DEB索引清单压缩文件后,会将其解压置放于/var/state/apt/lists/(本人Ubuntu里没找到),而客户端使用apt-get install或apt-get upgrade命令的时候,就会将这个文件夹内的数据和客户端计算机内的DEB数据库比对,知道哪些DEB已安装、未安装或是可以升级的。
三、常用的apt命令(重点)
apt相关命令会在linux开发过程中多次用到,这里对相关命令进行说明:
1、首先配置软件更新源
命令:vim /etc/apt/source.list
ye@ubuntu:/$ more /etc/apt/sources.list
#deb cdrom:[Ubuntu 16.04.2 LTS _Xenial Xerus_ - Release amd64 (20170215.2)]/ xenial main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial universe
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
# deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
# deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
# deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
如上是apt默认的软件更新源,在安装、更新软件时都是从上面的网址上进行的。
用户可以添加其他网站,如:
#中科大源
deb https://mirrors.ustc.edu.cn/kali kali-rolling main non-free contrib
2、apt-get update
作用:从list的软件源中下载里面的元数据(Metadata),包括这个源有什么包, 每个包什么版本之类的,相当于Windows下面的检查更新,获取的是软件的状态。
注意:只是更新各种软件包的状态,并未真正的更新软件。无论是安装还是更新一个软件,都应该先进行这一步操作。
官方介绍:update is used to download package information from all configured sources.
3、apt-cache系列
apt-cache的主要作用在于:查看信息。
注意:这里只介绍几种常用的apt-cache相关的所有命令,用户可以自行通过命令:man apt-cache 来查看。
(3.1)apt-cache search pkg-name
作用:在软件源中搜索程序包,并显示匹配的软件包。如,查找dtc工具
yehaiyang@ubuntu:/$ apt-cache search dtc
device-tree-compiler - Device Tree Compiler for Flat Device Trees
ddtc - Deal with ddts mails
dtc-xen - SOAP daemon and scripts to allow control panel management for Xen VMs
dtc-xen-firewall - small firewall script for your dom0
python-dtcwt - Dual-Tree Complex Wavelet Transform library for Python 2
python-dtcwt-doc - Documentation of the Python implementation of the DT-CWT
python3-dtcwt - Dual-Tree Complex Wavelet Transform library for Python 3
sbox-dtc - CGI chroot wrapper script for safer hosting environment
ubuntu-developer-tools-center - transitional dummy package
搜索结果会出现于所有与dtc先关的工具,用户需要选择出最合适的并进行安装。
官方介绍:search can be used to search for the given regex(7) term(s) in the list of available packages and display matches. This can e.g. be useful if you are looking for packages having a specific feature. If you are looking for a package including a specific file try apt-file(1)(如果安装的软件包包含特殊的文件,应该使用apt-file命令).
(3.2)apt-file search file-name(重要)
作用:在所有源里查找包含指定文件的软件包,包含未安装的软件包。
apt-file的详细作用,可通过:man apt-file 查看。
(3.3)apt-cache show pkg-name
作用:显示软件包的一些常规信息,如:软件包的本地路径、本地包全称、大小、版本、依赖的库等。
yehaiyang@ubuntu:/$ apt-cache show tree
Package: tree
Priority: optional
Section: universe/utils
Installed-Size: 135 //软件包大小
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Florian Ernst <florian@debian.org>
Architecture: amd64 //处理器构架支持
Version: 1.7.0-3 //版本号
Depends: libc6 (>= 2.14) //依赖库
Filename: pool/universe/t/tree/tree_1.7.0-3_amd64.deb //本地包全称
Size: 40572
MD5sum: fefa3e2233bec6823b1b61cfd6ba0105
SHA1: 4fec27e396ff048441be18ded0d9f36e88a17a53
SHA256: d3423501d3464436199e293efaa6e95ec9296e74b6b597edc373e5dc386f9e5b
Description-en: displays an indented directory tree, in color
Tree is a recursive directory listing command that produces a depth indented
listing of files, which is colorized ala dircolors if the LS_COLORS environment
variable is set and output is to tty.
Description-md5: 9b53b68087a50d4cd859ac0117aecc08
Homepage: http://mama.indstate.edu/users/ice/tree/
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu
注意:还有一个apt-cache showpkg pkg-name的命令,显示的内容和上述略不同。
(3.4)apt-cache policy package_name
作用:显示软件包的安装状态、版本信息和安装源链接。如:
yehaiyang@ubuntu:/$ apt-cache policy tree
tree:
Installed: 1.7.0-3
Candidate: 1.7.0-3
Version table:
*** 1.7.0-3 500
500 http://us.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
100 /var/lib/dpkg/status
yehaiyang@ubuntu:/$
(3.5)apt-cache depends pkg-name(重要)
作用:显示指定软件包的依赖关系,主要是软件包和依赖库等。如:
yehaiyang@ubuntu:/$ apt-cache depends tree
[sudo] password for yehaiyang:
tree
Depends: libc6
(3.6)apt-cache rdepends package_name(重要)
作用:显示软件包的反向依赖关系,即有什么软件包需依赖你所指定的软件包。如:
yehaiyang@ubuntu:/$ apt-cache rdepends tree
tree
Reverse Depends:
pass
hollywood
sisu-complete
sisu
go2
keyringer
hollywood
//表示上述这些软件包安装时,需要先安装tree软件包;
//如下查看 pass
yehaiyang@ubuntu:/$ sudo apt-cache depends pass
pass
Depends: pwgen
pwgen:i386
|Depends: gnupg2
gnupg2:i386
Depends: gnupg
gnupg:i386
Depends: tree //表示依赖tree软件包
Recommends: gnupg2
gnupg2:i386
Recommends: git
git:i386
Recommends: xclip
Suggests: perl
Suggests: libxml-simple-perl
Suggests: ruby
yehaiyang@ubuntu:/$
其他的几个相关命令介绍:
1.apt-cache stats
显示缓存中的所有软件包的统计信息(内容繁杂);2.apt-cache dump
显示缓存中的每个软件包的简要描述信息(内容繁杂);3.apt-cache unmet
显示缓存中的软件包不符合一致性的依赖关系(内容繁杂);4.apt-cache pkgnames
列出更新源中的所有的软件包(内容繁杂);
(4)apt-get系列
apt-get的主要作用:更新、安装、升级和移除软件包。
注意:这里只介绍几种常用的apt-get相关的所有命令,用户可以自行通过命令:man apt-get 来查看。
第一部分:软件的更新和升级
(4.1)apt-get update
作用:从list的软件源中下载里面的元数据(Metadata),包括这个源有什么包, 每个包什么版本之类的,相当于Windows下面的检查更新,获取的是软件的状态。
(4.2)apt-get upgrade (+pkg-name)
作用:更新所有可升级的软件包和依赖库,或是更新pkg-name指定的软件包和依赖库。比如:
yehaiyang@ubuntu:/$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done The following packages will be upgraded: cpp-5 g++-5 gcc-5 gcc-5-base gcc-5-multilib lib32asan2 lib32atomic1 lib32cilkrts5 lib32gcc-5-dev lib32gomp1 lib32itm1 lib32mpx0 lib32quadmath0 lib32stdc++6 lib32ubsan0 libasan2 libatomic1 libcc1-0 libcilkrts5 libgcc-5-dev libgomp1 libitm1 liblsan0 libmpx0 libquadmath0 libstdc++-5-dev libstdc++6 libtsan0 libubsan0 libunity-control-center1 libx32asan2 libx32atomic1 libx32cilkrts5 libx32gcc-5-dev libx32gomp1 libx32itm1 libx32quadmath0 libx32stdc++6 libx32ubsan0 unity-control-center unity-control-center-faces 41 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 36.6 MB of archives. After this operation, 57.3 kB disk space will be freed. Do you want to continue? [Y/n] n Abort.
(4.3)apt-get dist-upgrade (+pkg-name)
作用:更新所有可升级的软件包,或是更新pkg-name指定的软件包。
小结注意
- upgrade:系统将现有的Package升级,如果有相依性的问题,而此相依性需要安装其它新的Package或影响到其它Package的相依性时,此Package就不会被升级,会保留下来。
- dist-upgrade:可以聪明的解决相依性的问题,如果有相依性问题,需要安装/移除新的Package,就会试着去安装/移除它。(所以通常这个会被认为是有点风险的升级)
- 因此:apt-get upgrade 和 apt-get dist-upgrade 本质上是没有什么不同的。
只不过,dist-upgrade 会识别出当依赖关系改变的情形并作出处理,而upgrade对此情形不处理。比如:软件包 a 原先依赖 b c d,但是在源里面可能已经升级了,现在是 a 依赖 b c e。这种情况更新软件a:
dist-upgrade 会删除 d 安装 e,并把 a 软件包升级;而 upgrade 会认为依赖关系改变而拒绝升级 a 软件包。
第二部分:软件安装
(4.4)sudo apt-get install pkg-name(重要)
作用:安装一个软件包,这算是apt中最常用的命令了。如:apt-get install u-boot-tools
yehaiyang@ubuntu:/$ sudo apt-get install u-boot-tools Reading package lists... Done Building dependency tree Reading state information... Done The following NEW packages will be installed: u-boot-tools 0 upgraded, 1 newly installed, 0 to remove and 41 not upgraded. Need to get 97.5 kB of archives. After this operation, 395 kB of additional disk space will be used. Get:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 u-boot-tools amd64 2016.01+dfsg1-2ubuntu3 [97.5 kB] Fetched 97.5 kB in 21s (4,539 B/s) Selecting previously unselected package u-boot-tools. (Reading database ... 221330 files and directories currently installed.) Preparing to unpack .../u-boot-tools_2016.01+dfsg1-2ubuntu3_amd64.deb ... Unpacking u-boot-tools (2016.01+dfsg1-2ubuntu3) ... Processing triggers for man-db (2.7.5-1) ... Setting up u-boot-tools (2016.01+dfsg1-2ubuntu3) ... yehaiyang@ubuntu:/$
(4.5)sudo apt-get install pkg-name --reinstall
作用:重新安装软件包,无论软件包是否已经安装过。
(4.6)sudo apt-get install -f pkg-name(重要)
作用:修复安装。-f参数为--fix-broken的简写形式,主要作用是是修复依赖关系(depends),假如用户的系统上有某个package不满足依赖条件,这个命令就会自动修复,安装程序包所依赖的包。
(4.7)sudo apt-get check
作用:检查所有的软件包中是否有损坏的依赖。
(4.8)apt-get build-dep pkg-name
作用:在编译安装软件包时,自动安装相关的编译环境。比如:要编译nginx,可以从网上找到需安装哪些库,用apt-get install XXXX XXXX XXXX ... 来进行安装。但是有时候装了一堆库,可能有几个是用不到的。而用apt-get build-dep命令可以更好的管理这些库文件和编译环境。
第三部分:软件移除
(4.9)apt-get remove pkg-name
作用:删除已安装的软件包(保留配置文件),不删除依赖包。
比如:软件包a,依赖软件包b,则执行该命令只会删除a,且保留配置文件。
(4.10)apt-get purge remove pkg-name
作用:删除已安装包(不保留配置文件),不删除依赖包。
比如:软件包a,依赖软件包b,则执行该命令只会删除a,而且不保留配置文件。
(4.11)apt-get autoremove pkg-name
作用:自动删除为了满足依赖而安装的,但现在不再需要的软件包(包括已安装包)。
比如:软件包a,依赖软件包b,则执行该命令会同时删除软件包a,b。
(4.12)apt-get clean
作用:使用 apt-get clean 会将 /var/cache/apt/archives/ 的 所有 deb 删掉。
类似于:rm /var/cache/apt/archives/*.deb
(4.13)apt-get autoclean
作用:APT的底层包是dpkg,而dpkg 安装Package时,会将 *.deb 放在 /var/cache/apt/archives/中。
apt-get autoclean 只会删除 /var/cache/apt/archives/ 已经过期的deb。
小结注意
- 如果是彻底卸载软件,推荐使用apt-get purge remove,不推荐使用autoremove,因为你删除该依赖软件包,也可能被其他软件包所依赖,从而导致其他软件不可用。
- 如果是清理硬盘,推荐使用apt-get autoclean,deb安装后基本上就没多大用了,完全可以删除掉
四、Ubuntu软件包查看
Dpkg 使用文本文件来作为数据库,相关的文件一般保存在 /var/lib/dpkg
目录下。
- 用户下载的deb格式的软件包一般保存在:/var/cache/apt/archives(文档库)目录下。
- /var/lib/dpkg 目录下:status 文件中存储软件状态和控制信息;在 info/ 目录下备份控制文件, 并在其下的 .list 文件中记录安装文件清单, 其下的 .mdasums 保存文件的 MD5 编码。
1、查询操作
(1)dpkg -l
作用:查看系统安装的所有的软件包,包含用户自行安装的。注意:如果系统使用时间长,安装了许多包查看不便时,可以使用翻页查看,命令:dpkg -l | less
yehaiyang@ubuntu:~$ dpkg -l Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=======================================-========================-========================-==================================================================================== ii a11y-profile-manager-indicator 0.1.10-0ubuntu3 amd64 Accessibility Profile Manager - Unity desktop indicator ii account-plugin-facebook 0.12+16.04.20160126-0ubu all GNOME Control Center account plugin for single signon - facebook ... ii git 1:2.7.4-0ubuntu1.6 amd64 fast, scalable, distributed revision control system ii git-man 1:2.7.4-0ubuntu1.6 all fast, scalable, distributed revision control system (manual pages) ... ii hexedit 1.2.13-1build1 amd64 view and edit files in hexadecimal or in ASCII ... ii tree 1.7.0-3 amd64 displays an indented directory tree, in color ... ii u-boot-tools 2016.01+dfsg1-2ubuntu3 amd64 companion tools for Das U-Boot bootloader ...
如上所述,每一个软件包有5项描述项,依次为:状态标识、软件包名称、 版本号、架构支持、简单描述。
其中,状态标识的含义为:
- 第一字符为期望值,它包括:
- u 状态未知,这意味着软件包未安装,并且用户也未发出安装请求.
- i 用户请求安装软件包.
- r 用户请求卸载软件包.
- p 用户请求清除软件包.
- h 用户请求保持软件包版本锁定.
- 第二列,是软件包的当前状态.此列包括软件包的六种状态.
- n 软件包未安装.
- i 软件包安装并完成配置.
- c 软件包以前安装过,现在删除了,但是它的配置文件还留在系统中.
- u 软件包被解包,但还未配置.
- f 试图配置软件包,但是失败了.
- h 软件包安装,但是但是没有成功.
- 第三列标识错误状态,可以总结为四种状态. 第一种状态标识没有问题,为空. 其它三种符号则标识相应问题.
- h 软件包被强制保持,因为有其它软件包依赖需求,无法升级.
- r 软件包被破坏,可能需要重新安装才能正常使用(包括删除).
- x 软包件被破坏,并且被强制保持.
(2)dpkg -S等其他命令
- dpkg --info pkg-name:列出软件包解包后的包名称.
- dpkg -l :列出当前系统中所有的包.可以和参数less一起使用在分屏查看. (类似于rpm -qa)
- dpkg -l |grep -i pkg-name: 查看系统中与"软件包名"相关联的包.
- dpkg -s :查询已安装的包的详细信息.
- dpkg -L :查询系统中已安装的软件包所安装的位置. (类似于rpm -ql)
- dpkg -S file-name:查询系统安装包中某个文件属于哪个软件包. (类似于rpm -qf)
- dpkg -I :查询deb包的详细信息,在一个软件包下载到本地之后看看用不用安装(看一下呗).
- dpkg -i :手动安装软件包(这个命令并不能解决软件包之前的依赖性问题),如果在安装某一个软件包的时候遇到了软件依赖的问题,可以用apt-get -f install在解决信赖性这个问题.
- dpkg -r :卸载软件包.不是完全的卸载,它的配置文件还存在.
- dpkg -P 全:部卸载(但是还是不能解决软件包的依赖性的问题)
- dpkg -reconfigure :重新配置
小结注意
- dpkg -S file-name命令很有用,但是要注意和 “apt-file search file-name” 的区别;比如:查找一个源文件mmam.h
yehaiyang@ubuntu:~$ dpkg -S mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/include/uapi/linux/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/tile/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/microblaze/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/metag/include/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/alpha/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/ia64/include/uapi/asm/mman.h linux-libc-dev:amd64: /usr/include/asm-generic/mman.h linux-libc-dev:amd64: /usr/include/linux/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/metag/include/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/alpha/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/s390/include/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/arm/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/mips/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/tile/include/uapi/asm/mman.h linux-libc-dev:amd64: /usr/include/x86_64-linux-gnu/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/include/uapi/asm-generic/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/powerpc/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/include/uapi/asm-generic/mman.h libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/powerpc/include/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/x86/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/ia64/include/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/score/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/include/uapi/linux/mman.h libc6-dev:amd64: /usr/include/x86_64-linux-gnu/sys/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/powerpc/include/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/mips/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/m32r/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/score/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/frv/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/include/linux/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/parisc/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/include/linux/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/m32r/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/mn10300/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/s390/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/parisc/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/sparc/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/ia64/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/sparc/include/asm/mman.h libc6-dev-i386: /usr/include/sys/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/sparc/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/ia64/include/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/x86/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/xtensa/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/powerpc/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/mn10300/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/xtensa/include/uapi/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/frv/include/uapi/asm/mman.h linux-headers-4.15.0-42: /usr/src/linux-headers-4.15.0-42/arch/sparc/include/asm/mman.h linux-headers-4.8.0-36: /usr/src/linux-headers-4.8.0-36/arch/arm/include/uapi/asm/mman.h yehaiyang@ubuntu:~$
参考连接:ubuntu安装和查看已安装
五、参考附录
下面是网友总结一些文档,值得阅读借鉴: