长话短说,我尝试通过 安装某些东西apt-get install
,但意外地通过终端终止了该过程。我现在无法使用apt-get install
、Ubuntu 软件中心等。我尝试运行sudo apt-get clean
和sudo 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)
我该如何修复这个错误,或者至少“重置”apt-get
以便我可以再次安装东西?
答案1
您可以通过运行 dpkg --purge --force-depends "package_name"
清除损坏的包来解决此问题,然后必须运行apt-get autoremove
,apt-get -f install
之后问题就会解决。
答案2
只需重启机器即可。无论使用该文件的程序在重启后都不应再使用它。然后运行sudo apt-get install -f
以修复它。这应该对你有用。