我在 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/