How to install package by Slackbuild script on Slackware

So,installing package on Slackware is pretty different then other distro.You need to work little more to do that .Fortunately some great guys have done all the hard work for us to do thing in minimal way.In this post I will show you how you can install any package from the Slackbuild.org repository with the help of Slackbuild script.

So I a going to install a forensic package called “chkrootkit” from that repo and installed in Slackware.First get into this page chkrootkit to get the source of it as well as Slackbuild source too.

Okay ,once obtain those then please untar the SlackBuild one and it should look like below:

bhaskar@Slackware:~/Downloads/chkrootkit$ ls
README chkrootkit.SlackBuild chkrootkit.info chkrootkit.tar.gz slack-desc

Yes, that tar file inside that directory not come with that Slackbuild source. It’s the other one I have move to that directory,because SlackBuild script require the source of the package should be inside the SlackBuild dir.

Now, next step to execute the SlackBuild script like below:


bhaskar@Slackware:~/Downloads/chkrootkit$ sudo ./chkrootkit.SlackBuild
Password:
chkrootkit-0.49
chkrootkit-0.49/chkrootkit.lsm
chkrootkit-0.49/README.chkwtmp
chkrootkit-0.49/COPYRIGHT
chkrootkit-0.49/Makefile
chkrootkit-0.49/chkutmp.c
chkrootkit-0.49/ifpromisc.c
chkrootkit-0.49/chkrootkit
chkrootkit-0.49/ACKNOWLEDGMENTS
chkrootkit-0.49/check_wtmpx.c
chkrootkit-0.49/chkdirs.c
chkrootkit-0.49/README.chklastlog
chkrootkit-0.49/chklastlog.c
chkrootkit-0.49/strings.c
chkrootkit-0.49/README
chkrootkit-0.49/chkproc.c
chkrootkit-0.49/chkwtmp.c
*** stopping make sense ***
make[1]: Entering directory `/tmp/SBo/chkrootkit-0.49′
gcc -O2 -march=i486 -mtune=i686 -o chklastlog chklastlog.c
gcc -O2 -march=i486 -mtune=i686 -o chkwtmp chkwtmp.c
chkwtmp.c: In function ‘main’:
chkwtmp.c:95:9: warning: incompatible implicit declaration of built-in function ‘exit’
gcc -O2 -march=i486 -mtune=i686 -D_FILE_OFFSET_BITS=64 -o ifpromisc ifpromisc.c
gcc -o chkproc chkproc.c
gcc -o chkdirs chkdirs.c
gcc -o check_wtmpx check_wtmpx.c
gcc -static -o strings-static strings.c
gcc -o chkutmp chkutmp.c
make[1]: Leaving directory `/tmp/SBo/chkrootkit-0.49′

Slackware package maker, version 3.14159.

Searching for symbolic links:

No symbolic links were found, so we won’t make an installation script.
You can make your own later in ./install/doinst.sh and rebuild the
package if you like.

This next step is optional – you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? n

Creating Slackware package: /tmp/chkrootkit-0.49-i486-2_SBo.tgz

./
install/
install/slack-desc
usr/
usr/sbin/
usr/sbin/chkrootkit
usr/lib/
usr/lib/chkrootkit/
usr/lib/chkrootkit/bin/
usr/lib/chkrootkit/bin/chkwtmp
usr/lib/chkrootkit/bin/strings-static
usr/lib/chkrootkit/bin/chklastlog
usr/lib/chkrootkit/bin/chkproc
usr/lib/chkrootkit/bin/ifpromisc
usr/lib/chkrootkit/bin/chkrootkit
usr/lib/chkrootkit/bin/chkdirs
usr/lib/chkrootkit/bin/check_wtmpx
usr/lib/chkrootkit/bin/chkutmp
usr/doc/
usr/doc/chkrootkit-0.49/
usr/doc/chkrootkit-0.49/COPYRIGHT
usr/doc/chkrootkit-0.49/README.chklastlog
usr/doc/chkrootkit-0.49/chkrootkit.SlackBuild
usr/doc/chkrootkit-0.49/README.chkwtmp
usr/doc/chkrootkit-0.49/ACKNOWLEDGMENTS
usr/doc/chkrootkit-0.49/README
usr/doc/chkrootkit-0.49/chkrootkit.lsm

