-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathupdateos.sh
49 lines (43 loc) · 1.63 KB
/
updateos.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
#!/bin/bash
# install colon
if ! command -v colcon &> /dev/null
then
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install python3-colcon-common-extensions -y
exit
fi
# install torch
# install torch
var="$(lsb_release -sr)"
if [ $var = "18.04" ]; then
pip install torch torchvision future
sudo apt-get install python-numpy
python -m pip install --upgrade Pillow
fi
if [ $var = "20.04" ]; then
pip3 install torch torchvision future
sudo apt-get install python3-numpy
python3 -m pip install --upgrade Pillow
fi
echo "export VEHICLE_NAME=''" >> ~/.bashrc
# update cmake
currentver=$(cmake --version | head -1 | cut -d' ' -f3)
echo $currentver
# need to makesure cmake is greater than version 3.13
requiredver="3.13.0"
if [ "$(printf '%s\n' "$requiredver" "$currentver" | sort -V | head -n1)" = "$requiredver" ]; then
echo "Greater than or equal to ${requiredver}"
else
sudo apt update && \
sudo apt install -y software-properties-common lsb-release && \
sudo apt clean all
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | sudo tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
sudo apt-add-repository "deb https://apt.kitware.com/ubuntu/ $(lsb_release -cs) main"
sudo apt update
sudo apt install kitware-archive-keyring
sudo rm /etc/apt/trusted.gpg.d/kitware.gpg
sudo apt update
sudo apt install cmake -y
fi