我无法深入了解我的情况。我尝试了以下方法
#! /bin/bash
adduser serial1
echo serial1:desperate-attempt | chpasswd
usermod -aG google-sudoers serial1我在“串行端口1(控制台)”日志中确实看到了这些错误。
Oct 16 16:29:01 instance-1 ntpd[668]: bind(21) AF_INET6 fe80::4001:aff:fe8e:2%2#123 flags 0x11 failed: Cannot assign requested address
Oct 16 16:29:01 instance-1 ntpd[668]: unable to create socket on eth0 (5) for fe80::4001:aff:fe8e:2%2#123
Oct 16 16:29:01 instance-1 ntpd[668]: failed to init interface for address fe80::4001:aff:fe8e:2%2
Oct 16 16:29:01 instance-1 ntpd[668]: Listening on routing socket on fd #21 for interface updates
Oct 16 16:29:02 instance-1 ntpd[668]: bind(24) AF_INET6 fe80::4001:aff:fe8e:2%2#123 flags 0x11 failed: Cannot assign requested address
Oct 16 16:29:02 instance-1 ntpd[668]: unable to create socket on eth0 (6) for fe80::4001:aff:fe8e:2%2#123
Oct 16 16:29:02 instance-1 ntpd[668]: failed to init interface for address fe80::4001:aff:fe8e:2%2
Oct 16 16:29:02 instance-1 google_instance_setup[663]: Traceback (most recent call last):
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/bin/google_instance_setup", line 6, in <module>
Oct 16 16:29:02 instance-1 google_instance_setup[663]: from pkg_resources import load_entry_point
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3257, in <module>
Oct 16 16:29:02 instance-1 google_instance_setup[663]: def _initialize_master_working_set():
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3240, in _call_aside
Oct 16 16:29:02 instance-1 google_instance_setup[663]: f(*args, **kwargs)
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 3269, in _initialize_master_working_set
Oct 16 16:29:02 instance-1 google_instance_setup[663]: working_set = WorkingSet._build_master()
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 582, in _build_master
Oct 16 16:29:02 instance-1 google_instance_setup[663]: ws.require(__requires__)
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 899, in require
Oct 16 16:29:02 instance-1 google_instance_setup[663]: needed = self.resolve(parse_requirements(requirements))
Oct 16 16:29:02 instance-1 google_instance_setup[663]: File "/usr/local/lib/python3.9/site-packages/pkg_resources/__init__.py", line 785, in resolve
Oct 16 16:29:02 instance-1 google_instance_setup[663]: raise DistributionNotFound(req, requirers)
Oct 16 16:29:02 instance-1 google_instance_setup[663]: pkg_resources.DistributionNotFound: The 'google-compute-engine==2.8.13' distribution was not found and is required by the application
[[0;1;31mFAILED[0m] Failed to start Google Compute Engine Instance Setup.Oct 16 16:29:02 instance-1 google_instance_setup[663]: pkg_resources.DistributionNotFound: The 'google-compute-engine==2.8.13' distribution was not found and is required by the application
[[0;1;31mFAILED[0m] Failed to start Google Compute Engine Instance Setup.
See 'systemctl status google-instance-setup.service' for details.
Starting NSS cache refresh...
Oct 16 16:29:02 instance-1 systemd[1]: google-instance-setup.service: Main process exited, code=exited, status=1/FAILURE
Oct 16 16:29:02 instance-1 systemd[1]: Failed to start Google Compute Engine Instance Setup.
Oct 16 16:29:02 instance-1 systemd[1]: google-instance-setup.service: Unit entered failed state.
Oct 16 16:29:02 instance-1 systemd[1]: google-instance-setup.service: Failed with result 'exit-code'.对google_accounts_daemon、google_metadata_script_runner、google_network_daemon、google_*、.
听起来有些包裹不是最新的。但是,如何在不登录实例的情况下安装呢?有什么好办法来纠正这个错误吗?
发布于 2021-10-17 16:17:05
以您为例,Google包或Python安装或两者都已损坏。此问题使您无法登录。
我建议您创建一个新实例,并将持久性磁盘从损坏的实例移动到新实例。
步骤1:
在同一区域中创建一个新实例。一个微观的例子就行了。
步骤2:
打开Cloud提示符(如果设置了gcloud,它也可以从桌面上运行)。执行这个命令。将名称替换为实例名称(已损坏的系统),将磁盘替换为引导磁盘名称,并将区域替换为系统所在的区域:
gcloud compute instances detach-disk NAME --disk=DISK --zone=ZONE确保前面的命令没有报告错误。
步骤3:
将此磁盘附加到您创建的新实例。
在附加第二个磁盘之前,确保新的VM实例正在运行。有时,如果多个磁盘是可引导的,则实例可能会混淆要从哪个磁盘上引导。
转到Compute -> VM实例。单击实例。点击编辑。在“其他磁盘”下单击“添加项”。对于名称,输入/选择从已损坏的实例中分离出来的磁盘。单击保存。
步骤4:
将SSH与两个磁盘连接到新实例中。
步骤5:
请仔细遵循这些步骤。将第二个磁盘作为子目录挂载到根文件系统。
您现在可以在路径/mnt/oldsystem.上访问旧文件系统中的文件。
https://stackoverflow.com/questions/69597655
复制相似问题