Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-18-2005, 07:21 PM   #1
Registered: Dec 2004
Location: The Woodlands, Texas
Distribution: Slackware, Archlinux, CentOS
Posts: 186

Rep: Reputation: 29
Slackware Linux with pkgsrc Packages [gentoo-like Slack]

Due to an email I sent, Martti Kuparinen updated his site to Slackware 10.2.

Slackware Linux with pkgsrc Packages

Last updated $Date: 2005/12/18 11:15:01 $

Martti Kuparinen <>

Most Linux distributions today install a huge set of applications and services which are never used. The author comes from the NetBSD camp where everything is kept simple and secure by default while it is made easy to install additional software from the NetBSD Package Collection. Like the NetBSD system itself, pkgsrc is a portable framework for building third-party software on NetBSD and other UNIX-like systems This article describes how to make a minimalistic Slackware Linux installation and install most of the user applications like Mozilla and XFce from the pkgsrc.
Table of Contents

1. Introduction
2. Initial install
3. Bootstrapping pkgsrc
4. Updating Slackware packages
5. Known problems
6. Using pkgsrc

1. Introduction

I wrote this article as I needed Linux at work but I wasn't happy with the standard Linux package management frameworks. I have used several Linux distributions such as RedHat and Gentoo but I have always preferred the NetBSD pkgsrc as a software installation system. I have used Linux since the early 1990's (remember all those Slackware floppies?) and in my search of the best Linux distribution I found Slackware to be the best for me.
2. Initial install

We start by installing Slackware Linux normally. After installation we take a look at the installed packages and remove everything which is not needed with the removepkg command. Please remember that we will install most of the applications from pkgsrc. At this point we should not remove CVS, SSH or OpenSSL as those are needed to bootstrap the pkgsrc. The following example shows what packages are left from the original Slackware distribution. I found this set to be the minimum requirement for daily use. Note that this means we need to compile our own kernel as the original Slackware kernel packages are no longer used.

# removepkg tcsh
# ls /var/adm/packages/
aaa_base-10.1.0-noarch-2     diffutils-2.8.1-i386-1         grep-2.5-i386-2               pkgtools-10.1.0-i486-4
aaa_elflibs-10.1.0-i486-1    e2fsprogs-1.35-i486-1          groff-1.17.2-i386-3           procps-3.2.3-i486-1
bash-3.0-i486-2              etc-5.1-noarch-9               gzip-1.3.3-i386-2             sed-4.0.9-i486-2
bc-1.06-i386-2               findutils-4.1.7-i386-1         kbd-1.12-i486-2               shadow-4.0.3-i486-11
bin-9.2.0-i486-2             gawk-3.1.4-i486-1              lilo-22.5.9-i486-2            slocate-2.7-i486-3
binutils-  gcc-3.3.4-i486-1               logrotate-3.6.8-i486-1        sysklogd-1.4.1-i486-9
bzip2-1.0.2-i486-5           gcc-g++-3.3.4-i486-1           make-3.80-i386-1              sysvinit-2.84-i486-51
coreutils-5.2.1-i486-1       gettext-0.14.1-i486-1          man-1.5m2-i486-1              tar-1.15.1-i486-1
cxxlibs-5.0.6-i486-1         glibc-2.3.4-i486-1             man-pages-1.64-noarch-1       tcpip-0.17-i486-31
devs-2.3.1-noarch-21         glibc-solibs-2.3.4-i486-1      module-init-tools-3.1-i486-1  util-linux-2.12p-i486-1
dhcpcd-1.3.22pl4-i386-1      glibc-zoneinfo-2.3.4-noarch-1  ncurses-5.4-i486-2

We have now a minimalistic Slackware installation. The host should be configured now before we continue with this document. Things we might want to configure include lpd, ntpd and NFS and NIS.

Next we get the Linux kernel sources and fix the required symlinks in /usr/include.

# cd /usr/src
# ftp
ftp> cd /pub/mirrors/
ftp> dir LATEST*
ftp> bin
ftp> get linux-2.4.32.tar.bz2
ftp> bye

# tar xjf linux-2.4.32.tar.bz2
# ln -s linux-2.4.32 linux

# cd /usr/include
# rm -rf asm* linux
# ln -s /usr/src/linux/include/linux
# ln -s /usr/src/linux/include/asm-i386
# ln -s asm-i386 asm
# ln -s /usr/src/linux/include/asm-generic

Now it is time to compile a new kernel and make it bootable by modifying /etc/lilo.conf. It should be possible to remove the Slackware-installed kernel and kernel modules.

# cd /usr/src/linux
# make menuconfig
# make dep
# make bzImage && make modules && make modules_install
# cp arch/i386/boot/bzImage /boot/bzImage-2.4.32
# cp /boot/
# vi /etc/lilo.conf
# lilo

3. Bootstrapping pkgsrc

Next we need to bootstrap the pkgsrc. In this example we get the source files with CVS so we need to make sure we have the operating system's CVS package installed (from the Slackware distribution CD-ROM). First we need to configure our CVS client to use SSH and be quiet. This can be done with the following commands.

# echo export CVS_RSH=ssh >> /root/.bash_login
# echo cvs -q >> /root/.cvsrc

