LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-18-2005, 06:21 PM   #1
Anonymo
Member
 
Registered: Dec 2004
Location: The Woodlands, Texas
Distribution: Slackware, Archlinux, CentOS
Posts: 183

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


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

http://users.piuha.net/martti/comp/s...slackware.html

Code:
Slackware Linux with pkgsrc Packages

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

Martti Kuparinen <martti.kuparinen@iki.fi>
Abstract

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-2.15.92.0.2-i486-2  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.funet.fi
ftp> cd /pub/mirrors/ftp.kernel.org/pub/linux/kernel/v2.4
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 System.map /boot/System.map-2.4.32
# 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 anoncvs@anoncvs.netbsd.org:/cvsroot 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

PKG_DBDIR=/var/db/pkg
LOCALBASE=/usr/pkg
VARBASE=/var
FETCH_CMD=/usr/pkg/bin/ftp
PAX=/usr/pkg/bin/pax
DISTDIR=/var/tmp/distfiles

# Startup scripts for packages
PKG_RCD_SCRIPTS=YES
RCD_SCRIPTS_DIR=/usr/pkg/etc/rc.d

.endif

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"
fi
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
 TERM=linux
fi

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/ld.so.conf
# cat /etc/ld.so.conf 
/usr/local/lib
/usr/X11R6/lib
/usr/i486-slackware-linux/lib
/usr/pkg/lib

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 libstdc++.la and libsupc++.la files. We can fix them with the following commands:

# cd /usr/lib

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

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

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, 09:46 AM   #2
Anonymo
Member
 
Registered: Dec 2004
Location: The Woodlands, Texas
Distribution: Slackware, Archlinux, CentOS
Posts: 183

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


Reply


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 03:40 AM
Decent slack packages from Italian slackware site dhave Slackware 11 03-31-2005 03:24 AM
Using Slack 10's 2.6.7 kernel packages on Slack 10.1? SocialEngineer Slackware 1 03-05-2005 11:53 AM
Updated GNOME 2.8.2 packages for Linux Slackware 10.1 LiNuCe Slackware 23 03-02-2005 09: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 04:06 PM


All times are GMT -5. The time now is 09:20 PM.

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