Slackware package /tmp/chkrootkit-0.49-i486-2_SBo.tgz created.

We need to install that file. So go to the /tmp dir and execute as superuser like below:


root@Slackware:/tmp# installpkg chkrootkit-0.49-i486-2_SBo.tgz
Verifying package chkrootkit-0.49-i486-2_SBo.tgz.
Installing package chkrootkit-0.49-i486-2_SBo.tgz:
PACKAGE DESCRIPTION:
# chkrootkit (Check Rootkit)
#
# chkrootkit is a common unix-based program intended to help system
# administrators check their system for known rootkits. It is a shell
# script using common UNIX/Linux tools like the strings and grep
# commands to search core system programs for signatures and for
# comparing a traversal of the /proc filesystem with the output of
# the ps (process status) command to look for discrepancies.
#
# Homepage: http://www.chkrootkit.org
#
Package chkrootkit-0.49-i486-2_SBo.tgz installed.

Done!!

Check it where the binary is :

bhaskar@Slackware:~$ whereis chkrootkit
chkrootkit: /usr/sbin/chkrootkit /usr/lib/chkrootkit

Start playing with it:

bhaskar@Slackware:~$ sudo /usr/sbin/chkrootkit
ROOTDIR is `/'
Checking `amd'... not found
Checking `basename'... not infected
Checking `biff'... not infected
Checking `chfn'... not infected
Checking `chsh'... not infected
Checking `cron'... not infected
Checking `crontab'... not infected
Checking `date'... not infected
Checking `du'... not infected
Checking `dirname'... not infected
Checking `echo'... not infected
Checking `egrep'... not infected
Checking `env'... not infected
Checking `find'... not infected
Checking `fingerd'... not infected
Checking `gpm'... not infected
Checking `grep'... not infected
Checking `hdparm'... not infected
Checking `su'... not infected
Checking `ifconfig'... not infected
Checking `inetd'... not infected
Checking `inetdconf'... not infected
Checking `identd'... not infected
Checking `init'... not infected
Checking `killall'... not infected
Checking `ldsopreload'... not infected
Checking `login'... not infected
Checking `ls'... not infected
Checking `lsof'... not infected
...output snipped

Hope this will help.

Cheers!
Bhaskar

Advertisements

How to add repository to openSUSE

This is somewhat important to work with GNU/Linux based distributions. Redhat has different way of doing thing,means adding repositories all though both the system using rpm as the base package. Although the package manager is different,in openSUSE they use zypper as the command line package manager.Here is how you can add a repository to the system. I am adding server monitoring repo…

bhaskar@openSUSE_11:23:49_Sun Oct 23:~> sudo /usr/bin/zypper ar -f -c -n server-mon http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/ server-mon
bhaskar's password:
Adding repository 'server-mon' [done]
Repository 'server-mon' successfully added
Enabled: Yes
Autorefresh: Yes
URI: http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/

bhaskar@openSUSE_11:24:23_Sun Oct 23:~> sudo zypper up
Retrieving repository 'server-mon' metadata [|]

New repository or package signing key received:
Key ID: A5C23697EE454F98
Key Name: server:monitoring OBS Project
Key Fingerprint: 8F3BC8EFF549CDCDA918D981A5C23697EE454F98
Key Created: Tue 03 Aug 2010 06:53:39 PM IST
Key Expires: Thu 11 Oct 2012 06:53:39 PM IST
Repository: server-mon

Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a
Retrieving repository 'server-mon' metadata [done]
Building repository 'server-mon' cache [done]
Loading repository data...
Reading installed packages...

The following package updates will NOT be installed:(ignore this for the time being..I will write about it later in other post)
aaa_base aaa_base-extras coreutils gettext-runtime gstreamer-0_10-fluendo-mp3 iproute2 iptables joe kernel-desktop libfreebl3 libldb0 libsoftokn3 libtalloc2 libtdb1 libtevent0 libzypp
MozillaFirefox MozillaFirefox-branding-openSUSE mozilla-kde4-integration mozilla-nspr mozilla-nss mozilla-nss-certs net-tools nfsidmap openssh openssh-askpass python-satsolver rpm
satsolver-tools screen tar tar-lang w3m xterm zypper

