Ali Mohamed Ali


Main

Options

Misc.

Posts by tag

art (1) | doodle (1) | elogind (1) | emacs (1) | email (1) | gnu (2) | image (1) | linux (2) | meta (1) | script (1) | sh (1) | slackware (1) | tech (5) | test (2) | time (1) | web (1)

(SlackGrab) A package-fetching+compiling tool for slackbuilds.org
<2026-09-12T08:27:55:00+03:00> :tech:linux:slackware:script:sh:

Table of Contents

#!/bin/sh -e

PWD=$(pwd)
cd $PWD

while IFS="" read -r task || [ -n "$task" ]
do
  PKGNAME="$(echo $task | cut -d\; -f1 -)"
  PKGSLKB="$(echo $task | cut -d\; -f2 -)"
  PKGSRC="$(echo $task | cut -d\; -f3 -)"

  wget "$PKGSLKB"
  tar -xvf "$PKGNAME.tar.gz" \
  && cd $PKGNAME;
  wget $PKGSRC

  removepkg $(ls /var/lib/pkgtools/packages/$PKGNAME-* || true) || true
  ./$PKGNAME.SlackBuild && installpkg /tmp/$(ls -1 /tmp | grep -e "$PKGNAME-");

  cd ..
done < $1

It's no package manager, of course, but this script that I wrote was useful enough to grab packages in bulk and automatically compile and install them if I needed.

It's called slackgrab.sh, and it works with a specific file format .tskf.

In the file, you might a line for a package with its slackbuild name, its slackbuild download link, and its source link(on slackbuilds.org). It's a table row essentially.

The script will go through each line in order and install that package by downloading the slackbuild, unpacking it, downloading the source within, and then compiling and installing from there on with the installpkg tool.

Of course, it does take some time to expand the dependencies of a package and manually find its source files, but at least the automatic work of getting a package set up or not is done!

1. An Aside

I do know that there is a tool called sbotools, sbo… for grabbing things from the slackbuilds servers for sources and stuff that can automatically manage dependencies. Nevertheless I didn't know about that while I was writing the script, and I would not have written it had I known.

I did get interested in more advanced systems of package management, and wanted to see how far I could get to learn debian packages. I know enough about the debian package management system which is that there are automatic build servers that create those packages, put them in the archive for different architectures, which you fetch when you run apt upgrade.

But in the very basic level, a package itself is just a compressed collection of files that get installed, and might have metadata. Slackware doesn't have so much metadata besides what's in the package filename and the description, version, author. Automatic dependency handling doesn't exist because slackware was made in a time with low infrastructure. I guess I could only describe slackware as a low-infrastructure linux.

2. Switching to debian?

Yes, again.

I know how I would get the sysvinit installed, and now I should bother to go back and learn to put the systemd packages as low priority. There are lots of easy libraries I can pick up, and I don't need to waste time compiling to get my favourite softwares.

Last I checked on the package repository for debian, they have most of the packages that I use, and I did not need to compile. However for any newer versions I will have to write my own packages in debian, so that would be interesting :::) and also not very difficult as I've done my fair share of package compilations, etc.

Authored by Ali Mohamed Ali <someguyshutup5@gmail.com>
Licensed under CC-BY-SA 4.0 (except where noted otherwise)
Refresh this page!