您当前的位置:首页 > 计算机 > 系统应用 > Linux

a bash for new computer installation

时间:02-03来源:作者:点击数:

a bash for new computer installation

#!/bin/bash
echo "This is a bash script for quick installation of base tools"

echo "select one to install :
		1 --> electron-ssr-0.2.6.deb 
		2 --> setup git proxy 
		3.1 --> install ROS pre-request
		3.2 --> sudo apt install ros-melodic-desktop-full
		3.3 --> sudo apt install ros-melodic-desktop
		3.4 --> Dependencies for building packages
		4 --> install install_geographiclib_datasets.sh for mavros
		5 --> see how to setup vpu HDDL
		6 --> install realsense
		7 --> find packages command
		"
read number
if [ "$number" == "" ];then
    echo "You don't input your number...."
    exit 5
fi

if [ "$number" == "1" ];then
    echo "install requestments of electron-ssr-0.2.6.deb, please download electron-ssr-0.2.6.deb first"
	sudo apt --fix-broken install -y
	cd ~/Downloads/
	sudo dpkg -i electron-ssr-0.2.6.deb
    exit 5
fi

if [ "$number" == "2" ];then
    echo "set git config https://127.0.0.1:1081"
	git config --global https.proxy https://127.0.0.1:1081
	git config --global http.proxy http://127.0.0.1:1081
    exit 5
fi


if [ "$number" == "3.1" ];then
    echo "Setup your sources.list"
	sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
	echo "Set up your keys"
	sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
	echo "sudo apt update" 
	sudo apt update

    exit 5
fi

if [ "$number" == "3.2" ];then
    echo "sudo apt install ros-melodic-desktop-full"
	sudo apt install ros-melodic-desktop-full
	echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
	source ~/.bashrc
    exit 5
fi


if [ "$number" == "3.3" ];then
    echo "sudo apt install ros-melodic-desktop"
	sudo apt install ros-melodic-desktop catkin
	echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
	source ~/.bashrc
    exit 5
fi


if [ "$number" == "3.4" ];then
    echo "Dependencies for building packages"
	sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
	sudo apt install python-rosdep
	sudo rosdep init
	rosdep update
    exit 5
fi


