You are here
Submitted by random_username on Mon, 2021/12/06 - 20:38
Hi,
I just installed ghost via proxmox container and noticed a Critical security update available notice at the top of my page.
I'm trying to update my version of Ghost but get the following error:
root@ghost /opt/ghost# su -c "pm2 stop ghost" node
bash: pm2: command not found
Here is my turnkey-version:
root@ghost /opt/ghost# turnkey-version
turnkey-ghost-16.1-buster-amd64
I'm trying to follow the Supervised Manual Ghost Update instructions here.
DIR=/opt/ghost cd $DIR su -c "pm2 stop ghost" node rm -rf core curl -LOk https://ghost.org/zip/ghost-latest.zip unzip ghost-latest.zip -d ghost-temp cd ghost-temp cp -R core $DIR cp index.js *.json *.md $DIR # optional step - update default theme cp -R content/themes/casper $DIR/content/themes cd .. rm -r ghost-temp rm ghost-latest.zip chown -R node:node $DIR su -c "npm install --production" node su -c "pm2 start ghost" node
Any ideas how to update this version of ghost?
Forum:
Tags:
Thanks so much for posting! Deep apologies on old documentation.
Hi fleabeard and welcome to TurnKey. :)
Thanks so much for posting! Deep apologies on our old, outdated documentation. You weren't to know, but in the source code the Readme has more up to date documentation on updates.
Having said that, when I double checked to make sure that the instructions from the doc worked, it turns out that there is a little more required. So even that isn't up to date for the current scenario!The node version also needs to be updated and the ghost CLI tool also recommends that it be updated to the latest version.
So first up, update NodeJS itself:
That should return something like this:
Then update Ghost CLI:
Then we'll update Ghost itself. We do that as the 'ghost_user' and if it needs root access at any point it will ask for the "sudo password". By default, that is the same as the Ghost Admin password you set at first boot (note the passwords aren't synced after firstboot, so they can be changed independently). If you don't recall what that was, you can update it like this:
So now, update Ghost itself. First become the 'ghost_user':That should drop you into the 'ghost-user's home, and you should see a prompt like this:
(Where 'ghost_hostname' is whatever the hostname of your instance is).
If for some reason you aren't in the home (aka the '~' between the hostname and the '$'), then change to that (if in doubt run this line, it won't do any harm):
Now run the update:
It will take a while, but once it's finished you should see something like this:
From what I can gather, it will keep the last 2 old versions, so that you can roll back if needed. Older versions will be auto cleaned up once you have more than 2.
After I completed that, I ran "ghost doctor" (it will whinge that it's not running on Ubuntu - you can safely ignore that) and it discovered some incorrect permissions. I recommend running the commands below on your system before you run 'ghost doctor' yourself (if they aren't required, they won't do any harm).:
Once those have completed (they won't give any output, double check all is well by running 'ghost doctor':
Here's the output it gave me:
Finally, exit back to the root user:
Now I just need to go update the docs...
Thank you so much for this! I
Thank you so much for this! I was able to finally get it updated with no issues! Quick question though. In your response you mention doing this:
Should it instead be sudo find ./ -type d -exec chmod 0775 {} \; instead?
Glad that worked and no 00775 is right...
Glad to hear that works.
Re your question/suggestion - no, 00775 is legitimate, albeit possibly unrequired in this instance (but won't do any harm). The leading double zero will clear any sticky bit that has been set. See the relevant gnu coreutils docs for further info.
Ah good to know!
Thanks for posting back. It's good to know that it was required!
Also FWIW I have now updated the Ghost appliance page. So hopefully the next user won't hit the issue you hit!
Add new comment