I made a script. It is a tool designed to ensure the optimal performance and security of my system. This script automates the process of updating my system by executing a series of essential tasks. It refreshes the package list, downloads, and installs available updates, and efficiently removes outdated packages and obsolete configuration files.
Can you please check it out and let me know what you think?
Thanks in advance.
The address is
Usage
Download the file.
Make it executable with the command.
chmod +x mysystemhealth
You can run it using the command
sudo ./mysystemhealth
You can also put it to /usr/bin and run it as a command.
PS: If it is not the right discussion category, can you please move it to the right one? Thanks
If you remove -y you have some chances to interfere if needed. Otherwise it will brake your system as soon it removes a dependency where you really need for your system (as @vekruse already mentioned ).
Make sure the user is NOT root before using rather forcing the user to be root. Most commands in the script use sudo regardless so it is not needed.
The reaaon the first point is needed is because flatpaks are not meant to be updated in root. So it might be a good idea to remove the sudo from the flatpak commands. If you donāt have to use root for something, itās probably better to not use root for said thing.
As others have mentioned, appending ā-yā to the autoremove command can be dangerous. Iām not sure what else you could to keep the functionality without requiring user input though.
It seems like it would remove all kernels except the one actually running at that point and overrides the dnf config of installonly_limit=3 which is the default.
I just did a test of that and it would actually remove every kernel installed except the one actually running at that time, including the newer one just installed by doing a ādnf upgradeā. That part seems very dangerous to me and probably should not be included.
It also would remove (on my system) all these āunused dependenciesā ā many of which are required.
VirtualBox-kmodsrc noarch 7.0.10-1.fc38 @rpmfusion-free-updates 906 k
fakeroot x86_64 1.31-1.fc38 @fedora 158 k
fakeroot-libs x86_64 1.31-1.fc38 @fedora 134 k
http-parser x86_64 2.9.4-8.fc38 @fedora 100 k
kernel-devel-matched x86_64 6.4.7-200.fc38 @System 0
kmodtool noarch 1.1-7.fc38 @fedora 28 k
koji noarch 1.33.0-1.fc38 @updates 816 k
libgit2 x86_64 1.6.4-1.fc38 @updates 1.2 M
python3-babel noarch 2.11.0-2.fc38 @fedora 29 M
python3-decorator noarch 5.1.1-5.fc38 @fedora 83 k
python3-gssapi x86_64 1.7.3-4.fc38 @fedora 2.3 M
python3-koji noarch 1.33.0-1.fc38 @updates 2.2 M
python3-progressbar2 noarch 3.53.2-7.fc38 @fedora 269 k
python3-pygit2 x86_64 1.12.2-1.fc38 @updates 1.1 M
python3-pytz noarch 2023.3-1.fc38 @fedora 234 k
python3-requests-gssapi noarch 1.2.3-7.fc38 @fedora 63 k
python3-rpmautospec noarch 0.3.5-1.fc38 @fedora 143 k
python3-utils noarch 3.3.3-2.fc38 @fedora 144 k
rpmdevtools noarch 9.6-3.fc38 @fedora 214 k
xorg-x11-drv-nvidia-kmodsrc x86_64 3:535.86.05-1.fc38 @rpmfusion-nonfree-updates-testing 47 M