Post Installation Application install shell script?

Forum rules
Before you post please read how to get help
Post Reply
rajeev2631007
Level 1
Level 1
Posts: 30
Joined: Wed Sep 16, 2015 2:20 am

Post Installation Application install shell script?

Post by rajeev2631007 » Wed Sep 16, 2015 3:17 am

Hi Everybody,

I'm looking for bash scripts which help me to install my sets of application on one click which I need to install on after every new installation of Linux mint. This script should not ask for installation confirmation after every application. I also want to know how to make it executable and edit if want to add more application in this script. I don't know much about bash scripts right now. I had goggled and find this script as below:-

#!/bin/sh
apt-get update # To get the latest package lists
apt-get install <package name> -y
#etc.


But I don't know how to make it dynamic with multiple of application. How to define variable and mentioned all app their and use that variable with apt-get install <Package Name>. or there is any other better way to write this. I request you please help me out in this.

Regards,

Rajeev Gautam

Distro-Don
Level 3
Level 3
Posts: 149
Joined: Thu May 23, 2013 8:43 pm

Re: Post Installation Application install shell script?

Post by Distro-Don » Wed Sep 16, 2015 11:01 am

This is how I do mine.

#!/bin/bash
# ezup.sh (Distro-Don's Program to easily setup a new installation my way)
sudo aptitude update # Update all repositories.
sudo aptitude -y safe-upgrade # Safely upgrade system.
sudo locale-gen --purge no-archive # Generate Locale languages files.
sudo aptitude -y install deborphan dolphin gftp gnome-schedule gparted numlockx nfs-kernel-server nfs4-acl-tools
sudo rsync -Cav /archives/trim /etc/cron.daily # Set trim to be run daily.
sudo mv .mozilla DeleteME # Remove .mozilla to allow my version to be linked.
sudo rmdir * # Remove directories to allow my versions to be linked.
sudo ln -s /archives/Moneydance /opt # Symlink Moneydance to /opt.
sudo ln -s /archives/Data/* /home/don/ # Symlink directories to my home dir.
sudo ln -s /archives/Data/.* /home/don/ # Symlink my hidden directories to my home dir.
sudo chown -R don:don /home/don # Set ownership of all /home/don files to me.
sudo orphaner # Remove all orphaned files.
rsync -Cavz /etc/fstab ./TEMP # These lines are added to fstab
echo "# tmpfs for (some) temp and logs" >> ./TEMP # because I have a solid state
echo "tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0" >> ./TEMP # drive. These lines redirect
echo "tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0" >> ./TEMP # temporary writes to memory
echo "tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0" >> ./TEMP # instead of writing to the SSD
sudo rsync -Cavz ./TEMP /etc/fstab # therby extending its life.
rm TEMP # Remove unneeded file.
gnome-schedule # Arrange for Data backups.

bluethirdup
Level 1
Level 1
Posts: 22
Joined: Sun May 24, 2015 6:27 pm

Re: Post Installation Application install shell script?

Post by bluethirdup » Wed Sep 16, 2015 11:09 am

This is a part of my install.sh that I use to install applications on a fresh install.

Code: Select all

#!/bin/bash

#

sudo apt-get update

#Wine

sudo apt-get install wine winetricks ttf-mscorefonts-installer -y

#xbacklight

sudo apt-get install xbacklight -y

#Multimedia

sudo apt-get install audacity audacious openshot frei0r-plugins winff -y

sudo add-apt-repository ppa:clipgrab-team/ppa -y
sudo apt-get update
sudo apt-get install clipgrab -y


#Oracle java 7/8

sudo add-apt-repository ppa:webupd8team/java -y
sudo apt-get update
sudo apt-get install oracle-java7-installer -y


#Sublime-Text-3:

sudo apt-get install sublime-text -y

#Atom

sudo add-apt-repository ppa:webupd8team/atom -y
sudo apt-get update
sudo apt-get install atom -y

#Nodejs with dependencies

sudo apt-get install curl git -y
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs

For variables you can do

Code: Select all

x=1 #no spaces
echo $x #use $ to get the value  

rajeev2631007
Level 1
Level 1
Posts: 30
Joined: Wed Sep 16, 2015 2:20 am

Re: Post Installation Application install shell script?

Post by rajeev2631007 » Thu Sep 17, 2015 1:11 am

Thanks for reply. After Reading your post I came to know,I can use this script as below:-

#!/bin/sh
LIST_OF_APPS="wine winetricks ttf-mscorefonts-installer xbacklight audacity audacious openshot frei0r-plugins winff clipgrab sublime-text"

sudo apt-get update
sudo apt-get install -y $LIST_OF_APPS


Please correct me if I'm wrong.

Regards,

Rajeev Gautam

bluethirdup
Level 1
Level 1
Posts: 22
Joined: Sun May 24, 2015 6:27 pm

Re: Post Installation Application install shell script?

Post by bluethirdup » Thu Sep 17, 2015 6:18 am

You are right.
As a note do not forget to add your ppa's first.

rajeev2631007
Level 1
Level 1
Posts: 30
Joined: Wed Sep 16, 2015 2:20 am

Re: Post Installation Application install shell script?

Post by rajeev2631007 » Thu Sep 17, 2015 7:59 am

Thanks you Mr. bluethirdup for your help.

Regards,

Rajeev Gautam

bluethirdup
Level 1
Level 1
Posts: 22
Joined: Sun May 24, 2015 6:27 pm

Re: Post Installation Application install shell script?

Post by bluethirdup » Thu Sep 17, 2015 8:09 am

rajeev2631007 wrote:Thanks you Mr. bluethirdup for your help.

Regards,

Rajeev Gautam
You are welcome Rajeev!

Post Reply

Return to “Scripts & Bash”