Skip to content

Instantly share code, notes, and snippets.

@AlainODea
Created October 31, 2013 13:41
Show Gist options
  • Save AlainODea/7249940 to your computer and use it in GitHub Desktop.
Save AlainODea/7249940 to your computer and use it in GitHub Desktop.
WIP: Replace one PKGSRC version with another on a SmartMachine
#!/usr/bin/env bash
# get list of installed packages
pkg_info | cut -d' ' -f 1 | sed 's/-[^-]*$//' > packages.list
# replace existing PKGSRC
rm -Rf /opt/local /var/db/pkgin
curl -s http://pkgsrc.joyent.com/packages/SmartOS/bootstrap/bootstrap-$PKGSRC-$ARCH.tar.gz | gzcat | (cd /; tar -xpf -)
pkgin -y update
pkgin -y upgrade
# install current versions of previously installed software
cat packages.list | xargs pkgin -y install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment