AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 687319
Accepted
user.dz
user.dz
Asked: 2015-10-20 05:40:44 +0800 CST2015-10-20 05:40:44 +0800 CST 2015-10-20 05:40:44 +0800 CST

apt-get purge 如何工作?为什么它不能一次删除破损的包裹?

  • 772

我已经尝试按照此处的说明安装 droidcam 来解决另一个问题:Install DroidCam (Wireless Android Webcam) Client In Ubuntu Via PPA

安装失败并出现后脚本错误,完整日志在此处找到。

现在,我想清理它并完全删除它。所以,我跑了sudo apt-get purge droidcam。但令我惊讶的是,我必须运行它 3 次才能完全清理它的安装。

$ sudo apt-get purge droidcam        
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.19.0-15 linux-headers-3.19.0-15-generic linux-image-3.19.0-15-generic linux-image-extra-3.19.0-15-generic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  droidcam*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 1,529 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 239094 files and directories currently installed.)
Removing droidcam (1.3-0ubuntu0) ...
rmmod: ERROR: Module v4l2loopback_dc is not currently loaded
dpkg: error processing package droidcam (--purge):
 subprocess installed post-removal script returned error exit status 1
Processing triggers for gnome-menus (3.10.1-0ubuntu5) ...
Processing triggers for bamfdaemon (0.5.1+15.04.20150202-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.22-1ubuntu3) ...
Processing triggers for mime-support (3.58ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.14-0ubuntu1) ...
Errors were encountered while processing:
 droidcam
E: Sub-process /usr/bin/dpkg returned an error code (1)

$ sudo apt-get purge droidcam 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.19.0-15 linux-headers-3.19.0-15-generic linux-image-3.19.0-15-generic linux-image-extra-3.19.0-15-generic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  droidcam
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 1,529 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 239088 files and directories currently installed.)
Removing droidcam (1.3-0ubuntu0) ...

$ sudo apt-get purge droidcam 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.19.0-15 linux-headers-3.19.0-15-generic linux-image-3.19.0-15-generic linux-image-extra-3.19.0-15-generic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  droidcam*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 239087 files and directories currently installed.)
Removing droidcam (1.3-0ubuntu0) ...
Purging configuration files for droidcam (1.3-0ubuntu0) ...
dpkg: warning: while removing droidcam, directory '/opt' not empty so not removed

$ sudo apt-get purge droidcam 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'droidcam' is not installed, so not removed
The following packages were automatically installed and are no longer required:
  linux-headers-3.19.0-15 linux-headers-3.19.0-15-generic linux-image-3.19.0-15-generic linux-image-extra-3.19.0-15-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

我想知道的是:

  • 为什么,我需要多次运行它?
  • 怎么样apt-get purge work?我虽然apt-get purge会一次删除所有已安装的文件。

我的第一个期望,可能是 droidcam 没有很好地包装。

apt
  • 1 1 个回答
  • 3790 Views

1 个回答

  • Voted
  1. Best Answer
    A.B.
    2015-10-20T05:49:28+08:002015-10-20T05:49:28+08:00

    在安装过程中出现问题后,这个和许多其他软件包都有问题要删除。我的解决方案是,如果脚本失败,请查看文件夹/var/lib/dpkg/info/。有四种类型的脚本

    1. package_name.preinst– 预安装脚本
    2. package_name.postinst– 安装后脚本
    3. package_name.prerm– 预删除脚本
    4. package_name.postrm– 删除后脚本

    查看脚本:通常很容易立即发现问题。通常它只是一个无法启动或停止的服务。或者像你的情况一样,一个卸载的模块。如果您只想删除包,请删除有问题的代码并再次开始删除。

    在非常有问题的情况下,有时删除整个脚本到行的唯一方法exit 0,目前例如nginx :(

    正如@kos所说,删除行set -e。但我从来没有测试过。

    并开始请愿更强大的脚本=)


    一些例子

    如何删除被 Brother MFC-8840 deb 驱动程序损坏的 dpkg?

    AVG 错误(重新安装 ubuntu)

    未能安装文档库

    • 3

相关问题

  • 如何编写 shell 脚本来安装应用程序列表?

  • 如何查看存档中可用的软件包的所有版本?

  • 是否可以说出我安装的哪些软件包不在原版安装中?

  • 如何删除 PPA?

  • 使用 apt-get upgrade 时如何强制安装内核更新?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve