输入/输出错误,无法安装任何东西

输入/输出错误,无法安装任何东西

我对我的 Debian 服务器做了一些奇怪的事情,现在我无法安装任何东西。它说,该区域设置已损坏。我尝试通过重新配置 dpkg、清理 apt-get 以及来自互联网的许多其他解决方案来修复它。当我尝试安装东西时,我得到:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  locales
The following packages will be upgraded:
  xxx yyy
xx upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 27.3 MB of archives.
After this operation, 19.3 MB disk space will be freed.
Do you want to continue? [Y/n]
Fetched 27.3 MB in 19s (1,396 kB/s)
(Reading database ... 45726 files and directories currently installed.)
Removing locales (2.19-18+deb8u2) ...
dpkg: error processing package locales (--remove):
 cannot remove '/usr/share/locale/locale.alias': Input/output error
Errors were encountered while processing:
 locales
E: Sub-process /usr/bin/dpkg returned an error code (1)
apt-get upgrade  10.60s user 2.89s system 40% cpu 32.969 total 

由于上述错误,我无法删除该文件。
尝试修复或重做区域设置文件说,locales is broken or not fully installed

正如评论中所建议的:

root@bananapi ~ # dpkg --audit
The following packages are only half installed, due to problems during
installation.  The installation can probably be completed by retrying it;
the packages can be removed using dselect or dpkg --remove:
 locales              GNU C Library: National Language (locale) data [support]

尝试这样做,给我这个错误:

1 root@bananapi ~ # apt-get install locales                                                                                                                                                              :(
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  locales
1 upgraded, 0 newly installed, 0 to remove and 17 not upgraded.
1 not fully installed or removed.
Need to get 3,944 kB of archives.
After this operation, 395 kB of additional disk space will be used.
Get:1 http://security.debian.org/ jessie/updates/main locales all 2.19-18+deb8u3 [3,944 kB]
Fetched 3,944 kB in 1s (3,045 kB/s)
Preconfiguring packages ...
Selecting previously unselected package locales.
(Reading database ... 45727 files and directories currently installed.)
Preparing to unpack .../locales_2.19-18+deb8u3_all.deb ...
Unpacking locales (2.19-18+deb8u3) over (2.19-18+deb8u2) ...
dpkg: error processing archive /var/cache/apt/archives/locales_2.19-18+deb8u3_all.deb (--unpack):
 unable to make backup link of './usr/sbin/update-locale' before installing new version: Too many links
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/locales_2.19-18+deb8u3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
apt-get install locales  5.53s user 1.97s system 34% cpu 21.697 total

答案1

cannot remove '/usr/share/locale/locale.alias': Input/output error

这不是包装系统的问题。存储已损坏。任何需要访问存储损坏部分的操作都会失败。在这种情况下,升级需要替换损坏目录中的文件,因此升级会失败。

存储损坏是一个不好的迹象。更换磁盘并检查数据的完整性。

答案2

解决办法就是把卡拿出来,在fsck另一台电脑上修复。非常简单,由EightBitTony 建议。

相关内容