我为我的Google Cloud Platform实例select了Debian 9,并且正在运行sudo apt update和sudo apt upgrade ,直到昨天,我安装了apache(没有别的),并且没有做任何其他的系统修改。 我通常通过SSL连接到虚拟机,并保持窗口打开几个小时,但昨天,试图安装libopencv-dev通过运行sudo apt update , sudo apt upgrade和sudo apt install libopencv-dev ,我得到以下错误:
myusername@instance-1:~$ sudo apt update Ign:1 http://deb.debian.org/debian stretch InRelease Get:2 http://deb.debian.org/debian stretch-updates InRelease [88.5 kB] Get:3 http://deb.debian.org/debian stretch-backports InRelease [82.9 kB] Hit:4 http://deb.debian.org/debian stretch Release Hit:5 http://security.debian.org stretch/updates InRelease Hit:7 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease Hit:8 http://packages.cloud.google.com/apt google-cloud-compute-stretch InRelease Hit:9 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease Fetched 171 kB in 0s (171 kB/s) Reading package lists... Done Building dependency tree Reading state information... Done All packages are up to date. myusername@instance-1:~$ sudo apt upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 1 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y Setting up google-cloud-sdk (162.0.0-0) ... Killed dpkg: error processing package google-cloud-sdk (--configure): subprocess installed post-installation script returned error exit status 137 E: Sub-process /usr/bin/dpkg returned an error code (1) myusername@instance-1:~$
我从一个IRC频道(#debian)寻求帮助,并被告知输出结果表明google云包(或其存储库?)不存在; 然而,当我运行一个能力search它,它是存在的:
myusername@instance-1:~$ sudo apt search google-cloud-sdk Sorting... Done Full Text Search... Done google-cloud-sdk/cloud-sdk-stretch,now 162.0.0-0 all [installed] Utilities for the Google Cloud Platform google-cloud-sdk-app-engine-go/cloud-sdk-stretch 162.0.0-0 amd64 Go runtime for Google App Engine google-cloud-sdk-app-engine-java/cloud-sdk-stretch 162.0.0-0 all Java runtime for Google App Engine google-cloud-sdk-app-engine-python/cloud-sdk-stretch 162.0.0-0 all Python runtime for Google App Engine google-cloud-sdk-bigtable-emulator/cloud-sdk-stretch 162.0.0-0 amd64 Emulator for Google Cloud Bigtable. google-cloud-sdk-cbt/cloud-sdk-stretch 162.0.0-0 amd64 Google Cloud Bigtable Command Line Tool google-cloud-sdk-datalab/cloud-sdk-stretch 162.0.0-0 all Command-line utility for Google Cloud Datalab google-cloud-sdk-datastore-emulator/cloud-sdk-stretch 162.0.0-0 all Emulator for Google Cloud Datastore. google-cloud-sdk-pubsub-emulator/cloud-sdk-stretch 162.0.0-0 all Emulator for Google Cloud Pubsub. google-cloud-sdk-tests/cloud-sdk-stretch 162.0.0-0 all Tests for verifying Google Cloud SDK packages. myusername@instance-1:~$
我想你应该看看dmesg输出(或者日志)来找出postinst脚本死的时候:
Setting up google-cloud-sdk (162.0.0-0) ... Killed dpkg: error processing package google-cloud-sdk (--configure): subprocess installed post-installation script returned error exit status 137
例如,这可能是一个内存不足的错误。