C linux development

From Teknologisk videncenter
Revision as of 09:39, 6 January 2023 by Heth (talk | contribs)
Jump to: navigation, search

Debian based distro

Probably more packages than you need... Copy and paste the text below into your privileged shell session. (sudu bash first)

  • Run apt update and apt upgrade first!
  • (Read first and check security riscs)
cd ~; cat << 'EOF' > updatescript
#!/usr/bin/env bash
LIST="build-essential manpages-dev glibc-doc dpkg-dev linux-doc
        user-mode-linux-doc libssl-dev docbook docbook-xml
        docbook-xsl xsltproc libsystemd-dev libcjson1 libltdl-dev
        libcjson-dev"
LOGFILE="./apt-install.log"
echo "" > $LOGFILE
DIRTY=0

for PACK in $LIST
do
        printf "Installerer %s\n" $PACK
        if apt -y install $PACK
        then
                printf "Package %s OK\n" $PACK >> $LOGFILE
        else
                printf "Package %s FAILED......................\n" $PACK >> $LOGFILE
                let DIRTY=DIRTY+1
        fi
done
printf "\n\n**************************************************\n"
if test $DIRTY -eq 0
then
        printf "Seems all look good - all packages OK\n"
else
        printf "ERROR: %d packages failed - see logfile: %s\n" $DIRTY $LOGFILE
fi
printf "**************************************************\n"
EOF
chmod +x updatescript
sudo  ./updatescript