2/8/2017 - 6:03 PM

Upgrades/Installation in Cloud9

Upgrades/Installation in Cloud9

Installing Yarn in Cloud9

You can't just follow the directions on the site, you have to do some mojo first.

Step 1. Run update.

sudo apt-get update

Step 2. Install apt-transport-https.

sudo apt-get install apt-transport-https

Step 3. Configure the repository (from Yarn installation).

curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -

echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list

Step 4. Run update again and install Yarn.

sudo apt-get update && sudo apt-get install yarn

You're good to go!

Upgrading PostgreSQL in Cloud9

I got most of this information from this blog post and this Medium post. I'm going to upgrade to version 9.5 to get the JSONB functionality.


Step 1. Figure out which version you're using.

psql --version

Use this version number for the next commands. I have 9.3.14 installed, so I'll be using 9.3 in any commands that require it.

Step 2. Stop PostgreSQL service.

sudo pg_ctlcluster 9.3 main stop

Step 3. Add apt repository to your sources.

echo "deb http://apt.postgresql.org/pub/repos/apt/ $(lsb_release -cs)-pgdg main" | sudo tee /etc/apt/sources.list.d/postgres.list

Step 4. Add repository key for newly added source.

sudo apt-get install wget ca-certificates

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -

Step 5. Update and install the new package.

sudo apt-get update

sudo apt-get install postgresql-9.5

Note: When the prompt appears asking what to do about the createcluster.conf file, select keep the local version currently installed.

Step 6. Remove the newly created empty cluster.

sudo pg_dropcluster --stop 9.5 main

Step 7. Upgrade your databases.

sudo pg_upgradecluster 9.3 main

Note: This may take a while.

Step 8. Check the clusters for giggles.

sudo pg_lsclusters

Step 9. Drop the old cluster.

sudo pg_dropcluster 9.3 main

You're good to go!