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
    • 最新
    • 标签
主页 / unix / 问题 / 464445
Accepted
JonLord
JonLord
Asked: 2018-08-24 07:59:17 +0800 CST2018-08-24 07:59:17 +0800 CST 2018-08-24 07:59:17 +0800 CST

运行 apt update 时 appstreamcli 出现问题

  • 772

我今天在运行 apt update 时遇到了 debian 测试问题,返回结果如下:

E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null; fi'
E: Sub-process returned an error code
debian apt
  • 4 4 个回答
  • 12956 Views

4 个回答

  • Voted
  1. Best Answer
    JonLord
    2018-08-24T08:12:41+08:002018-08-24T08:12:41+08:00

    谷歌搜索后,我发现有人说删除包 appstream 将解决问题。

    此解决方案将起作用,但在许多情况下,此方法将删除您可能不想删除的包。

    另一种解决方案是注释文件中的最后三行,/etc/apt/apt.conf.d/50appstream如下所示:

    ...
    #APT::Update::Post-Invoke-Success {
    #    "if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null | true; fi";
    #};
    

    然后保存文件并apt-get update再次运行。

    运行系统升级后,程序包 appstream 可能会进行升级以修复此错误,并且可能会出现如下消息:

    Configuration file '/etc/apt/apt.conf.d/50appstream'
      ==> Modified (by yourself or by a script) since the installation.
      ==> The package distributor has released an updated version.
        What do you want to do? Your options are:
         Y or I: install the version of the maintainer package
         N or O: keep the currently installed version
           D: Show differences between versions
           Z: start a shell to examine the situation
    

    你应该说 Y 来升级你修改过的文件。

    我发布此内容是为了帮助可能搜索此错误的其他人。

    • 17
  2. darkrain
    2019-09-14T21:53:52+08:002019-09-14T21:53:52+08:00
    apt-get clean
    

    清空 apt 缓存似乎也为我解决了这个问题。然后我可以跑

    apt-get update
    

    没有任何问题或警告。

    编辑:也许我太快了。清理缓存后,错误消失了,但后来又出现了。

    • 4
  3. Daniel Wagenaar
    2020-07-08T07:28:31+08:002020-07-08T07:28:31+08:00

    从失败的 Ubuntu 20.04 更新中恢复时,我遇到了同样的问题。根据其他地方的答案,我将 appstreamcli 移开:

    sudo mv /usr/bin/appstreamcli /root
    

    在那之后,

    sudo apt update
    

    工作没有问题。

    然后我做了

    sudo apt upgrade
    

    最后

    sudo apt install --reinstall appstream
    sudo rm /root/appstreamcli
    

    这解决了僵局。然后我确实有几个“保留”的包需要手动处理,但这很简单(如果相当乏味的话)。

    • 1
  4. DENISH BORAD
    2021-03-02T01:49:28+08:002021-03-02T01:49:28+08:00

    使用以下命令解决问题:

    sudo chmod a+rwx /etc/apt/apt.conf.d/50appstream
    sudo gedit use /etc/apt/apt.conf.d/50appstream
    

    然后在文件的最后 3 行添加注释,如下所示:

    #APT::Update::Post-Invoke-Success {
    
    #. "if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh-cache > /dev/null | true; fi";
    
    #};
    

    然后再做:

    sudo apt-get update
    
    sudo apt-get upgrade
    

    并且在那

    Configuration file '/etc/apt/apt.conf.d/50appstream'
    
     ==> Modified (by you or by a script) since installation.
    
     ==> Package distributor has shipped an updated version.
    
       What would you like to do about it?  Your options are:
    
        Y or I: install the package maintainer's version
    
        N or O: keep your currently-installed version
    
          D: show the differences between the versions
    
          Z: start a shell to examine the situation
    
     The default action is to keep your current version.
    
    *** 50appstream (Y/I/N/O/D/Z) [default=N] ? y
    
    Installing new version of config file /etc/apt/apt.conf.d/50appstream ...
    

    给出 Y 并按 Enter 键以获取新的更新文件。

    • 0

相关问题

  • GRUB 配置以识别同一 Linux 发行版的不同桌面环境(安装)

  • astyle 不会更改源文件格式

  • 接收有关全新 Debian 的电子邮件

  • Debian Stretch:libgs_plugin_systemd-updates.so 中的 gnome-software 段错误

  • 如何在拼音输入法中输入ü?

Sidebar

Stats

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

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve