Murphy's picture

Hello all,
i was pleased to see 17.1.1 as a template.
Since I have built all my containers on turnkey containers, 
I'm now trying to upgrade. (core, media, files and wordpress are still to come).
The simple dist-upgrade doesn't seem to work ?!

Are the repositories still included with updates, or do I have to enter them manually now?

Can you maybe give me a hint how it works ?
I hope I don't have to redo everything. :-(

Forum: 
Jeremy Davis's picture

One is to launch a new server and migrate your data from your old server to your new one. Personally that's usually what I do as it means that there is no cruft build up and I can leave my old server running untouched, until I have the new one working. You can use TKLBAM to do that if you wish, or do it manually if you prefer. E.g. WordPress just requires you to migrate the files (/var/www/wordpress) and the DB ('wordpress'). Others might require more poking around.

The other way is to do a Debian style "in place" upgrade. You will also need to download the new TurnKey apt repo signing key for Bullseye. This should work:

codename=bullseye
key_dir=usr/share/keyrings
url=https://raw.githubusercontent.com/turnkeylinux/common/master/overlays/bootstrap_apt
for repo in main security; do
    full_path=$key_dir/tkl-$codename-$repo
    keyring=$full_path.gpg
    keyfile=$full_path.asc
    wget -O /$keyfile $url/$keyfile
    gpg --no-default-keyring --keyring /$keyring --import /$keyfile
    rm /$keyfile
done

The corresponding sources.list (and security.list) lines should like this (respectively):

# grep turnkey /etc/apt/sources.list.d/sources.list 
deb [signed-by=/usr/share/keyrings/tkl-bullseye-main.gpg] http://archive.turnkeylinux.org/debian bullseye main
# grep turnkey /etc/apt/sources.list.d/security.sources.list 
deb [signed-by=/usr/share/keyrings/tkl-bullseye-security.gpg] http://archive.turnkeylinux.org/debian bullseye-security main

Hopefully that info is of value?! Please feel free to ask for further details if you have more questions and/or hit any issues.

Regardless of which path you take, I would encourage you to ensure that you back up everything prior. That way, worst case scenario, you can wind back to a working state.

gonsa's picture

Hi,
regarding the download of the new TurnKey apt repo signing key for Bullseye, how do we exactly do it? I mean this:

codename=bullseye
key_dir=usr/share/keyrings
url=https://raw.githubusercontent.com/turnkeylinux/common/master/overlays/bo...
for repo in main security; do
full_path=$key_dir/tkl-$codename-$repo
keyring=$full_path.gpg
keyfile=$full_path.asc
wget -O /$keyfile $url/$keyfile
gpg --no-default-keyring --keyring /$keyring --import /$keyfile
rm /$keyfile
done

Do we put it in a file?
Thank you

Jeremy Davis's picture

You can make a script containing those commands and execute it if you want. Although my intention was that you just copy/paste it into a shell.

TBH I probably should make it a script to make it easier for users such as yourself wanting to follow this path. Although, even better would be to package the keys, which would make the transition much, much easier. Anyway...

If you do want to make it a script, first create a new plain text file - I'll use the name "key_update" but the name doesn't actually matter. Then put this on the first line (called a "shebang"):

#!/bin/bash -e

Then copy/paste those lines and save the file. Then make it executable and run it:

chmod +x YOUR_SCRIPT
./YOUR_SCRIPT

FYI the '-e' at the end of the shebang is optional. It makes the script exit if a command returns a non-zero exit code (i.e. an error). IMO it is best practice to always add it as otherwise the script will just continue running the remaining lines - which is almost always undesirable. In cases where you manage a failure/error or don't care if a line fails, you need to do that explicitly. It makes the script more robust and easier to troubleshoot if it doesn't work as intended.

Good luck with it all and feel free to post back if you have any further questions or problems and I'll aim to respond ASAP (but I can't guarantee as quick as I did this times...).

Murphy's picture

Hello Jeremy, 
I think I'll use the second method.
It's a pity that there is no automatic method for upgrading yet.
Would save a lot of work ;-)

Thanks for your direct answer !

Jeremy Davis's picture

No worries and good luck!

Please let us know how you go and if you need a hand, please feel free to ask.

gonsa's picture

Hi,
regarding the download of the new TurnKey apt repo signing key for Bullseye, how do we exactly do it? I mean this:

codename=bullseye
key_dir=usr/share/keyrings
url=https://raw.githubusercontent.com/turnkeylinux/common/master/overlays/bo...
for repo in main security; do
full_path=$key_dir/tkl-$codename-$repo
keyring=$full_path.gpg
keyfile=$full_path.asc
wget -O /$keyfile $url/$keyfile
gpg --no-default-keyring --keyring /$keyring --import /$keyfile
rm /$keyfile
done

Do we put it in a file?
Thank you

Jeremy Davis's picture

I just noticed that this post still hadn't been published. I swear that I had already approved it and replied!?! Obviously not... so sorry about that.

It was intended to just be copy/pasted into a terminal - although it probably would be good for me to put it in a script to make it easier for users such as yourself.

I'll reply to your other newer post below...

gonsa's picture

Oh, one thing I missed; I'm already on Bullseye and wanted to upgrade to Bookworm. Is it possible?
I tried change codename=bookworm but the script didn't work.
Thank you.

Jeremy Davis's picture

Doh! I just released that I did reply to your earlier post... Just that you double posted and I didn't delete the duplicate...

Anyway, all good.

I've just updated it with the bookworm keys so it should work now.

FWIW it failed because we've moved to using a versioned branch (currently "18.x") rather than "master". But I copied the bookworm keys to the "master" branch so the old instructions should work again now.

Good luck.

gonsa's picture

Well, the upgrade did not go well.
What I did:
- Updated the turnkey keys - OK
- Updated the repos replacing bullseye with bookworm - OK
- Did minimal upgrade first. apt update && apt upgrade - OK
- Answered to keep old conf files (smb.conf, etc.. ) - OK
- Did apt full-upgrade - OK
- Reboot - OK

Lost access to the samba share in windows and access to webmin after reboot :(

Jeremy Davis's picture

We've now moved away from direct relevance to this thread, so I've moved this discussion to a new dedicated thread. Catch you over there.

Add new comment