Post Installation Application install shell script?

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
rajeev2631007

Post Installation Application install shell script?

Post by rajeev2631007 »

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
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Distro-Don

Re: Post Installation Application install shell script?

Post by Distro-Don »

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

Re: Post Installation Application install shell script?

Post by bluethirdup »

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

Re: Post Installation Application install shell script?

Post by rajeev2631007 »

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

Re: Post Installation Application install shell script?

Post by bluethirdup »

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

Re: Post Installation Application install shell script?

Post by rajeev2631007 »

Thanks you Mr. bluethirdup for your help.

Regards,

Rajeev Gautam
bluethirdup

Re: Post Installation Application install shell script?

Post by bluethirdup »

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

Regards,

Rajeev Gautam
You are welcome Rajeev!
Locked

Return to “Scripts & Bash”