apt 杀死终端

apt 杀死终端

我有一台带有 Raspbian 11 bullseye 的 Raspberry Pi 4(4GB RAM)主机。今天,我尝试运行 ansible playbook 来使用 apt 更新系统,但由于分段错误错误而失败,这看起来很奇怪。我通过 SSH 连接并尝试apt update手动运行,但它终止了连接。使用 -vvv 的 SSH 输出为:

pi@rpi4:~ $ apt update
debug3: receive packet: type 96
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i0 o1 sock -1 wfd 5 efd 6 [write])
debug2: channel 0: output drain -> closed
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype exit-signal reply 0
debug3: receive packet: type 98
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug2: channel 0: rcvd eow
debug2: chan_shutdown_read: channel 0: (i0 o3 sock -1 wfd 4 efd 6 [write])
debug2: channel 0: input open -> closed
debug3: receive packet: type 97
debug2: channel 0: rcvd close
debug3: channel 0: will not send data after close
debug2: channel 0: almost dead
debug2: channel 0: gc: notify user
debug2: channel 0: gc: user detached
debug2: channel 0: send close
debug3: send packet: type 97
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
  #0 client-session (t4 r0 i3/0 o3/0 e[write]/0 fd -1/-1/6 sock -1 cc -1 io 0x00/0x00)

debug3: send packet: type 1
Connection to <ip> closed.
Transferred: sent <B>, received <B> bytes, in <s> seconds
Bytes per second: sent <Bps>, received <Bps>
debug1: Exit status -1

由于它没有引发任何错误,我尝试过搜索apt update kills ssh和类似的查询,但没有解决问题。

运行apt-get update也会终止连接。 (我也尝试在 tmux 中运行它,它杀死了 tmux)

sudo dpkg --configure -a他们既没有sudo dpkg-reconfigure apt解决问题,也没有终止联系。

编辑:apt upgrade也杀死它

可能出了什么问题?意外断电会导致这种情况吗?

编辑2:进一步调查:跑步的ls -l python2行为相同。python2杀死终端。我不认为这与 apt 真的有关系。我会继续尝试并更新。

答案1

经过更多调查,似乎 bash 中引发的任何错误都会杀死终端。我尝试ls /usr/bin/python2在 zsh 中运行(不存在),这是输出:

ls: cannot access '/usr/bin/python2'zsh: segmentation fault  ls /usr/bin/python2

看到这个结果并阅读后这个问题,看来突然断电可能损坏了SD卡。我想是时候将其重新刷新到新的 SD 卡了。

相关内容