forked from ubports/unity8-desktop-install-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
84 lines (65 loc) · 1.79 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
## We should die on any errors!
set -e
## Check if we are on xenial or bionic
source /etc/os-release
if [ $UBUNTU_CODENAME != "xenial" ] && [ $UBUNTU_CODENAME != "bionic" ]; then
echo "This is only supported on Ubuntu xenial and bionic"
exit 1
fi
function do_install {
## Do apt update
sudo apt update
## Do apt upgrade
sudo apt upgrade -y --allow-downgrades
## Install unity8 desktop session
sudo apt install -y unity8-desktop-session
## Done, let's tell the user
echo "------ DONE ------"
echo "You can now logout and select unity8"
}
function setup_repo {
## Make sure gnupg is installed
sudo apt install gnupg
## Setup ubports repo
echo "deb http://repo.ubports.com/ $UBUNTU_CODENAME main" | sudo tee /etc/apt/sources.list.d/ubports.list
## Add ubports keyring
wget http://repo.ubports.com/keyring.gpg -O - | sudo apt-key add -
}
function _install {
setup_repo
do_install
}
function need_lightdm {
echo "If you get an option to select display manager, please select lightdm!"
read -p "Press enter to continue"
sudo apt install -y lightdm
}
function xenial_install {
setup_repo
## Add temp repo until merged into the main repo
echo "deb http://repo.ubports.com/ xenial_-_edge main" | sudo tee -a /etc/apt/sources.list.d/ubports.list
echo "deb http://repo.ubports.com/ xenial_-_edge_-_mir main" | sudo tee -a /etc/apt/sources.list.d/ubports.list
## Add pin
sudo tee /etc/apt/preferences.d/ubports.pref << EOL
Package: *
Pin: origin repo.ubports.com
Pin-Priority: 2000
Package: *
Pin: release a=xenial_-_edge
Pin-Priority: 5000
Package: *
Pin: release a=xenial_-_edge_-_mir
Pin-Priority: 6000
EOL
do_install
need_lightdm
}
case $UBUNTU_CODENAME in
"xenial")
xenial_install
;;
"bionic")
_install
;;
esac