Nothing to do.

Yes, I am started to dealing with it after bit of gap..

Okay, now I am going to install a network bandwidth monitoring tool called vnstat out of that repository. Here is how:


bhaskar@openSUSE_11:55:52_Sun Oct 23:~> sudo zypper in vnstat
bhaskar's password:
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
vnstat

1 new package to install.
Overall download size: 96.0 KiB. After the operation, additional 282.0 KiB will be used.
Continue? [y/n/?] (y): y
Retrieving package vnstat-1.10-3.1.i586 (1/1), 96.0 KiB (282.0 KiB unpacked)
Retrieving: vnstat-1.10-3.1.i586.rpm [done (57.5 KiB/s)]
Installing: vnstat-1.10-3.1 [done]
Additional rpm output:
Creating vnstat group
Creating vnstat user

So it’s that simple..like wise you can install lot of third party repository into the opensuse system.Here is mine repository list..which I am going to trim later:


bhaskar@openSUSE_12:15:22_Sun Oct 23:~> sudo zypper lr -d
# | Alias | Name | Enabled | Refresh | Priority | Type | URI | Service
---+----------------------------------+----------------------------------+---------+---------+----------+--------+---------------------------------------------------------------------------------+--------
1 | Updates-for-openSUSE-11.4-11.4-0 | Updates for openSUSE 11.4 11.4-0 | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/update/11.4/ |
2 | apache | apache | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/Apache/openSUSE_11.4/ |
3 | apache-modules | apache-modules | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/Apache:/Modules/Apache_openSUSE_11.4/ |
4 | apache-php | apache-php | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/server:/php/openSUSE_11.4/ |
5 | google-chrome | google-chrome | Yes | Yes | 99 | rpm-md | http://dl.google.com/linux/chrome/rpm/stable/i386 |
6 | libdvdcss repository | libdvdcss repository | Yes | Yes | 99 | rpm-md | http://opensuse-guide.org/repo/11.4/ |
7 | mozilla | mozilla | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/mozilla/openSUSE_11.4/ |
8 | net-kern-firewall | net-kern-firewall | Yes | Yes | 99 | rpm-md | http://jftp.medozas.de/openSUSE_11.4/ |
9 | openSUSE-11.4-11.4-0 | openSUSE-11.4-11.4-0 | Yes | Yes | 99 | yast2 | http://download.opensuse.org/distribution/11.4/repo/oss/ |
10 | packman-essential | packman-essentials | Yes | Yes | 99 | rpm-md | http://packman.inode.at/suse/openSUSE_11.4/Essentials |
11 | packman-multi | packman-multimedia | Yes | Yes | 99 | rpm-md | http://packman.inode.at/suse/openSUSE_11.4/Multimedia |
12 | packman-repo | packman-repo | Yes | Yes | 99 | rpm-md | http://packman.inode.at/suse/openSUSE_11.4/ |
13 | repo-debug | openSUSE-11.4-Debug | No | Yes | 99 | NONE | http://download.opensuse.org/debug/distribution/11.4/repo/oss/ |
14 | repo-debug-update | openSUSE-11.4-Update-Debug | No | Yes | 99 | NONE | http://download.opensuse.org/debug/update/11.4/ |
15 | repo-non-oss | openSUSE-11.4-Non-Oss | Yes | Yes | 99 | yast2 | http://download.opensuse.org/distribution/11.4/repo/non-oss/ |
16 | repo-source | openSUSE-11.4-Source | No | Yes | 99 | NONE | http://download.opensuse.org/source/distribution/11.4/repo/oss/ |
17 | server-mon | server-mon | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/ |
18 | wine | wine | Yes | Yes | 99 | rpm-md | http://download.opensuse.org/repositories/Emulators:/Wine/openSUSE_11.4/

Hope this will help.

Cheers!
Bhaskar