I thought I’d post this in case it’s of benefit to anyone else. i ran into an issue where I needed to purge my Packages and reinstall everything - here’s two scripts I wrote to easily drop and re-install all of your packages…
/usr/local/bin/julia ~/installed.jl > ./julia.txt && echo "updated julia packages"
where installed.jl is just
using Pkg
for (k,v) in Pkg.installed()
println("$k:$v")
end
and
gen_reinstall.sh is:
#!/bin/sh
last=`tail -1 ~/julia.txt | awk -F: ' { print $1 } '`
cat ~/julia.txt | awk -F: 'BEGIN { printf("# DO NOT EDIT - AUTOGENERATED!!!\n"); printf("Using Pkg\n\npackages = [\n") } $1 !~/'"$last"'/{ printf("\t\"%s\",\n", $1) } $1 ~/'"$last"'/ { printf("\t\"%s\"\n", $1)} END { printf("]\n for p in packages\n\tprintln(\"attempting to add $p\")\n\tPkg.add(p)\n end") } ' > reinstall.jl