if [ "$number" == "4" ];then
    echo "install install_geographiclib_datasets.sh for mavros"
	# Script to install the model datasets required
	# to GeographicLib apply certain conversions

	if [[ $UID != 0 ]]; then
		echo "This script require root privileges!" 1>&2
		exit 1
	fi

	# Install datasets
	run_get() {
		local dir="$1"
		local tool="$2"
		local model="$3"

		files=$(shopt -s nullglob dotglob; echo /usr/share/GeographicLib/$dir/$model* /usr/local/share/GeographicLib/$dir/$model*)
		if (( ${#files} )); then
			echo "GeographicLib $tool dataset $model already exists, skipping"
			return
		fi

		echo "Installing GeographicLib $tool $model"
		geographiclib-get-$tool $model >/dev/null 2>&1
		
		files=$(shopt -s nullglob dotglob; echo /usr/share/GeographicLib/$dir/$model* /usr/local/share/GeographicLib/$dir/$model*)
		if (( ! ${#files} )); then
			echo "Error while installing GeographicLib $tool $model"
			return
		fi
	}

	# check which command script is available
	if hash geographiclib-get-geoids; then
		run_get geoids geoids egm96-5
		run_get gravity gravity egm96
		run_get magnetic magnetic emm2015
	elif hash geographiclib-datasets-download; then # only allows install the goid model dataset
		geographiclib-datasets-download egm96_5;
	else
		echo "OS not supported! Check GeographicLib page for supported OS and lib versions." 1>&2
	fi
    exit 5
fi


if [ "$number" == "5" ];then
    echo "setup vpu HDDL"
	echo "1. follow zzw method of lab website 
		  2. setup HDDL following : https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_linux_ivad_vpu.html
		  2.1 cd /opt/intel/openvino_2021//deployment_tools/inference_engine/external/hddl
		  2.2 ./install_IVAD_VPU_dependencies.sh	"
    exit 5
fi

if [ "$number" == "6" ];then
    echo "setup vpu HDDL"
    if [[ $(lsb_release -sc) == "xenial" ]]; then _python=python; _ros_dist=kinetic;
    elif [[ $(lsb_release -sc) == "bionic" ]]; then _python=python; _ros_dist=melodic;
    elif [[ $(lsb_release -sc) == "focal" ]]; then _python=python3; _ros_dist=noetic; fi
    echo _python:$_python
    echo _ros_dist:$_ros_dist
    sudo apt-key adv --keyserver hkp://keys.gnupg.net:80 --recv-key C8B3A55A6F3EFCDE
    sudo add-apt-repository "deb https://librealsense.intel.com/Debian/apt-repo $(lsb_release -cs) main"
    sudo apt-get update -qq
    sudo apt-get install librealsense2-dkms --allow-unauthenticated -y
    sudo apt-get install librealsense2-dev --allow-unauthenticated -y
	sudo apt-get install librealsense2-utils --allow-unauthenticated -y
    exit 5
fi


if [ "$number" == "7" ];then
    echo "view librealsense"
	dpkg -l | grep librealsense
	find / -name "realsense"
	echo "The 2.44.0 version works"
	echo "ii  librealsense2:amd64                        2.44.0-0~realsense0.4389                         amd64        Intel(R) RealSense(tm) Cross Platform API - runtime
ii  librealsense2-dev:amd64                    2.44.0-0~realsense0.4389                         amd64        Intel(R) RealSense(tm) Camera Capture API - development files
rc  librealsense2-dkms                         1.3.16-0ubuntu1                                  all          Modified kernel modules for librealsense2
ii  librealsense2-gl:amd64                     2.44.0-0~realsense0.4389                         amd64        Intel(R) RealSense(tm) - GLSL-enabled extensions
ii  librealsense2-net:amd64                    2.44.0-0~realsense0.4389                         amd64        Intel(R) RealSense(tm) - Network Bridge extension
ii  librealsense2-udev-rules:amd64             2.44.0-0~realsense0.4389                         amd64        Intel(R) RealSense(tm) Camera Capture API - udev rules
ii  librealsense2-utils:amd64                  2.44.0-0~realsense0.4389                         amd64        Intel(R) RealSense(tm) Camera Capture API - utils and demos
"
	echo "in 2.45.0 version, if you use #include<librealsense2/rs.hpp> to config pipeline ,something wrong happens 
			if you ls /dev/video* , you find there is no file, that meaning the program will occupy the video*, causing other programs can not utilize video, this is a 			bug"
	echo "sudo apt-get install realsense=2.44* to  specify the version."
    exit 5
fi


# first is electron-ssr-0.2.6.deb 
# echo "install requestments of electron-ssr-0.2.6.deb, please download electron-ssr-0.2.6.deb first"
# sudo apt --fix-broken install -y
# cd ~/Downloads/
# sudo dpkg -i electron-ssr-0.2.6.deb

# echo "setup git network"


# echo "install base command tools"
# sudo apt install git
# git config --global https.proxy https://127.0.0.1:1081
# git config --global http.proxy http://127.0.0.1:1081





# echo "sogou pinyin install"
# sudo apt install fcitx-bin -y
# sudo apt --fix-broken install -y
# sudo dpkg -i sogoupinyin_2.4.0.3469_amd64.deb

# cd /opt/intel/openvino_2020.4.287/deployment_tools/demo
#  ./demo_squeezenet_download_convert_run.sh -d HDDL
方便获取更多学习、工作、生活信息请关注本站微信公众号城东书院 微信服务号城东书院 微信订阅号
推荐内容
相关内容
栏目更新
栏目热门