aims-release-upgrade 2.86 KB
Newer Older
Jonathan Carter's avatar
Jonathan Carter committed
1
2
#!/bin/sh

Jonathan Carter's avatar
Jonathan Carter committed
3
4
5
6
7
8
# Keep this for next time.
#if [ "$1" != "-f" ];then
#    echo "AIMS Desktop 2020.1 has not yet been released,"
#    echo "add '-f' to continue upgrading anyway."
#    exit 1
#fi
Jonathan Carter's avatar
Jonathan Carter committed
9
10
11

# Set interface to noninteractive
export DEBIAN_FRONTEND="noninteractive"
Jonathan Carter's avatar
Jonathan Carter committed
12
#export DPKG_OPTIONS='-o Dpkg::Options::="--force-confold"'
Jonathan Carter's avatar
Jonathan Carter committed
13

Jonathan Carter's avatar
Jonathan Carter committed
14
# Resume if we have a partial install...
Jan Groenewald's avatar
Jan Groenewald committed
15
16
echo " * Checking whether your Debian 9 Stretch system is in a consistent state."
echo " * Configuring all packages..."
Jonathan Carter's avatar
Jonathan Carter committed
17
dpkg --configure -a
Jan Groenewald's avatar
Jan Groenewald committed
18
echo " * Checking all packages completed installing..."
19
apt-get -f install || 'echo "Unable to correct; Please fix your system first." && exit 1'
Jonathan Carter's avatar
Jonathan Carter committed
20

Jan Groenewald's avatar
Jan Groenewald committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Update stretch
echo "Checking whether your Debian 9 Stretch system is up to date."
echo " * Updating package list..."
apt-get -qq update
echo " * Downloading upgrade package set..."
apt-get $DPKG_OPTIONS --yes --quiet --download-only dist-upgrade
echo " * Performing initial upgrade (safe upgrade)..."
apt-get $DPKG_OPTIONS --yes --quiet upgrade
echo " * Completeing full upgrade (dist-upgrade)..."
apt-get $DPKG_OPTIONS --yes --quiet full-upgrade
echo " * Remove packages that are no longer needed... "
apt-get -y autoremove

# Update to buster
35
36
37
38
39
40
echo " * Commencing upgrade from Debian 9 Stretch to Debian 10 Buster."
echo " * Updating sources..."
[ -f /etc/apt/sources.list.d/jessie.list ] && mv -f /etc/apt/sources.list.d/jessie.list /etc/apt/sources.list.d/jessie.list.disabled
for i in /etc/apt/sources.list.d/*.list ; do
	egrep 'trusty|xenial|bionic|artful|cosmic|disco' $i && mv -f $i $i.disabled;
done
Jan Groenewald's avatar
Jan Groenewald committed
41
sed --in-place "s/stretch/buster/g" /etc/apt/sources.list /etc/apt/sources.list.d/* 2> /dev/null
Jonathan Carter's avatar
Jonathan Carter committed
42
43
44
45

echo " * Updating package list..."
apt --quiet update
echo " * Downloading upgrade package set..."
Jonathan Carter's avatar
Jonathan Carter committed
46
apt-get $DPKG_OPTIONS --yes --quiet --download-only dist-upgrade
Jonathan Carter's avatar
Jonathan Carter committed
47
echo " * Performing initial upgrade (safe upgrade)..."
Jonathan Carter's avatar
Jonathan Carter committed
48
apt-get $DPKG_OPTIONS --yes --quiet upgrade
Jonathan Carter's avatar
Jonathan Carter committed
49
echo " * Completeing full upgrade (dist-upgrade)..."
Jonathan Carter's avatar
Jonathan Carter committed
50
apt-get $DPKG_OPTIONS --yes --quiet full-upgrade
Jan Groenewald's avatar
Jan Groenewald committed
51
echo " * Re-install AIMS Desktop metapackage..."
Jonathan Carter's avatar
Jonathan Carter committed
52
53
# re-installing ensures that all recommends, including new ones are installed
apt-get $DPKG_OPTIONS --yes --quiet remove aims-desktop
Jonathan Carter's avatar
Jonathan Carter committed
54
apt-get $DPKG_OPTIONS --yes --quiet install aims-desktop
Jonathan Carter's avatar
Jonathan Carter committed
55
echo " * Remove packages that are no longer needed... "
Jonathan Carter's avatar
Jonathan Carter committed
56
apt-get $DPKG_OPTIONS --yes --quiet autoremove
Jan Groenewald's avatar
Jan Groenewald committed
57

58
# R packages must be re-compiled against current version of R
Jan Groenewald's avatar
Jan Groenewald committed
59
60
# including the IRkernel we installed for stretch
rm -rf /usr/local/lib/R/site-library/*
61
62
rm -rf /usr/local/share/jupyter/kernels/ir
apt-get -y install r-cran-irkernel
Jan Groenewald's avatar
Jan Groenewald committed
63
64
65
66
67
68
69
70
71
aims-install-rstudio
echo " * R has been upgraded. Please re-install your locally installed R packages."
echo " * Note r-cran-irkernel is now in the AIMS PPA and in AIMS Desktop by default."

# reboot
echo
echo " * Upgrade to Debian 10 buster seems to have completed successfully."
echo " * Please reboot your system now!"
echo