1

I would like to install a lot of apps, and I has been saving all commands to install each app, here is a sample:

##Global

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys BBEBDCB318AD50EC6865090613B00F1FD2C19886 0DF731E45CE24F27EEEB1450EFDC8610341D9410
echo deb http://repository.spotify.com stable non-free | sudo tee /etc/apt/sources.list.d/spotify.list
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo add-apt-repository ppa:qbittorrent-team/qbittorrent-stable
sudo add-apt-repository ppa:otto-kesselgulasch/gimp

sudo apt-get update; sudo apt-get -y install indicator-multiload spotify-client sublime-text qbittorrent gimp virtualenv rar unrar postgresql pgadmin3 python-pip python-dev libmysqlclient-dev p7zip-full

##Kaggle

pip install kaggle
chmod 600 /home/username/.kaggle/kaggle.json

##Jdownloader

wget http://installer.jdownloader.org/JD2SilentSetup_x64.sh
chmod +x JD2SilentSetup*.sh
./JD2SilentSetup*.sh

##Teamviewer

sudo wget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb
sudo dpkg -i --force-depends teamviewer_amd64.deb
sudo apt-get install -f
sudo teamviewer --daemon start
teamviewer

How can I run all lines at once using scripting on bash command line? Thanks!

ambigus9
  • 111
  • 6
  • Did you save all those commands to a file? If so, you would just launch it with the command bash /path/to/filename – Terrance Mar 15 '18 at 02:15
  • Yes, in deep the file name and extension are: ubuntu.txt , So, I must just save it as .sh? or just bash ubuntu.txt? – ambigus9 Mar 15 '18 at 02:23
  • Extensions don't matter in Linux. You can make the file executable by running chmod +x filename but, you would have to add a line to the beginning stating what shell it is going to launch in. The first line of the file would have something similar to #!/bin/bash. However, you don't have to do that if you just put bash in front of it then it will try to run each line individually. So, yes, bash ubuntu.txt would work just fine. – Terrance Mar 15 '18 at 02:25
  • Perfect! And If the instalation of a few packages takes a lot of time (5 minutes to download) I need to enter my sudo password a lot of times? – ambigus9 Mar 15 '18 at 02:30
  • I think the timeout is 15 minutes on sudo. So, yes, you might have to if it takes longer than that. From my understanding though, each time it runs sudo starts the timer again, so you might only need it once. – Terrance Mar 15 '18 at 02:31
  • Ooops, I guess it is 5 minutes on the timeout, but you might still be OK. – Terrance Mar 15 '18 at 02:34

0 Answers0