apt-get 在安装中终止后被破坏

ele*_*119 7 apt 12.04

长话短说,我尝试通过安装某些东西apt-get install并意外地通过终端终止了该过程。我现在无法使用apt-get install、Ubuntu 软件中心等。我尝试运行sudo apt-get cleansudo apt-get autoclean,但无济于事。

然后我尝试运行sudo apt-get install -f,并得到以下结果:

    Do you want to continue [Y/n]? y
    debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
(Reading database ... 216122 files and directories currently installed.)
Preparing to replace libc6 2.15-0ubuntu10.2 (using .../libc6_2.15-0ubuntu10.3_i386.deb) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing /var/cache/apt/archives/libc6_2.15-0ubuntu10.3_i386.deb (--unpack): subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/libc6_2.15-0ubuntu10.3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

如何修复此错误,或者至少“重置”apt-get以便我可以再次安装?

小智 7

您可以通过运行 dpkg --purge --force-depends "package_name"清除损坏的包 来解决此问题,然后您必须运行apt-get autoremove,然后apt-get -f install,问题将得到解决。


Fra*_*nas 3

只需重新启动机器即可。无论使用该文件的是什么,在重新启动后都不应再使用它。然后运行sudo apt-get install -f去修复它。那应该对你有用。