Skip to content

about:migrations

Jonathan Perkin edited this page Jun 10, 2024 · 2 revisions

Contents

  1. Introduction
  2. Repository Information
    1. SmartOS
  3. General Upgrade Procedure
  4. General Reinstall Procedure

Introduction

The package repositories switched away from being hosted by Joyent in mid-2022, and are now hosted on pkgsrc.smartos.org.

In general the way to update is to visit https://pkgsrc.smartos.org/ and follow the upgrade instructions for your OS, or simply provision a new instance based on a recent release.

This document provides a bit more background information and some instructions for updating manually if you prefer.

Repository Information

The following tables lists all of the old and new repository URLs, and whether the new repository requires a different PGP key or not.

SmartOS

Repository Old URL New URL New PGP Key
trunk /packages/SmartOS/trunk/x86_64/All /packages/SmartOS/trunk/x86_64/All 8254B861
trunk (tools) /packages/SmartOS/trunk/tools/All /packages/SmartOS/trunk/tools/All 8254B861
2021Q4 /packages/SmartOS/2021Q4/x86_64/All /packages/SmartOS/2021Q4/x86_64/All N/A
2020Q4 /packages/SmartOS/2020Q4/x86_64/All /packages/SmartOS/2020Q4/x86_64/All N/A
2019Q4 /packages/SmartOS/2019Q4/x86_64/All /packages/SmartOS/2019Q4/x86_64/All N/A

General Upgrade Procedure

This procedure is for users who want to switch an existing install over to the new repositories without having to reinstall.

First, set the LOCALBASE variable to the value. We can get this by querying the package tools themselves.

$ LOCALBASE=$(pkg_info -Q LOCALBASE pkg_install)

If the table indicates that a new PGP key is required, you'll need to download it and import it into the keyring used by the packaging tools. Note this requires GPG, so you may need to install that into your OS first.

$ curl -s <insert pgp link from above> | \
    gpg2 --import --no-default-keyring \
         --keyring ${LOCALBASE}/etc/gnupg/pkgsrc.gpg

Next, replace the old URL with the new URL in both configuration files:

$ vi ${LOCALBASE}/etc/pkgin/repositories.conf
$ vi ${LOCALBASE}/etc/pkg_install.conf

Finally, upgrade the package tools and then perform a clean (to remove any cached packages that may be signed with the old key) and upgrade:

$ pkg_add -U pkg_install pkgin libarchive
$ pkgin clean
$ pkgin upgrade

General Reinstall Procedure

If you wish to perform a fresh reinstall instead, then follow this procedure.

Dig out the LOCALBASE and VARBASE variables by querying the package tools:

$ LOCALBASE=$(pkg_info -Q LOCALBASE pkgin)
$ VARBASE=$(pkg_info -Q VARBASE pkgin)

This is what these values are set to for SmartOS non-tools sets:

$ echo "LOCALBASE=${LOCALBASE} VARBASE=${VARBASE}"
LOCALBASE=/opt/local VARBASE=/var

Save any data and configuration files you may have created or modified. Obviously it's out of the scope of this document to know what you may have changed, but at least have a cursory look through ${LOCALBASE}/etc and ${VARBASE}/db or ${VARBASE}/lib.

Note that for e.g. the SmartOS tools sets, ${VARBASE} is contained within ${LOCALBASE} (/opt/tools/var within /opt/tools) so any data here will be wiped out when removing ${LOCALBASE}.

Next, save a list of your installed packages. This makes it easier to get everything reinstalled again afterwards.

$ pkgin export >pkgin.list

Now, wipe out your install, or move it to one side. For most installations this will be ${LOCALBASE} along with ${VARBASE}/db/pkgin. You may want to add additional ${VARBASE}/db directories if you've installed packages that have written data there and you want a fresh start.

# Check this is correct for your install!
$ rm -rf ${LOCALBASE} ${VARBASE}/db/pkgin

Head over to https://pkgsrc.smartos.org and install the correct bootstrap kit for your intended target.

With the bootstrap kit unpacked, you should be able to run the freshly installed pkgin and import all of your previous packages if you saved them to pkgin.list:

$ pkgin import pkgin.list