0

I have been using some packages by installing them using the sudo apt-get command in the cloud shell. But now I want to make it permanent. I got this message in the shell

You are running apt-get inside of Cloud Shell. Note that your Cloud Shell
machine is ephemeral and no system-wide change will persist beyond session end.

You can customize your environment to permanently include this package by
updating your environment at https://cloud.google.com/console/cloudshell/environment/view.

So how to customize the cloud environment to include a package permanently?

LundinCast
  • 9,412
  • 4
  • 36
  • 48
rini saha
  • 195
  • 1
  • 1
  • 11

2 Answers2

3

You have several options.

1) Reinstall everything each time you launch Cloud Shell. This sounds bad but if you keep your files on GCS, the copy happens very fast.

2) Cloud Shell is a Docker container. You can modify that container so that you launch Cloud Shell using your customized container. Launch Cloud Shell. In the title bar on the right hand side is a icon that looks like a laptop. Click it. This will open a window with details on configuring the Docker container.

3) Keep everything local to your home directory. You home directory tree is persistent and will be restored each time your Cloud Shell VM is recreated.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
0

You can try environment customization:

You can modify or add the file $HOME/.customize_environment. This script runs when your cloud shell boots up and runs as root.

Example in $HOME/.customize_environment:

#!/bin/sh

apt-get -y install zsh