Next we need to get the pkgsrc, install and configure the pkgsrc management tools.

# cd /usr
# cvs -d co -P pkgsrc

# cd /usr/pkgsrc/bootstrap
# sh bootstrap -h
# sh bootstrap

# cp work/mk.conf.example /etc/mk.conf
# vi /etc/mk.conf
# rm -rf work

It's good to have PKG_RCD_SCRIPTS and RCD_SCRIPTS_DIR settings in /etc/mk.conf or otherwise the startup scripts are left in /usr/pkg/share/examples/rc.d.

.ifdef BSD_PKG_MK


# Startup scripts for packages


We have now the pkgsrc tools installed. Next we need to modify our PATH and MANPATH settings so we can start the pkgsrc compiled applications without typing the whole path. Added the bolded lines into your /etc/profile.

## Added for pkgsrc installed packages
export PATH="${PATH}:/usr/pkg/bin"
if [ `id -u` -eq 0 ]; then
  export PATH="${PATH}:/usr/pkg/sbin"
export MANPATH="${MANPATH}:/usr/pkg/man"

# I had problems using 'eval tset' instead of 'TERM=', but you might want to
# try it anyway. I think with the right /etc/termcap it would work great.
# eval `tset -sQ "$TERM"`
if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then

It is also important to configure the Linux dynamic linker so it is able to find and load the shared libraries installed by the pkgsrc.

# echo /usr/pkg/lib >> /etc/
# cat /etc/ 

The pkgsrc bootstrap kit installs the NetBSD ftp client which is much nicer to use than the standard Slackware ftp client. From now on it is possible to disable the Slackware's ftp client and make the newly installed NetBSD ftp client the only available ftp client.

# chmod 0 /bin/ftp

4. Updating Slackware packages

Next we fetch and install all available updates using the up2date script. Save the script in /usr/local/sbin and make it executable. This script needs the NetBSD ftp client which was installed by the bootstrap kit.

# mv up2date /usr/local/sbin
# chmod 755 /usr/local/sbin/up2date

Next we load and install the official Slackware updates by using the up2date script.

# up2date
# up2date -l
# up2date -i

5. Known problems

Slackware 9.1 has broken and files. We can fix them with the following commands:

# cd /usr/lib

# mv
# sed 's,^\(libdir.*\)/.,\1,' < >

# mv
# sed 's,^\(libdir.*\)/.,\1,' < >

Slackware 10.2 has no reported problems with pkgsrc.
6. Using pkgsrc

We have now a fully functional pkgsrc. As the reader might guess there are not many packages installed yet. This is the same pkgsrc as in NetBSD so the same make targets are available. The reader is instructed to look at the pkgsrc documentation. The only exception is that we must use the bmake command instead of the normal make.

We start by removing OpenSSH, OpenSSL and CVS and compile these from pkgsrc. The reader must note that these should not be removed until we have checked out a copy of pkgsrc. After all, without CVS it is impossible to run cvs checkout -P pkgsrc.

# removepkg cvs openssh openssl openssl-solibs

# cd /usr/pkgsrc/devel/cvs
# bmake install
# bmake clean clean-depends

# cd /usr/pkgsrc/security/openssh
# bmake install
# bmake clean clean-depends
# echo /usr/pkg/etc/rc.d/sshd start >> /etc/rc.d/rc.local

The pkgsrc is updated with CVS and the need for package updates can be detected with lintpkgsrc which can be installed from pkgsrc/pkgtool/pkglint.

# cd /usr/pkgsrc
# cvs update -dPA

# cd /usr/pkgsrc/pkgtools/pkglint
# make update

And finally some useful lintpkgsrc commands:

# lintpkgsrc -i			# check for updates
# lintpkgsrc -o			# check for old distribution files
# lintpkgsrc -or		# remove old distribution files

Did this article help you? Is this missing something? Send your comments to the author.
I got most of it working. Has anyone tried this? How much success did you have?

I got some stuff to compile with bmake, but cvs isn't working.

after this, what do i do? Compile xorg? Wanted to install fluxbox, but compile failed because of some dependacy errors when I bmaked [is this a word???] it.
Old 12-19-2005, 10:46 AM   #2
Registered: Dec 2004
Location: The Woodlands, Texas
Distribution: Slackware, Archlinux, CentOS
Posts: 186

Original Poster
Rep: Reputation: 29
well it works. He told me it was just that NetBSD is about to switch to 3.0 and are flooded.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
GNOME 2.8.3 packages for Linux Slackware 10.1 LiNuCe Slackware 8 04-08-2005 04:40 AM
Decent slack packages from Italian slackware site dhave Slackware 11 03-31-2005 04:24 AM
Using Slack 10's 2.6.7 kernel packages on Slack 10.1? SocialEngineer Slackware 1 03-05-2005 12:53 PM
Updated GNOME 2.8.2 packages for Linux Slackware 10.1 LiNuCe Slackware 23 03-02-2005 10:39 AM
Ran out of space on Slackware Linux and can't remove packages because theres not enou simeandrews Linux - Software 5 05-27-2004 05:06 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:18 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration