Offline software archiver

Forum rules
Before you post please read how to get help
Post Reply
User avatar
Level 3
Level 3
Posts: 133
Joined: Wed Dec 31, 2014 6:25 pm

Offline software archiver

Post by Mintmag » Sun Jul 16, 2017 9:02 am

Hi there, so I've been working on this for a while now and would like to know what you guys think. I wrote a script in bash designed to make installing and running Mint offline or isolated much easier. Here's the script in question.

Debs for nividia drivers and crossover are included because I use those, but it should be easy to edit in and out the things you like. This script is meant for either fresh installs or live sessions of Linux Lint 18.2 Cinnamon.

Code: Select all

# Message to users
echo "Use this script on either a freshly installed or live iso. Also you might want to switch to a local mirror"
# Main Folder name: "deb-mint-cin-18.2" 

# Creating main folder
cd ~/Desktop
sudo rm -vr deb-mint-cin-18.2
mkdir -p deb-mint-cin-18.2
cd ./deb-mint-cin-18.2

# Adding PPAs for Dolphin and Nvidia
sudo add-apt-repository ppa:dolphin-emu/ppa -y 
sudo add-apt-repository ppa:graphics-drivers/ppa -y

# Updating the system.
sudo apt-get update
sudo apt-get -o dir::cache::archives="./" -d dist-upgrade -y

# Grabbing codecs
sudo apt-get install mint-meta-codecs -y

# Getting apps
sudo apt-get -o dir::cache::archives="./" -d install --install-recommends \
vlc \
audacity \

# Installing UK languge pack for Libreoffice
sudo apt-get -o dir::cache::archives="./" -d install --install-suggests libreoffice-help-en-gb -y

# Downloading packages from PPAs
sudo apt-get -o dir::cache::archives="./" -d install --install-recommends \
nvidia-384 \
dolphin-emu-master \
# Cinnamon themes

# Mint X Mod

# Mint Y Dark Blue

# Win 10 Light

# debs for Crossover 
# To know what the debs are install crossover with sudo gdebi crossover
sudo apt-get -o dir::cache::archives="./" -d install gcc-5-base:i386 gcc-6-base:i386 libavahi-client3:i386 libavahi-common-data:i386 libavahi-common3:i386 libbsd0:i386 libc6 libc6-dbg libc6:i386 libcomerr2:i386 libcups2:i386 libdbus-1-3:i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386 libexpat1:i386 libffi6:i386 libfreetype6:i386 libgcc1:i386 libgcrypt20 libgcrypt20:i386 libgl1-mesa-dri:i386 libgl1-mesa-glx:i386 libglapi-mesa:i386 libglu1-mesa:i386 libgmp10:i386 libgnutls-openssl27 libgnutls30 libgnutls30:i386 libgpg-error0:i386 libgssapi-krb5-2:i386 libhogweed4:i386 libidn11:i386 libk5crypto3:i386 libkeyutils1:i386 libkrb5-3:i386 libkrb5support0:i386 liblcms2-2:i386 libllvm3.8:i386 liblzma5:i386 libnettle6:i386 libp11-kit0:i386 libpciaccess0:i386 libpcre3:i386 libpng12-0:i386 libselinux1:i386 libstdc++6:i386 libsystemd0:i386 libtasn1-6 libtasn1-6:i386 libtinfo5:i386 libudev1:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxcursor1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386 libxfixes3:i386 libxi6:i386 libxrandr2:i386 libxrender1:i386 libxshmfence1:i386 libxxf86vm1:i386 zlib1g:i386 libnss-mdns:i386 \

# Moving files to pacakge 
sudo tar -cvf Pkgs.tar *.deb *.zip *.gz --remove-files

# remving lock and partial
sudo rm -vr partial lock

# creating installer script
echo "#!/bin/bash

# Main address: '~/Desktop/TEMP'

# Making temp directory
sudo rm -vr ~/Desktop/TEMP
mkdir -v ~/Desktop/TEMP

# Moving packages to directory
sudo tar -xvf Pkgs.tar -C ~/Desktop/TEMP

# Moving command into directory
cd ~/Desktop/TEMP

# Installing packages (this is not a typo, this must be done twice)
sudo dpkg -i *.deb 
sudo dpkg -i *.deb

# Instralling themes
mkdir ~/.themes
unzip '*.zip' -d ~/.themes
tar -xvf 167869-mint-x-mod-bundle.tar.gz
cp -vr ~/Desktop/TEMP/mint-x-mod-bundle/mint-x-mod ~/.themes

# Deleting what's left.
cd ..
sudo rm -vr ./TEMP" >> ./
sudo chmod +x ./

User avatar
Level 1
Level 1
Posts: 48
Joined: Fri Sep 21, 2018 8:58 pm

Re: Offline sotware archiver

Post by T_Characht3r » Mon Nov 12, 2018 3:53 pm

Looks good! (don't take my word for it though). :)
Don't 'Wine' about emulating Windows.
if your problem has been solved, please edit your original post and add [SOLVED] to the beginning of the Subject Line.

User avatar
Level 4
Level 4
Posts: 383
Joined: Sun Mar 29, 2015 4:08 pm

Re: Offline software archiver

Post by ganamant » Wed Apr 03, 2019 8:38 am

I have a few suggestions:
  1. Instead of making multiple sudo calls from within the script, run the script itself as root. If you add the following code at the head of the script, the script will abort unless you invoke it as root.

    Code: Select all

    if [[ $EUID -ne 0 ]] ; then
        >/dev/stderr echo "This script must be run as root.
        exit 1
  2. Instead of hard-coding things like ppa:dolphin-emu/ppa, group them into an array constant at the head of the script and loop through that array. That way it will be easier to add or remove things later, to fix typos, etc.

    Code: Select all

    And later, you can call:

    Code: Select all

    for i in ${PPA_ARRAY[@]}; do
        add-apt-repository $i -y

Post Reply

Return to “Scripts & Bash”