dpkg

dpkg是debian最早提出的一个软件包管理工具,因为早期并没有考虑到当下软件包之间这么复杂的依赖关系,所以并不能自动解决软件包的依赖问题,这个命令多用于安装本地的.deb软件包,也可以进行软件包的维护
$sudo dpkg [-isLrP] [软件包或软件名]
-i package安装一个软件包
-s name查看软件包信息
-L name查看软件包的安装路径
-r name卸载软件,保留配置文件
-P name卸载软件,同时删除配置文件

例子

$sudo dpkg -i rxvt_1%3a2.6.4-14_i386.deb 
Selecting previously unselected package rxvt.
(Reading database ... 193732 files and directories currently installed.)
Unpacking rxvt (from rxvt_1%3a2.6.4-14_i386.deb) ...
Setting up rxvt (1:2.6.4-14) ...
update-alternatives: using /usr/bin/rxvt-xterm to provide /usr/bin/rxvt (rxvt) in auto mode.
update-alternatives: error: no alternatives for rclock.
Processing triggers for man-db ...
$sudo dpkg -s rxvt
Package: rxvt
Status: install ok installed
Priority: optional
Section: x11
Installed-Size: 536
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Architecture: i386
Version: 1:2.6.4-14
Provides: x-terminal-emulator
Depends: libc6 (>= 2.4), libx11-6, libxpm4
Conffiles:
 /etc/menu-methods/rxvt b0dfbc8f0b846ed1d5021cbdcc3b872a
Description: VT102 terminal emulator for the X Window System
 Rxvt is an 8-bit clean, color xterm replacement that uses significantly
 less memory than a conventional xterm, mostly since it doesn't support
 toolkit configurability or Tek graphics, but also since features can
 be removed at compile-time to reflect your needs.
 .
 The distribution also includes rclock, the smaller/better xclock
 replacement with appointment scheduling and xbiff functionality.
Original-Maintainer: Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
$sudo dpkg -L rxvt
/.
/usr
/usr/bin
/usr/bin/rxvt-xterm
/usr/bin/rxvt-xpm
/usr/bin/rclock
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/rclock.1.gz
/usr/share/man/man1/rxvt-xterm.1.gz
/usr/share/doc
/usr/share/doc/rxvt
/usr/share/doc/rxvt/examples
/usr/share/doc/rxvt/examples/example.menu
/usr/share/doc/rxvt/examples/jedmenu.sl
/usr/share/doc/rxvt/examples/menu
/usr/share/doc/rxvt/examples/rxvt.menu
/usr/share/doc/rxvt/examples/terminal.menu
/usr/share/doc/rxvt/html
/usr/share/doc/rxvt/html/rxvt.html
/usr/share/doc/rxvt/html/rxvtRef-frame.html
/usr/share/doc/rxvt/html/rxvtRef-toc.html
/usr/share/doc/rxvt/html/rxvtRef.html
/usr/share/doc/rxvt/BUGS
/usr/share/doc/rxvt/README.xvt.gz
/usr/share/doc/rxvt/README.menu
/usr/share/doc/rxvt/xterm.seq.gz
/usr/share/doc/rxvt/FAQ.Debian.gz
/usr/share/doc/rxvt/changelog.Debian.gz
/usr/share/doc/rxvt/README.Debian
/usr/share/doc/rxvt/copyright
/usr/share/doc/rxvt/changelog.gz
/usr/share/doc/rxvt/FAQ.gz
/usr/share/doc/rxvt/README.greek.gz
/usr/share/doc/rxvt/rxvtRef.txt.gz
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/rxvt
/usr/share/menu
/usr/share/menu/rxvt
/etc
/etc/menu-methods
/etc/menu-methods/rxvt
/usr/share/man/man1/rxvt-xpm.1.gz
$sudo dpkg -r rxvt
(Reading database ... 193765 files and directories currently installed.)
Removing rxvt ...
update-alternatives: using /usr/bin/rxvt-xpm to provide /usr/bin/rxvt (rxvt) in auto mode.
Processing triggers for man-db ...
$sudo dpkg -s rxvt
Package: rxvt
Status: deinstall ok config-files
Priority: optional
Section: x11
Installed-Size: 536
Maintainer: Ubuntu MOTU Developers <ubuntu-motu@lists.ubuntu.com>
Architecture: i386
Version: 1:2.6.4-14
Config-Version: 1:2.6.4-14
Provides: x-terminal-emulator
Depends: libc6 (>= 2.4), libx11-6, libxpm4
Conffiles:
 /etc/menu-methods/rxvt b0dfbc8f0b846ed1d5021cbdcc3b872a
Description: VT102 terminal emulator for the X Window System
 Rxvt is an 8-bit clean, color xterm replacement that uses significantly
 less memory than a conventional xterm, mostly since it doesn't support
 toolkit configurability or Tek graphics, but also since features can
 be removed at compile-time to reflect your needs.
 .
 The distribution also includes rclock, the smaller/better xclock
 replacement with appointment scheduling and xbiff functionality.
Original-Maintainer: Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
$sudo dpkg -P rxvt
(Reading database ... 193733 files and directories currently installed.)
Removing rxvt ...
Purging configuration files for rxvt ...
$sudo dpkg -s rxvt
Package `rxvt' is not installed and no info is available.
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
`dpkg` 是 Debian 及其衍生系统(如 Ubuntu)中的一个用于安装、构建、卸载和管理 `.deb` 格式软件包的工具。如果你正在使用基于 Debian 的 Linux 发行版,`dpkg` 工具很可能已经预装在系统中了。如果没有预装,你可以按照以下步骤进行安装: 1. 首先,你需要下载 `dpkg` 的安装包。由于 `dpkg` 是 Debian 包管理系统的组成部分,你可以从 Debian 的官方仓库中下载。 2. 使用 `wget` 命令下载 `dpkg` 的 deb 包(以 Debian 为例): ```bash wget http://httpredir.debian.org/debian/pool/main/d/dpkg/dpkg_1.19.7_amd64.deb ``` 注意:版本号 `1.19.7` 和架构 `amd64` 可能会有所不同,你需要根据实际情况选择合适的版本和架构。 3. 安装下载的 deb 包: ```bash sudo dpkg -i dpkg_1.19.7_amd64.deb ``` 这条命令会使用 `dpkg` 来安装 `dpkg`。`-i` 参数是用来安装软件包的。 4. 如果在安装过程中出现依赖问题,可以使用以下命令来修复依赖并继续安装: ```bash sudo apt-get install -f ``` 这个命令会尝试修复安装过程中出现的任何依赖问题。 5. 完成安装后,你可以使用 `dpkg` 命令来管理 `.deb` 软件包,例如查询软件包信息、安装、卸载等。 请注意,如果你不是在使用基于 Debian 的系统,或者你的系统已经有其他包管理器(如 `yum`, `dnf`, `zypper`, `pacman` 等),通常不推荐直接安装 `dpkg`,因为它可能与你系统的包管理器不兼容。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值