LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-24-2008, 12:23 PM   #1
DJ_Barney
Space Data Wiki
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 27

Rep: Reputation: 15
Slackware Package Management HowTo: Needs checking :)


Hello,

Here is my Slackware Package Management HowTo. I will release this on The Linux Documentation Project when I've ironed out any wrinkles.

Raw... (just for the ASCII title)...

Code:
 __                     _                                                           ___
(_ | _. _|      _..__  |_)_. _|  _. _  _  |\/| _.._  _. _  _ ._ _  _ .__|_ |_| _     | _
__)|(_|(_|<\/\/(_||(/_ | (_|(_|<(_|(_|(/_ |  |(_|| |(_|(_|(/_| | |(/_| ||_ | |(_)\/\/|(_)
                                    _|                  _| 

A short Linux How To.

Introduction

Hopefully this How To will clear up any confusion about the Linux Slackware Distribution package management system. Although some people instantly seem to understand the system there sometimes seems to be some confusion. I myself was confused to begin with until I grasped it. The problem seems to lie (ironically) with the simplicity of the system which is in the style of Slackware.

Why Package Management ?

Although you can quickly download programs and compile and install, this can lead to inconsistencies in the Linux system that are hard to track. Although most packages have a "make uninstall" it is not really there for any kind of package management. Just as in real life, package management keeps a system clean and tidy and easy to run.

Overview

The system is based on some commands used in the terminal. If you don't like working at the command line then either use "pkgtool" which will add and remove packages for you using a terminal GUI, or use "KPackage" which is part of the KDE Window Manager / Desktop. KPackage has support for Slackware packages. 

One thing that is not immediately obvious is that the Slackware package system actually has support for RPM's (Redhat, and other distributions package file format). RPM's can be converted using "rpm2tgz" or "rpm2targz" to provide "out of the box" ready for installation functionality for RPM's.

Simple Package Management

Installing a source archive that you have downloaded from the internet within the Slackware package system is actually very simple once grasped. These are the "source" archives that contain "configure" and files like "INSTALL" and "README". Binary archives are probably best obtained as an RPM and converted using "rpm2tgz".

Follow the compile instructions (usually in INSTALL or README) but make sure you use "--prefix=PREFIX" as a configure option. For example, if you have obtained an archive of the program "figlet"...

$ ./configure --prefix=/tmp/figlet

Some software may occasionally use options like "DESTDIR=". Just define the destination directory as in the above example.

Now follow the install instructions (in "INSTALL" or "README"), not forgetting the option to change the install destination. Compile as normal. When you use "make install" installation will occur to the directory you defined ("/tmp/figlet").

Now go into that directory and run "makepkg figlet-2.2.2.tgz". Choose the archive name fairly carefully (in this case figlet-2.2.2.tgz) as that is what the Slack Package system uses to track the program.

If there are any symbolic links then makepkg will ask you if you want to make an installation script. Answer yes ("y"). Note ... you have to put in just a "y" not "yes" otherwise the script won't be created.

You will now be asked if you want to change the permissions. Answer yes ("y") as this is pretty much standard procedure for installation files.

The package will be created, for example "figlet-2.2.2.tgz". You can now copy it to wherever you store all your packages and either run the command line utility "installpkg" or use the terminal GUI "pkgtool". Of course there's always KPackage.

That's it !

Just a couple of qualifiers. You'll hear people going on about the install script "doinstall.sh" and a description file. Those don't HAVE to be in there. Slack Package will just operate using the name of the archive, in this case "figlet-2.2.2". THAT is what will show up in the list of installed packages.

Advanced Package Management

There is a more advanced method of package installation that is beyond the scope of this document. Please see http://slackbuilds.org/. Pre made Slack Packages can be downloaded which are adequate for most people. The Slack build system can handle difficult to install or compile archives, but it is slightly more complicated for the beginner and most people will only use the above, simpler, system. Saying that, Slack Builds come highly recommended for some situations.

Pre Built Package Locations

http://packages.slackware.it/ Official Slackware Packages. You probably already have all these installed if you selected "full install" when you installed from DVD.

http://www.slackware.com/~alien/slackbuilds/ Unofficial Slack packages (but working!).

http://slackbuilds.org/ Advanced package compile system (see above).

Google will turn up other Slackware Packages. 

RPM's. There are many RPM databases and lists. Use "rmp2tgz" (see above).

Credits

Thanks to everyone in the Slackware forum on linuxquestions ( http://www.linuxquestions.org/questions/slackware-14/ ).

Thanks to Patrick Volkerding and many others for Slackware Linux ( http://slackware.com ).
A short Linux How To.

Introduction

Hopefully this How To will clear up any confusion about the Linux Slackware Distribution package management system. Although some people instantly seem to understand the system there sometimes seems to be some confusion. I myself was confused to begin with until I grasped it. The problem seems to lie (ironically) with the simplicity of the system which is in the style of Slackware.

Why Package Management ?

Although you can quickly download programs and compile and install, this can lead to inconsistencies in the Linux system that are hard to track. Although most packages have a "make uninstall" it is not really there for any kind of package management. Just as in real life, package management keeps a system clean and tidy and easy to run.

Overview

The system is based on some commands used in the terminal. If you don't like working at the command line then either use "pkgtool" which will add and remove packages for you using a terminal GUI, or use "KPackage" which is part of the KDE Window Manager / Desktop. KPackage has support for Slackware packages.

One thing that is not immediately obvious is that the Slackware package system actually has support for RPM's (Redhat, and other distributions package file format). RPM's can be converted using "rpm2tgz" or "rpm2targz" to provide "out of the box" ready for installation functionality for RPM's.

Simple Package Management

Installing a source archive that you have downloaded from the internet within the Slackware package system is actually very simple once grasped. These are the "source" archives that contain "configure" and files like "INSTALL" and "README". Binary archives are probably best obtained as an RPM and converted using "rpm2tgz".

Follow the compile instructions (usually in INSTALL or README) but make sure you use "--prefix=PREFIX" as a configure option. For example, if you have obtained an archive of the program "figlet"...

$ ./configure --prefix=/tmp/figlet

Some software may occasionally use options like "DESTDIR=". Just define the destination directory as in the above example.

Now follow the install instructions (in "INSTALL" or "README"), not forgetting the option to change the install destination. Compile as normal. When you use "make install" installation will occur to the directory you defined ("/tmp/figlet").

Now go into that directory and run "makepkg figlet-2.2.2.tgz". Choose the archive name fairly carefully (in this case figlet-2.2.2.tgz) as that is what the Slack Package system uses to track the program.

If there are any symbolic links then makepkg will ask you if you want to make an installation script. Answer yes ("y"). Note ... you have to put in just a "y" not "yes" otherwise the script won't be created.

You will now be asked if you want to change the permissions. Answer yes ("y") as this is pretty much standard procedure for installation files.

The package will be created, for example "figlet-2.2.2.tgz". You can now copy it to wherever you store all your packages and either run the command line utility "installpkg" or use the terminal GUI "pkgtool". Of course there's always KPackage.

That's it !

Just a couple of qualifiers. You'll hear people going on about the install script "doinstall.sh" and a description file. Those don't HAVE to be in there. Slack Package will just operate using the name of the archive, in this case "figlet-2.2.2". THAT is what will show up in the list of installed packages.

Advanced Package Management

There is a more advanced method of package installation that is beyond the scope of this document. Please see http://slackbuilds.org/. Pre made Slack Packages can be downloaded which are adequate for most people. The Slack build system can handle difficult to install or compile archives, but it is slightly more complicated for the beginner and most people will only use the above, simpler, system. Saying that, Slack Builds come highly recommended for some situations.

Pre Built Package Locations

http://packages.slackware.it/ Official Slackware Packages. You probably already have all these installed if you selected "full install" when you installed from DVD.

http://www.slackware.com/~alien/slackbuilds/ Unofficial Slack packages (but working!).

http://slackbuilds.org/ Advanced package compile system (see above).

Google will turn up other Slackware Packages.

RPM's. There are many RPM databases and lists. Use "rmp2tgz" (see above).

Credits

Thanks to everyone in the Slackware forum on linuxquestions ( http://www.linuxquestions.org/questions/slackware-14/ ).

Thanks to Patrick Volkerding and many others for Slackware Linux ( http://slackware.com ).
 
Old 04-24-2008, 01:19 PM   #2
-{Jester}-
Member
 
Registered: Apr 2008
Location: The Internet
Distribution: Slackware
Posts: 49

Rep: Reputation: 15
You might find the following thread useful:

http://www.linuxquestions.org/questi...ctices-635844/

I got some really great tips there and I think any document about package management should include a lot of the information found that thread.
 
Old 04-24-2008, 01:22 PM   #3
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,913

Rep: Reputation: Disabled
Quote:
Originally Posted by DJ_Barney View Post
Hello,

Here is my Slackware Package Management HowTo. I will release this on The Linux Documentation Project when I've ironed out any wrinkles.
If that's the place where the linux-howtos package comes from, then I'm not sure this would be a good candidate for that. If that's not where they come from, then ignore this comment.

Quote:
Introduction

Hopefully this How To will clear up any confusion about the Linux Slackware Distribution package management system. Although some people instantly seem to understand the system there sometimes seems to be some confusion. I myself was confused to begin with until I grasped it.
I would try to avoid first-person references in a document like this.

Quote:
Overview

The system is based on some commands used in the terminal. If you don't like working at the command line then either use "pkgtool" which will add and remove packages for you using a terminal GUI, or use "KPackage" which is part of the KDE Window Manager / Desktop. KPackage has support for Slackware packages.
Use of installpkg and removepkg is preferred over pkgtool.

Quote:
One thing that is not immediately obvious is that the Slackware package system actually has support for RPM's (Redhat, and other distributions package file format). RPM's can be converted using "rpm2tgz" or "rpm2targz" to provide "out of the box" ready for installation functionality for RPM's.
However, that is not recommended. Not only should this be heavily discouraged unless there are no other options, the mention of it should not be at the *beginning* of an article on Slackware package management.

Quote:
Simple Package Management

Follow the compile instructions (usually in INSTALL or README) but make sure you use "--prefix=PREFIX" as a configure option. For example, if you have obtained an archive of the program "figlet"...
This isn't *package* management - this is locally installed software management and/or package *building* instead. IMHO, they belong as a footnote (with a reference to another document).

Quote:
$ ./configure --prefix=/tmp/figlet

Some software may occasionally use options like "DESTDIR=". Just define the destination directory as in the above example.
See, that's why this deserves its own document. There's no way to cover all the potential pitfalls that are present here (whether it's software with no DESTDIR support, broken DESTDIR support, embedded $PKG paths in files, and so on.

Quote:
Now follow the install instructions (in "INSTALL" or "README"), not forgetting the option to change the install destination. Compile as normal. When you use "make install" installation will occur to the directory you defined ("/tmp/figlet").

Now go into that directory and run "makepkg figlet-2.2.2.tgz". Choose the archive name fairly carefully (in this case figlet-2.2.2.tgz) as that is what the Slack Package system uses to track the program.
That's not proper Slackware package naming convention. If you're going to write a HOWTO on the subject, then you need to follow Slackware standards.

Quote:
If there are any symbolic links then makepkg will ask you if you want to make an installation script. Answer yes ("y"). Note ... you have to put in just a "y" not "yes" otherwise the script won't be created.

You will now be asked if you want to change the permissions. Answer yes ("y") as this is pretty much standard procedure for installation files.
No, it's not. There are *many* applications that this will break, as they require directory ownership of something that's not root:root.

Quote:
Just a couple of qualifiers. You'll hear people going on about the install script "doinstall.sh" and a description file. Those don't HAVE to be in there. Slack Package will just operate using the name of the archive, in this case "figlet-2.2.2". THAT is what will show up in the list of installed packages.
Yes, you'll hear people like me "going on" about following Slackware packaging standards.
The slack-desc file is required, and it has a correct format as well.

Quote:
Advanced Package Management

There is a more advanced method of package installation that is beyond the scope of this document. Please see http://slackbuilds.org/. Pre made Slack Packages can be downloaded which are adequate for most people.
Not from SlackBuilds.org. See the FAQ there. Also, see the HOWTO there - it's not difficult at all.
Thanks for the mention, but again, I don't think it belongs in this document.

Quote:
Pre Built Package Locations

http://packages.slackware.it/ Official Slackware Packages. You probably already have all these installed if you selected "full install" when you installed from DVD.

http://www.slackware.com/~alien/slackbuilds/ Unofficial Slack packages (but working!).

http://slackbuilds.org/ Advanced package compile system (see above).

Google will turn up other Slackware Packages.

RPM's. There are many RPM databases and lists. Use "rmp2tgz" (see above).
To go a bit further, I don't think this sort of document should mention external repositories at all. Feel free to discuss the "trust" factor and other such issues, but don't mention projects by name - let users figure that out on their own.

There's a lot of information on package management, building, and build scripts at SlackWiki.org (I've written/contributed to most of the articles on those topics).
 
Old 04-24-2008, 01:40 PM   #4
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware, OpenBSD, FreeBSD
Posts: 728

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by DJ_Barney View Post
Pre Built Package Locations

http://packages.slackware.it/ Official Slackware Packages. You probably already have all these installed if you selected "full install" when you installed from DVD.

http://www.slackware.com/~alien/slackbuilds/ Unofficial Slack packages (but working!).

http://slackbuilds.org/ Advanced package compile system (see above).
I agree with everything Robby has said, so I'll just add two minor points. First, you may want to ask Eric about linking to his unofficial packages. Second, SlackBuilds.org does not contain any pre-built packages, so it should not belong in this list. SlackBuilds.org contains SlackBuild scripts that people can use to make their own binary packages. It's an important distinction.
 
Old 04-24-2008, 01:55 PM   #5
DJ_Barney
Space Data Wiki
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by -{Jester}- View Post
You might find the following thread useful:

http://www.linuxquestions.org/questi...ctices-635844/

I got some really great tips there and I think any document about package management should include a lot of the information found that thread.
Thanks

DJ Barney
 
Old 04-24-2008, 02:39 PM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,234

Rep: Reputation: Disabled
If you are going to use my name in an article then I do not want to see mentioned in the same text that using RPMs in Slackware is advisable. The rpm2tgz script is a "last resort" to install programs that are distributed in binary format only (think of closed-source commercial programs). The post-install script inside the RPM will be lost when you convert it to .tgz format. In all other cases you should track down the program source code and compile it yourself (into a Slackware package).

As for the rest, the article contains so many untrue statements that I would advise you not to publish it. Robby pointed out the many flaws.

Another (big!) mistake for instance is your advice to use
Code:
/configure --prefix=/tmp/figlet
. The resulting program will be configured to go and look for it's libraries and configuration files in /tmp/figlet/bin , /tmp/figlet/lib , /tmp/figlet/etc and that is bad bad bad. Please carefully read the documentation about Slackware packages, SlackBuild scripts and package management on http://slackwiki.org - that is where the correct information already can be found.

If, after careful reading of available information, you are able to write an article that adds value then I'd be glad to read it.

Eric
 
Old 04-24-2008, 03:07 PM   #7
alan_ri
Senior Member
 
Registered: Dec 2007
Location: Croatia
Distribution: Debian GNU/Linux
Posts: 1,733
Blog Entries: 5

Rep: Reputation: 127Reputation: 127
I'm wondering how long you've been using Slackware.Please don't publish something when even you are not sure what you're doing.A million things are missing in your post.Give it some time,learn.
 
Old 04-24-2008, 04:20 PM   #8
DJ_Barney
Space Data Wiki
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 27

Original Poster
Rep: Reputation: 15
Jeez,

Cut me some Slack ... 8-O.

Why do you think I posted this HowTo here FIRST, before I put it on LDP, or wherever ?

I APOLOGISE for getting stuff wrong. I'm afraid I am very human. Jeez !

I didn't know about the page on SlackWiki so I will study that and rewrite my HowTo.

Annoylingly using "--prefix=" seems to work on my machine, even when I remove everything from /tmp (this is using figlet, zvbi).

I see you make distinctions between normal packages and Slack build packages. The command line is preferred over the GUI, etc, etc. These are all fine pedantic distinctions to make but all I'm trying to do is write a How To that will just get things done for the average user. My How To may have mistakes in it (cripes what hasn't on a first release!) but I still have a couple of packages sitting in my package management list that I can remove and install. This is much more than I have ever achieved since using Slackware from about 2002. Not everyone immediately understand the complexities of Linux usage and this is who the How To is written for.

Thanks for the replies.

DJ Barney
 
Old 04-24-2008, 04:34 PM   #9
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware, OpenBSD, FreeBSD
Posts: 728

Rep: Reputation: 168Reputation: 168
Quote:
Originally Posted by DJ_Barney View Post
I APOLOGISE for getting stuff wrong. I'm afraid I am very human. Jeez !
No need to apologize for getting stuff wrong. We all get stuff wrong. We're all human. Remember, you posted this asking for input, and input is what you got.

Quote:
I see you make distinctions between normal packages and Slack build packages. The command line is preferred over the GUI, etc, etc. These are all fine pedantic distinctions to make but all I'm trying to do is write a How To that will just get things done for the average user.
I beg to differ. The comments made above are not pedantic distinctions at all and, IMHO, they are important for even new users to understand. I think a user relying on converting RPMs to tgz's for all their third party packages will quickly end up with a broken system. I would think you'd want to start off with an explanation of the actual native Slackware package tgz format, and how they are made (SlackBuilds), and where you can find some of each. Only at the end, and possibly even in a footnote, would you mention the tools available to convert RPMs etc.

The SlackWiki, Slack Book, and other similar resources might be a good place for inspiration.
 
Old 04-24-2008, 04:44 PM   #10
DJ_Barney
Space Data Wiki
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 27

Original Poster
Rep: Reputation: 15
Yeah, don't worry, I've calmed down now. I'm a sensitive soul .

Yes, the RPM part. I really only mentioned it in passing to give users another option to obtain packages. But, yes, I will stress that it's a last resort, the conversion removes RPM scripts, etc.

DJ Barney
 
Old 04-24-2008, 05:44 PM   #11
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
As you may have gathered we Slackers are particular about creating packages ! Certain sites however seem to host packages that are of dubious quality and can cause frustration to the end user.

As previously stated - have a look a the resources to learn more about building packages for Slackware - Slackbuilds being an obvious example.

No one is jumping on you here and I'm sure everyone will applaud the sentiment of wishing to contribute. Misinformation, however, is a dangerous thing.

Good luck !!
 
Old 04-24-2008, 06:29 PM   #12
Michielvw
Member
 
Registered: May 2005
Location: Leicester,UK
Distribution: Slackware
Posts: 108

Rep: Reputation: 19
Quote:
Originally Posted by DJ_Barney View Post
Hello,
KPackage has support for Slackware packages.
While this is technically not wrong (as far as I know) I would be careful mentioning it. Granted I have no opinion, but Kpackage is more a general tool for managing packages, then a slackware-specific tool.

*If* you do, be complete and mention them all. Also I personally think that slackpkg is worth mentioning.
 
Old 04-24-2008, 06:57 PM   #13
DJ_Barney
Space Data Wiki
 
Registered: Mar 2008
Location: UK
Distribution: Slackware
Posts: 27

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bgeddy View Post
As you may have gathered we Slackers are particular about creating packages ! Certain sites however seem to host packages that are of dubious quality and can cause frustration to the end user.

As previously stated - have a look a the resources to learn more about building packages for Slackware - Slackbuilds being an obvious example.

No one is jumping on you here and I'm sure everyone will applaud the sentiment of wishing to contribute. Misinformation, however, is a dangerous thing.

Good luck !!

Thanks. I must admit I did feel like I somehow inadvertently bought down the wrath of Bob onto me. It's probably has some excruciating punch line as usual.


I will study what you say carefully, afterall I'm trying to do a How To for the uninitiated so it has to be as clear and accurate as possible.

DJ Barney
 
Old 04-24-2008, 07:51 PM   #14
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 227Reputation: 227Reputation: 227
Another source of information is on the original disc(s) you installed from. The /source directory not only includes the source code but a script ,(*.Slackbuild), that was used to compile the binary that you install when first installing Slackware.

The beauty of studying these is that you will not be just learning something specific to Slackware - you will become proficient with shell scripting. A topic which is applicable to any Linux/Unix setup.

To this end - as you obviously have a Slackware box to play with and seem to want to learn - check out the online reference http://tldp.org/LDP/abs/html/. This is widely acknowledged to be the definitive reference.

The point being these seemingly disparate topics all fit together to give an insight to the Linux / Unix / and Slackware methodologies.

The prior posters regularly contribute immensely to the community and are incredibly knowledgeable but still give useful comments to newcomers. It's this willingness to share the knowledge that makes it special. (Went a bit RMS then maybe !)

Hope to see you around here again..
 
  


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
Slackware Package Management Best Practices -{Jester}- Slackware 19 05-22-2008 12:46 AM
Slackware Package Management gonzalo76 Slackware 12 05-11-2004 07:20 PM
Slackware Package Management kemplej Slackware 1 12-22-2003 05:34 PM
slackware package management Vlad_M Slackware 6 08-15-2003 04:20 AM
RH8.0 - package management: howto remove KDE tetractis Linux - Distributions 2 01-29-2003 04:33 AM


All times are GMT -5. The time now is 03:22 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