出现错误sudo apt-get upgrade
出现以下错误
Setting up python-google-compute-engine (20170523-0ubuntu1~16.04.0) ...
Setting up google-cloud-sdk (154.0.0-0ubuntu1~16.04.0) ...
Traceback (most recent call last):
File "/usr/bin/pycompile", line 289, in <module>
main()
File "/usr/bin/pycompile", line 271, in main
options.force, options.optimize, e_patterns)
File "/usr/bin/pycompile", line 178, in compile
pipe.send(fn)
File "/usr/bin/pycompile", line 141, in py_compile
stdin.write(filename + '\n')
IOError: [Errno 32] Broken pipe
dpkg: error processing package google-cloud-sdk (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of gce-startup-scripts:
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
根本原因可能是内存不足。升级前请尝试添加交换区。
sudo dd if=/dev/zero of=/var/swap bs=1024 count=1524288
sudo chmod 600 /var/swap
sudo mkswap /var/swap
sudo swapon /var/swap
sudo apt upgrade