Sudo package installer

making your package search and installation easier when you are working across a instance, slurm or pbs high performance computing cluster.

#!/usr/bin/env bash
# -*- coding:  utf-8 -*-
# Universität Potsdam, Germany
# Author: Gaurav Sablok
# date: 2024-1-16

read -r -p "please input the package to be listed:" package
read -r -p "please provide the password:" password
for i in $(sudo apt-cache search "${package}" | grep ^"${package}" | cut -f 1,2 -d "-")
        do 
                echo sudo apt-get install $i
       done
echo "thank you updating the instance"

alles gut,
Gaurav

1 Like

The instructions differ on debian installation because sudo and apt get repository are for Ubuntu users. If you are Almalinux or Rocky Linux the things will differ for installation. There is yum installer instead.

@saoussen5765 i know that i am releasing a new one and with more package in-built and coded in RUST so that you can invoke any shell and any instance and also on the terraform, kubernetes and anything. If you want to do it in shell, just finished the updated code:

#!/usr/bin/env bash
# -*- coding:  utf-8 -*-
# Universität Potsdam, Germany
# Author: Gaurav Sablok
# date: 2024-1-17

echo "a shell simulator and python configurator for the new system"
echo "thank you for using the shell simulator for system integration"
read -r -p "please provide the path to the previous pip installation file:" install
read -r -p "please provide the option for the configure:" shell
read -r -p "please provide the pakcage to search for the debian repo:" repo
if [[ "$install" eq 0 ]]
then 
    echo "please prepare a file using the pip3 freeze"
    echo "pip3 list freeze >> pip3install.txt"
fi 
if [[ "$install" == "yes" ]] 
then
    uname -a 
    pip3 list freeze >> pip3install.txt
fi
if [[ "${shell}" == "bash" ]]
then 
    read -r -p "plesae provide the password for the user"
    for i in $(sudo apt-get cache search "$repo" \
                        | grep ^"${repo}" | cut -f 1,2 -d "-")
    do 
        sudo apt-get install $i -y
    done  
fi
if [[ "${shell}" == "python" ]]
then 
    read -r -p "please provide the path to the pip3 file:" file
    if [[ -z "${file}" ]]
    then 
        echo "getting all the files for the instance"
        for i in $(sudo apt-cache search python \
                        | grep ^python | cut -f 1,2 -d "-")
        do 
            sudo apt-get install $i
        done
else 
    echo "thank you, you have neither used the shell stimulator neither you have used the python simulator"
fi

you can make modifications if you want it now or you can see the updated git repository with the RUST crate.

alles gut,
Gaurav

2 Likes

This is cool. Thanks!

@devdev thank you. I am releasing a RUST crate soon and you can invoke that on any instance, any cloud and any running high performance computing cluster.