[HOW TO] UPDATE AND UPGRADE SCRIPT - update & upgrade your whole system using this bash script I wrote

I wrote an update script to update and upgrade the whole system including flatpaks with the option to reboot the system at the end. Dependencies is neofetch and flatpaks perfect for Pro editions but can be used for non Pro.

Just comment out # what you don't need in the script. To use copy over to your home folder and run sudo bash update.sh in ther terminal but make sure file is marked as executable. I have attatched images below.

I hope this helps others as much as it helps me :grinning:
https://drive.google.com/file/d/1f6_nm7iVgYzUsnBVopeoDjfhB4Tkik5L/view?usp=sharing






1 Like

If anyone has any problems feel free to let me know :grinning:
If urgent twitter is your best bet at https://twitter.com/justincroser

I think it would be nice if you could share the script over GitHub or similar. That way we can examine the script without having to download anything.

You can view the script in a default text editor on the OS once downloaded if you don't want to run it. I may create a GitHub account if I make more scripts as I only have the one so far

1 Like

There are a lot of members that have a difficult time following links to personal drives. Anything could be on the other side (no offense intended). It may be beneficial for all if you would paste the script into the code option of markdown, available in every post to the site. This is the recommended way to share code/scripts if github is not viable.

To ensure we consider others and their right to both privacy as well as their opinion, you may want to edit your original post with the script, as was done in the lounge for the python scripts.

1 Like

Agreed, it's a habit for me to not download random stuff from the internet without at least having the chance to examine it before hand. I really think more people should familiarize themselves with that, as it's one of the most common forms to download malware in your computer. Not to mention the privacy aspect.

In this case though, I was asking mostly for the source code out of convenience. It's just a lot easier to read and find the code when it's posted online.

I just have this function in my .zshrc that does the exact same thing:

function update(){
sudo apt update
sudo apt upgrade
flatpak update
}

You can copy paste the above code in your .bashrc file.

Then, it's a simple command: update in your terminal to update flatpaks and apt packages.

Seeing as everyone has a problem this is the full script

#!/bin/bash

#Assumes you have Neofetch / Flatpaks / Piholes installed. Comment out whats not needed

#Don't forget to CHMOD + x this file to make it executable but I should've already done that for you'.

#Made by Justin Croser https://justincroser.net I am not responsible for any breakages use at your own risk however I doubt it will be a problem with the script except an distribution update / dependancy issue' 

#Debian based servers
apt update
apt upgrade -y
#I like a clean system, but these may or may not be helpful.
apt autoclean -y
apt autoremove -y

#Fedora/Redhat machines
#dnf update -y

#Updates Flatpaks
flatpak update -y

#Updates Pihole if you have one
#pihole -up

#Ask if user wants to reboot the systm? Useful for home servers
read -r -p "Reboot? [Y/n] " input
case $input in
	[yY][eE][sS]|[yY])
		echo "You have opted to reboot!"
			systemctl reboot -i
			;;
	[nN][oO]|[nN])
		echo "You will not reboot right now!"
		neofetch
			exit 1
			;;
	*)
		echo "Invalid input..."
		neofetch
		exit 1
		;;
esac

I will not help in the future. - Justin

It is understandable that different views on how to approach file sharing can be frustrating at times.
That is a great script, @justinc - thanks for sharing.

Exploring the control at your disposal with scripting is great development and practice.
Please keep in mind that it is a helpful suggestion to provide a means of reviewing scripts prior to downloading.

1 Like

Justin - I think that is a bit of an overreaction to what I read as constructive comment. I hope you will reconsider as your contribitions are appreciated.

3 Likes

I second this sentiment. :slight_smile:
We all feel unappreciated from time to time.

I third that.

When I make my icon themes I always include link to github so people can examine my work, so don't take offense off it. See it as a people are interested in it :slight_smile:

2 Likes