大家好,又见面了,我是你们的朋友全栈君。
说明:
dpkg用于:管理系统的里deb包,可以对其安装、卸载、deb打包、deb解压等操作,与之相关apt-get工具可以在线下载 deb包 安装
参数:
代码语言:javascript复制-i:安装软件包;
-r:删除软件包;
-P:删除软件包的同时删除其配置文件;
-L:显示于软件包关联的文件;
-l:显示已安装软件包列表;
--unpack:解开软件包;
-c:显示软件包内文件列表;
--confiugre:配置软件包。
1.安装软件
命令: dpkg -i <.deb file name>
实例: dpkg -i zabbix-release_4.0-3 bionic_all.deb
代码语言:javascript复制root@zabbix-web2:~# dpkg -i zabbix-release_4.0-3 bionic_all.deb
Selecting previously unselected package zabbix-release.
(Reading database ... 102712 files and directories currently installed.)
Preparing to unpack zabbix-release_4.0-3 bionic_all.deb ...
Unpacking zabbix-release (1:4.0-3 bionic) ...
Setting up zabbix-release (1:4.0-3 bionic) ...
2.列出与该包先关联的文件
命令:dpkg -L package
安装完包后,可以用此命令查看软件安装到什么地方,
实例: dpkg -L zabbix-release
代码语言:javascript复制root@zabbix-web2:~# dpkg -L zabbix-release
/.
/etc
/etc/apt
/etc/apt/sources.list.d
/etc/apt/sources.list.d/zabbix.list
/etc/apt/trusted.gpg.d
/etc/apt/trusted.gpg.d/zabbix-official-repo.gpg
/usr
/usr/share
/usr/share/doc
/usr/share/doc/zabbix-release
/usr/share/doc/zabbix-release/README.Debian
/usr/share/doc/zabbix-release/changelog.Debian
/usr/share/doc/zabbix-release/copyright
3.显示包的版本
命令:dpkg -l package
实例:dpkg -l zabbix-release
代码语言:javascript复制root@zabbix-web2:~# dpkg -l zabbix-release
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 zabbix-release 1:4.0-3 bioni all Zabbix official repository configuratio
4.移除软件(保留配置)
命令:dpkg -r package
实例:dpkg -r zabbix-release
5.移除软件(不保留配置)
命令:dpkg -P package
实例:dpkg -P zabbix-release
6.查找包的详细信息
命令:dpkg -s package
实例:dpkg -s zabbix-release
7.列出deb包的内容
命令:dpkg -c package.deb 列出 deb 包的内容
实例:dpkg -c zabbix-release
8.解开 deb 包的内容
dpkg –unpack package.deb 解开 deb 包的内容
9.搜索所属的包内容
dpkg -S keyword 搜索所属的包内容
10. 配置包
dpkg –configure package 配置包
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/143260.html原文链接:https://javaforall.cn