linux - 如何在Google Cloud Platform实例的&HOME目录下安装应用程序?

标签 linux google-app-engine ubuntu google-cloud-platform

我在 Google Cloud Platform 上设置了 Linux (ubuntu) 实例,并尝试使用 apt-get 命令安装软件包,我得到了以下指示

username@name_of_instance-145302:~$ sudo apt-get install ssh
********************************************************************************
You are running apt-get tool inside of Cloud Shell. Note that your Cloud Shell  
machine is ephemeral and will be reset once you are not using it interactively  
for about half an hour.  No system-wide change will persist beyond that.        
Note that your home directory does persist across VM instantiations, so consider
installing your tools into your home directory whenever possible.               
To suppress this warning, create an empty ~/.cloudshell/no-apt-get-warning file.
The command will automatically proceed in 5 seconds or on any key. 
Visit https://cloud.google.com/shell/help for more information.                 
********************************************************************************

也许此警告表明实例下除 $HOME 目录之外的所有文件都将被清除。 我想将文件保存在 $HOME 目录下,但下载的包位于 /etc/package_name 下,而不是在 $HOME 目录下。

因此,从 apt-get 下载的任何应用程序都会在上次操作后 30 分钟内删除。 如何将包保存在 $HOME 目录中?

最佳答案

您尝试从 Cloud shell 而不是从您的实例运行 apt-get。您应该首先 ssh 到您的实例。 (一种选择是使用“gcloudcomputessh“您的实例名称”),然后您将能够运行 apt-get。

关于linux - 如何在Google Cloud Platform实例的&HOME目录下安装应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40362376/

相关文章:

linux - 从 S3 下载 Shell 脚本 wget - 禁止错误

c++ - 启动和监视另一个进程的 Linux 最佳实践

linux - ffmpeg HLS转码和分块上传到远程服务器

linux - 为我的 VCAP_SERVICES 设置环境变量

node.js - 从 Google App Engine 连接到 MongoDB Atlas

Java谷歌云端点存在查询

google-app-engine - 使用 Google Cloud Endpoints 返回错误

php - 如何从 Ubuntu CLI 运行 Yii 控制台应用程序?

linux - lsb_release : command not found in latest Ubuntu Docker container

C++ 链接器错误 SDL 图像 - 无法读取符号