转自:http://blog.csdn.net/zhou_2008/article/details/6076900

在debian下,你可以使用dpkg(Debian package system)来安装和卸载软件包,安装/卸载软件的最简单办法就是使用dpkg。

现在,debian还支持一个名为apt(for “A Package Tool”)和aptitude的工具,来帮助管理员更加简单的来管理软件。详细内容可以参考另一篇文章:如何使用apt-get和aptitude来管理软件。

1.使用dpkg -i安装deb包
   语法:
   dpkg -i package-file-name

-i is to install a package.

下例为使用dpkg来安装tcl
   $ dpkg -i tcl8.4_8.4.19-2_amd64.deb
   Selecting previously deselected package tcl8.4.
   (Reading database ... 94692 files and directories currently installed.)
   Unpacking tcl8.4 (from tcl8.4_8.4.19-2_amd64.deb) ...
   Setting up tcl8.4 (8.4.19-2) ...
   Processing triggers for menu ...
   Processing triggers for man-db ...

如下所示,你可以使用dpkg -l +名称 来验证安装
   $ dpkg -l | grep 'tcl'
   ii  tcl8.4                               8.4.19-2                   Tcl (the Tool Command Language) v8.4 - run-t

上面命令显示tcl包是否安装正确,其中“ii”表示“installed ok installed”

2.使用kpkg -r来删除deb包

dpkg 加上 -r参数,用于卸载已安装好的软件包
   $ dpkg -r tcl8.4
   (Reading database ... 94812 files and directories currently installed.)
   Removing tcl8.4 ...
   Processing triggers for man-db ...
   Processing triggers for menu ...

现在检查软件包的状态.
   # dpkg -l | grep 'tcl'
   rc  tcl8.4                                8.4.19-2                   Tcl (the Tool Command Language) v8.4 - run-t

rc 代表 ‘removed ok config-files’. 卸载命令并没有清除配置文件. 每个已安装包的状态可在 /var/lib/dpkg/status查看.  tcl8.4包状态如下所示,
   Package: tcl8.4
   Status: deinstall ok config-files
   Priority: optional
   Section: interpreters
   Installed-Size: 3308

以下命令表示彻底卸载软件包(包括配置文件).
   $ dpkg -P tcl8.4
   (Reading database ... 94691 files and directories currently installed.)
   Removing tcl8.4 ...
   Purging configuration files for tcl8.4 ...
   Processing triggers for menu ...
   $ dpkg -l | grep 'tcl'
   $

现在软件已完全删除, 在 /var/lib/dpkg/status 中查看状态如下.
   Package: tcl8.4
   Status: purge ok not-installed
   Priority: optional
   Section: interpreters

本文由阿泉译自http://www.thegeekstuff.com/2010/06/install-remove-deb-package/,转载时请保留译者信息。

debian下使用dpkg来安装/卸载deb包 (转载)的更多相关文章

  1. ubuntu 安装 删除 卸载 Deb 包文件

    图形界面: 安装deb 直接双击图标,输入密码后就可自动安装. 卸载deb 1. 菜单-系统->系统管理->新立得软件包管理器 或 Alt+F2(运行窗口)输入 sudo synaptic ...

  2. dpkg卸载deb包

    一.背景: 一个脚本安装mysql,结果提示缺少依赖库,安装失败. 二.查询: 此时查询deb文件已经安装的情况,得到这个结果: root@debian:~# dpkg -l |grep mysql- ...

  3. 在Debian下利用URLOS快速安装SqlServer2017

    SqlServer能在Debian上安装吗?答案是可以!网络上也能找到很多Linux系统下安装SqlServer的相关文章,也许经过一些折腾,你也能成功在Debian中安装sqlserver,但是其中 ...

  4. 【Python使用】使用pip安装卸载Python包(含离线安装Python包)未完成???

    pip 是 Python 包管理工具,该工具提供了对Python包的查找.下载.安装.卸载的功能.Python 2.7.9 + 或 Python 3.4+ 以上版本都自带 pip 工具. pip使用( ...

  5. CentOS 6.3下Samba服务器的安装与配置【转载】

    本文转载自 园友David_Tang的博客,如有侵权请联系本人及时删除,原文地址: http://www.cnblogs.com/mchina/archive/2012/12/18/2816717.h ...

  6. centos 7 无网络情况下,解决yum 安装依赖rpm包

    方法一:在一台有网络的机器,用yum下载好所需程序,传到另外一台网络的机器上安装 yum install xtrabackup --downloadonly --downloaddir=/rpmpat ...

  7. Ubuntu/Debian下通过Apt-get简单安装Oracle JDK

    近几年本人对各种Arm小板,开发板不明原因中毒,基本以Linux系统为主,本篇文章以记录在32位Arm的Debian8上,通过Apt-get的简单命令安装Oracle JDK8并成功的记录. 1.首先 ...

  8. mysql:Linux系统下mysql5.6的安装卸载

    1.1. 下载rpm包 要使用yum 安装mysql,需要mysql的yum仓库,先从官网下载适合你系统的仓库 http://dev.mysql.com/downloads/repo/yum/ 我的是 ...

  9. debian下如何源码安装tmux

    一.源码安装ncurses库 1.1 获取源码 wget https://invisible-island.net/datafiles/release/ncurses.tar.gz tar xvf n ...

随机推荐

  1. PAT顶级 1002. Business (35)

    PAT顶级 1002. Business (35) As the manager of your company, you have to carefully consider, for each p ...

  2. 主席树模板poj 2104

    资料1:http://blog.csdn.net/regina8023/article/details/41910615 资料2:模板来源:http://www.cnblogs.com/lidaxin ...

  3. python模糊匹配之fuzzywuzzy

    fuzzywyzzy 是python下一个模糊匹配的模块.首先要安装fuzzywuzzy 示例: from fuzzywuzzy import fuzz from fuzzywuzzy import ...

  4. em的理解

    em 版本:CSS1 说明: 自己的理解: 注意地方: 浏览器默认大小为16px. 谷歌浏览器最小字体为12px. font-size;有继承性. 判断步骤: []看该元素本身有没有设置字体大小: 有 ...

  5. IntelliJ IDEA配置本地Tomcat方法---亲测有效

    https://blog.csdn.net/hello_ljl/article/details/79258165

  6. 转盘抽奖 canvas & 抽奖 H5 源码

    转盘抽奖 canvas https://github.com/givebest/wechat-turntalbe-canvas https://blog.givebest.cn/GB-canvas-t ...

  7. poj 3667 Hotel (线段树的合并操作)

    Hotel The cows are journeying north to Thunder Bay in Canada to gain cultural enrichment and enjoy a ...

  8. 使用流的方式去进行post请求解决中文乱码问题返回xml格式

    /** * 请求post * @Title: getHttpURLConnection * @Description: TODO(这里用一句话描述这个方法的作用) * @param: @param u ...

  9. sql语句执行的很慢

    一个 SQL 执行的很慢,我们要分两种情况讨论: 1.大多数情况下很正常,偶尔很慢,则有如下原因 (1).数据库在刷新脏页,例如 redo log 写满了需要同步到磁盘. (2).执行的时候,遇到锁, ...

  10. 选择器的使用(nth-of-type和nth-last-of-type选择器)

    <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><meta ...