AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 979679
Accepted
stdcerr
stdcerr
Asked: 2017-11-24 17:39:19 +0800 CST2017-11-24 17:39:19 +0800 CST 2017-11-24 17:39:19 +0800 CST

apt upgrade: Falha ao executar a operação: Arquivo ou diretório inexistente

  • 772

Após a atualização de 14.04 para 16.04, o apt-get ficou de alguma forma confuso no meu xenialsistema e não tenho certeza de como corrigi-lo. Isso é o que eu recebo (depois apt update).
Alguém pode oferecer alguns conselhos sobre como corrigir isso?

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages were automatically installed and are no longer required:
  libsimgearcore3.4.0v5 libsimgearscene3.4.0v5 linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-97-generic linux-image-extra-4.4.0-97-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up snapd (2.28.5~14.04) ...
Failed to execute operation: No such file or directory
dpkg: error processing package snapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

Eu também tentei executar apt -f installe obtive o seguinte:

$ sudo apt -f install
[sudo] password for ron: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libsimgearcore3.4.0v5 libsimgearscene3.4.0v5 linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-97-generic linux-image-extra-4.4.0-97-generic
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up snapd (2.28.5~14.04) ...
Failed to execute operation: No such file or directory
dpkg: error processing package snapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 snapd
E: Sub-process /usr/bin/dpkg returned an error code (1)

onde $ sudo dpkdg --configure -ame dá:

$ sudo dpkg --configure -a
Setting up snapd (2.28.5~14.04) ...
Failed to execute operation: No such file or directory
dpkg: error processing package snapd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 snapd

Onde sudo apt-get --remove purge snapdretorna:

$ sudo apt-get --remove purge snapd
[sudo] password for ron: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  cgroup-lite libsimgearcore3.4.0v5 libsimgearscene3.4.0v5 linux-generic-lts-xenial linux-headers-4.4.0-97 linux-headers-4.4.0-97-generic linux-image-4.4.0-97-generic
  linux-image-extra-4.4.0-97-generic squashfs-tools
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  snapd*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 74.5 MB disk space will be freed.
Do you want to continue? [Y/n] 
(Reading database ... 661915 files and directories currently installed.)
Removing snapd (2.28.5~14.04) ...
Failed to stop snapd.autoimport.service: Unit snapd.autoimport.service not loaded.
Failed to stop snapd.socket: Unit snapd.socket not loaded.
Failed to stop snapd.service: Unit snapd.service not loaded.
dpkg: error processing package snapd (--purge):
 subprocess installed pre-removal script returned error exit status 5
Errors were encountered while processing:
 snapd
sudo aE: Sub-process /usr/bin/dpkg returned an error code (1)
16.04
  • 2 2 respostas
  • 3080 Views

2 respostas

  • Voted
  1. Best Answer
    J. Starnes
    2017-11-28T15:57:44+08:002017-11-28T15:57:44+08:00

    Esta resposta de @vskubriev pode conter a chave para forçar a remoção.

    Essencialmente:
    adicione exit 0após o shebang a /var/lib/dpkg/info/snapd.prerm. Em seguida, execute os seguintes comandos.

    dpkg --purge --force-all snapd
    apt-get update
    

    Opcionalmente, reinstale executandoapt-get install snapd

    Se a resposta de @vskubriev ajudar a votar nela, não aqui.

    • 2
  2. dobey
    2017-11-27T06:56:05+08:002017-11-27T06:56:05+08:00

    Como parece que você atualizou de 14.04 com o snapd instalado para 16.04 e, por algum motivo, o pacote snapd não foi substituído, deixando você com esse problema, faça o seguinte para remover o pacote:

    #: sudo rm /var/lib/dpkg/info/snapd.p*rm
    #: sudo apt-get remove --purge snapd
    

    Isso excluirá os scripts de pré/pós-remoção e deve permitir que o pacote seja removido, pois o script está falhando. Se você precisar do snap (porque já instalou alguns snaps anteriormente ou algo assim), basta executar:

    #: sudo apt update
    #: sudo apt install snapd
    
    • 0

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

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

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve