# **osupdater** ## **ABOUT** A terminal rust application for figuring out what package manager(s) are present on your system and use them to update your software packages. This is for my educational purposes of learning rust to do tasks that I have done successfully in either bash or C/C++. Feel free to snatch this up or not. ## **FILES** | File | Function | | :--| :-- | | ./antiquated/ | bash & python source | | ./osupdater/ | rust source | | ./rust_build_osupdater.sh | bash script to build the source | ## **TESTED ENVIRONMENTS** Currently I start on distributions that I do not have a live environment to use or a VM, I will use distrobox. Then ss time permits, I use VMs to test. Consider distrobox tests as the lowest grade pass, then VMs and native tests. Trusted contributors will count as a passed/failed contributor test. |DISTRIBUTION|PERSONALLY TESTED|CONTRIBUTOR TESTED| | :-- | :-- | :-- | |Arch|distrobox|no| |Debian / Ubuntu|distrobox|no| |OpenMandriva / Mageia|no|no| |RHEL / Fedora|yes|yes| |SuSE/ OpenSuSE|yes|no| |CONTAINER TYPE|PERSONALLY TESTED|CONTRIBUTOR TESTED| | :-- | :-- | :-- | |Flatpak|yes|no| |Snap|yes|no| |OTHER TOOLS|PERSONALLY TESTED|CONTRIBUTOR TESTED| | :-- | :-- | :-- | |Python via pip-review|yes|no| ## **COMPILING** To compile the application you will need to have rust and cargo installed. ### **ARCH & DERIVATIVES** ``` sudo pacman -Sy rust rustup default stable ``` ### **DEBIAN & DERIVATIVES** The [official documentation from Debian](https://wiki.debian.org/Rust) states one can either install the apt packages or use the [official rustup installer](https://www.rust-lang.org/tools/install). Using apt packages: ``` sudo apt update sudo apt upgrade sudo apt install rustc cargo rustfmt ``` Using rustup: ``` sudo apt update sudo apt upgrade sudo apt install curl build-essential gcc make curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` The final command above will pull in and run the installer. Follow the prompts on screen. ### **OPENMANDRIVA/MAGEIA (UNTESTED) ``` sudo urpmi update sudo urpmi install gcc curl make curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ### **RHEL/FEDORA** ``` sudo dnf install rust cargo -y ``` ### **SUSE/OPENSUSE** The [official documentation from OpenSuSE.org](https://en.opensuse.org/Rust) states to use rustup, so here it is: ``` sudo zypper install rustup && rustup toolchain install stable ``` ## **OSUPDATE ACQUISITION, COMPILATION AND USAGE** The current scope and intended use of the tool is: * Not to be run as root -- be a privileged user. * Currently custom parameters, logging, and other useful fancy stuff is not implemented. It will be, but not now. * The testing has been done in a limited fashion. I have several Workstations, Laptops, VMs, VPS's, and contributors that are able to validate things. The testing matrix above has the details, play in a VM if your platform is untested (notably arch). I test first in distrobox, then if things work a VM or a contributor report. * If you have any doubts as to what the hell is going on under the hood, look at the source or look at the bash or python versions. If the parameters are too conservative or aggressive -- edit the source or wait until I get custom parameters implemented. ### **GETTING SOURCE AND COMPILATION** In order to use the application the source must be downloaded and then compiled. ``` git clone https://git.schotty.com/andrew/osupdater cd osupdater ./rust_build_osupdater.sh ``` If the rust toolchain is installed it will build the binary for your currently running platform. If you run into issues, follow the above instructions for your platform. If the platform is not listed, file a bug report for inclusion. If the above instructions are insufficient, file a bug report and I can update them to include any missing instructions and/or caveats ### **RUNNING OSUPDATE** Running the application is as simple as executing the ouput binary located at **osupdater/target/release/osupdater** Depending on tastes, you can copy said binary to ~/.local/bin or any other location that is in your PATH. The application will output whatever it does, and ignore any package managers that are not present on your system. ## **NOTES** ### **DISTROBOX CONTAINERS USED FOR TESTING** #### **USING DISTROBOX** Starting container: ``` distrobox-create --name CONTAINER_NAME --image IMAGE_URI distrobox-enter CONTAINER_NAME ``` Stopping container: ``` podman stop CONTAINER_NAME podman rm CONTAINERF_NAME ``` #### **CONTAINER URI'S** Arch: * quay.io/toolbx/arch-toolbox:latest Debian: * quay.io/toolbx-images/debian-toolbox:latest * quay.io/toolbx/ubuntu-toolbox:latest RHEL/Fedora: * quay.io/toolbx-images/almalinux-toolbox:latest * registry.fedoraproject.org/fedora-toolbox:40 * quay.io/toolbx-images/rhel-toolbox:latest SuSE/OpenSuSE: * registry.opensuse.org/opensuse/distrobox:latest