sudo apt-get install xterm
sudo touch /usr/local/bin/systemupdate
sudo chmod +x /usr/local/bin/systemupdate
sudo nano /usr/local/bin/systemupdate
(add the following text)
#!/bin/bash
echo "System and Application Update in Progress..."
echo "Please enter the SUDO password to continue:"
read -s asdf878d09sd09d9
clear
echo "Initiating Mirror Update..."
echo "Please wait for the process to complete"
echo ""
echo "|#########> | 20%"
echo $asdf878d09sd09d9 | sudo -S apt-get -y update > /dev/null 2>&1
clear
echo "Mirror Update Successful!"
echo "Initiating System and Application Update..."
echo ""
echo "|###################> | 40%"
echo $asdf878d09sd09d9 | sudo -S apt-get -y update > /dev/null 2>&1
clear
echo "System and Application Update Successful!"
echo "Initiating Kernel Update..."
echo ""
echo "|#############################> | 60%"
echo $asdf878d09sd09d9 | sudo -S apt-get -y dist-upgrade > /dev/null 2>&1
clear
echo "Kernel Update Successful!"
echo "Initiating Cache Cleaning Procedure..."
echo ""
echo "|#######################################> | 80%"
echo $asdf878d09sd09d9 | sudo -S apt-get -y autoclean > /dev/null 2>&1 && echo $asdf878d09sd09d9 | sudo -S apt-get -y clean > /dev/null 2>&1
clear
echo "Cache Cleaning Successful!"
echo "Initiating Old Kernel Removal Procedure..."
echo ""
echo "|###############################################>| 99%"
echo $asdf878d09sd09d9 | sudo -S apt -y autoremove > /dev/null 2>&1
clear
echo "System is up to date!"
sleep 2
reset
exit 0
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
- also add the above script to cron job to check for updates once in every 2 days
su [[ to switch to root account ]]
crontab -e
(add this line)
0 0 */2 * * /usr/local/bin/systemupdate
sudo touch /usr/local/bin/addrepository
sudo chmod +x /usr/local/bin/addrepository
sudo nano /usr/local/bin/addrepository
(add the following text)
#!/bin/bash
echo "Adding external repository..."
echo "Please enter the SUDO password to continue:"
read -s asdf878d09sd09d9
clear
echo "Please provide the repository to add"
echo "example - "ppa:webupd8team/java""
read asdf878d77sd09d9
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release /etc/lsb-release2 > /dev/null 2>&1
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release.bkp /etc/lsb-release > /dev/null 2>&1
echo $asdf878d09sd09d9 | sudo -S add-apt-repository -y $asdf878d77sd09d9
clear
echo "Verifying the repository..."
sleep 1
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release /etc/lsb-release.bkp > /dev/null 2>&1
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release2 /etc/lsb-release > /dev/null 2>&1
clear
echo "Repository Successfully Added!"
sleep 1
reset
exit 0
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
sudo touch /usr/local/bin/softwaregtk
sudo chmod +x /usr/local/bin/softwaregtk
sudo nano /usr/local/bin/softwaregtk
(add the following text)
#!/bin/bash
echo "Software Update Properties..."
echo "Please enter the SUDO password to continue:"
read -s asdf878d09sd09d9
clear
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release /etc/lsb-release2 > /dev/null 2>&1
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release.bkp /etc/lsb-release > /dev/null 2>&1
echo "Launching Software Properties..."
echo "DO NOT CLOSE THIS TERMINAL"
echo $asdf878d09sd09d9 | sudo -S software-properties-gtk
clear
echo "Saving the settings..."
sleep 1
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release /etc/lsb-release.bkp > /dev/null 2>&1
echo $asdf878d09sd09d9 | sudo -S mv /etc/lsb-release2 /etc/lsb-release > /dev/null 2>&1
clear
echo "Changes saved!"
sleep 1
reset
exit 0
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
kernel-4.9.5 breaks vmware-workstation-12.5.2 modules. This script backs up the existing vmmon.tar and vmnet.tar in the /usr/lib/vmware/modules/source directory and copies a patched version of vmmon.tar and vmnet.tar files from /usr/local/data and recompiles the vmware modules. It has been already tested and working.
sudo touch /usr/local/bin/fixvmware
sudo chmod 777 /usr/local/bin/fixvmware
sudo nano /usr/local/bin/fixvmware
(add the following text)
#!/bin/bash
echo "Please enter the SUDO password to continue:"
read -s asdfasdfasdf001
clear
echo "Creating backup..."
sleep 1
echo $asdfasdfasdf001 | sudo -S mv /usr/lib/vmware/modules/source/vmmon.tar /usr/lib/vmware/modules/source/vmmon.bkp.tar > /dev/null 2>&1
echo $asdfasdfasdf001 | sudo -S mv /usr/lib/vmware/modules/source/vmnet.tar /usr/lib/vmware/modules/source/vmnet.bkp.tar > /dev/null 2>&1
clear
echo "Copying new modules..."
sleep 1
echo $asdfasdfasdf001 | sudo -S cp /usr/local/data/vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar > /dev/null 2>&1
echo $asdfasdfasdf001 | sudo -S cp /usr/local/data/vmnet.tar /usr/lib/vmware/modules/source/vmnet.tar > /dev/null 2>&1
clear
echo "Compiling VMware Modules"
sleep 1
echo $asdfasdfasdf001 | sudo -S vmware-modconfig --console --install-all
sleep 1
echo "If the above procedure did not throw any error, then launch vmware to confirm its working"
sleep 5
reset
exit 0
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
when the bootable media is created using SystemBack application, it creates an ISO image meant for read-only media like CD/DVD and so it empties the content of the file /usr/sbin/update-initramfs which is just a wrapper for the script /usr/sbin/mkinitramfs. This script makes a backup of the files /usr/sbin/{update-initramfs,mkinitramfs} and copies the working script from /usr/local/data/{update-initramfs,mkinitramfs}
sudo touch /usr/local/bin/fixinitramfs
sudo chmod 777 /usr/local/bin/fixinitramfs
sudo nano /usr/local/bin/fixinitramfs
(add the following text)
#!/bin/bash
echo "Please enter the SUDO password to continue:"
read -s asdfasdfasdf001
clear
echo "Creating backup..."
sleep 1
echo $asdfasdfasdf001 | sudo -S mv /usr/sbin/update-initramfs /usr/sbin/update-initramfs.bak > /dev/null 2>&1
echo $asdfasdfasdf001 | sudo -S mv /usr/sbin/mkinitramfs /usr/sbin/mkinitramfs.bak > /dev/null 2>&1
clear
echo "Copying new modules..."
sleep 1
echo $asdfasdfasdf001 | sudo -S cp /usr/local/data/update-initramfs /usr/sbin/update-initramfs > /dev/null 2>&1
echo $asdfasdfasdf001 | sudo -S cp /usr/local/data/mkinitramfs /usr/sbin/mkinitramfs > /dev/null 2>&1
clear
echo "Procedure Successful!"
sleep 1
reset
exit 0
(save and exit --> Ctrl-O, enter, Ctrl-X, enter)
To create a boot image use the following command set
sudo update-initramfs -u [-u to update the existing boot images]
sudo update-initramfs -c -k all [-c to create a new boot image, '-k all' for all available kernerl versions]
sudo update-initramfs -c -k 4.9.5-040905-generic [to create a new boot image for specified kernerl version]