救援提示:错误的库文件安装导致 Ubuntu 18.04 升级后损坏

救援提示:错误的库文件安装导致 Ubuntu 18.04 升级后损坏

我尝试将旧的 Ubuntu 14.04 linode.com 实例升级到 18.04。但有些依赖项不知为何没有升级。

因此我尝试从 Ubuntu 服务器安装相应的 deb 文件(因为它不在 repo 中)

The following packages have unmet dependencies:
 dpkg : Breaks: libdpkg-perl (< 1.18.11) but 1.18.4ubuntu1 is to be installed
        Breaks: libdpkg-perl:i386 (< 1.18.11)
 libc-bin : Depends: libc6 (< 2.25) but 2.27-3ubuntu1.2 is to be installed
 locales : Depends: libc-bin (> 2.27)

我意外安装了错误版本的 libc6,导致实例损坏。

root@myself:~# dpkg -i libc6_2.27-3ubuntu1_amd64.deb 
dpkg: warning: downgrading libc6:amd64 from 2.31-0ubuntu9.2 to 2.27-3ubuntu1
(Reading database ... 110607 files and directories currently installed.)
Preparing to unpack libc6_2.27-3ubuntu1_amd64.deb ...
/usr/bin/perl: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory
dpkg: error processing archive libc6_2.27-3ubuntu1_amd64.deb (--install):
 subprocess new pre-installation script returned error exit status 127
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Errors were encountered while processing:
 libc6_2.27-3ubuntu1_amd64.deb

现在我无法访问 ssh

通过 Lish Gateway(Linode SH)登录,我收到以下消息,并且它不接受任何登录。

 * Stopping flush early job output to logs                               [ OK ]
 * Starting SystemD login management service                             [ OK ]
 * Starting system logging daemon                                        [ OK ]
 * Starting Bridge socket events into upstart                            [ OK ]
 * Starting Bridge file events into upstart                              [ OK ]
 * Setting up X socket directories...                                    [ OK ]
 * Stopping cold plug devices                                            [ OK ]
 * Stopping log initial device creation                                  [ OK ]
 * Stopping System V initialisation compatibility                        [ OK ]
 * Starting configure network device security                            [ OK ]
 * Starting System V runlevel compatibility                              [ OK ]
 * Starting OpenSSH server                                               [ OK ]
 * Starting regular background program processing daemon                 [ OK ]
 * Starting save kernel messages                                         [ OK ]
 * Stopping save kernel messages                                         [ OK ]
 * Starting configure virtual network devices                            [ OK ]
 * Starting MySQL Server                                                 [fail]
 * Restoring resolver state...                                           [ OK ]
 * Stopping MySQL Server                                                 [ OK ]                                                                         
 *                                                                             
 * The apache2 configtest failed.                                              
Output of config test was:                                                     
/usr/sbin/apache2: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such
Action 'configtest' failed.                                                    
The Apache error log may have more information.                                
 * Stopping System V runlevel compatibility                              [ OK ]
                                                                               
Ubuntu 18.04.1 LTS nmd2 ttyS0                                             
                                                                               
nmd2 login:                                                                   
------------------------------------------------------------------------------

因此尝试救援模式是唯一的选择。似乎 libcrypt 依赖关系导致了错误。

如何在救援模式下解决这个问题。请提供任何建议。

相关内容