Help and info for VL users Vector Linux FAQ Search Memberlist Usergroups Register Profile Log in to check your private messages Log in Packages and Building from Source Help and info for VL users Forum Index -> HOWTOs View previous topic :: View next topic Author Message isamoor Vectorite Joined: 21 May 2003 Posts: 186 Posted: Tue Jul 29, 2003 11:47 pm Post subject: Packages and Building from Source I saw a couple questions about "VL's version of RPM" and the like about, so I thought maybe I should write this out again. It was on the old board somewhere, but I know that got lost. VectorLinux Packages VectorLinux is based on Slackware Linux, which is the oldest active distrobution out there. Slackware just celebrated it's tenth aniversary not very long ago. It's been around that long with good reason. It's simple and stable. I think those two words sum it up the best. VectorLinux takes Slackware and expands on it some. Especially on the tools department. "vasm" is a VL only add-on that is a very nice tool. It could be argued that VL is more desktop-centric. Or maybe that it is smaller, and default ISO is smaller than Slackwares. VL includes such niceties as checkinstall(covered later) by default. VL inheirits its package management system from Slackware. Instead of .RPM, each package ends in a .TGZ. If you feel like some for details of a .tgz packages contents, you can head over to: http://slackware.com/book/index.php?source=c3984.html That's actually part of the official SlackWare book. Almost anything in there applies to VL as well. I believe the only major fundamental difference is the handleing of startup scripts. There's an unofficial rewrite-in-progress of that book at: http://slackbook.yoshiwara.org.uk/ So a VL package is a .tgz file. Each package contains a library or app that someone else has already compiled. You can just install the package and the app should in theory work right away for you. There are a few catches and gotchas of course. You can only use a package that is compatable with your computer (not usually a problem) and your version of VL (sometimes a problem). See Tigger's post on compatable versions of Slack for various versions of VL. I glossed over installing a .tgz file above, so let me go through in some details. Anytime you want to install a .tgz file, you need to be root, so you should open a terminal and type "su". From there, there's a couple ways to handle the file. The most basic is the "installpkg" command. You just type installpkg and the name of the file and it handles it from there. I can promise you that installpkg will almost never reject a file, but that doesn't mean the installed app will work. To remove a package, you need the "removepkg" command. Just type removepkg and the package name. If you don't have the original package, and don't remember what the name is, you can go look in /var/log/packages. It should have files representing all the packages you have installed. Those are the basic commands, but there are a couple wrappers on these to make them arguably easier to use. The first one is "pkgtool". Pkgtool is just a small menu based app that lets you manipluate packages. You can start it up in the same directory as a package and it should find it when you select install. Another nice feature is that when you select removepkg in pkgtool, it will recreate a list of all that you have installed so you don't have to guess or look it up. Pkgtool can be accessed through vasm too. Another way about it is with "mc". Mc is short for Midnight Commander. It's a very useful filemanager that runs in a terminal. You can select a package through mc's interface and hit "F2" to bring up an option for installing the package. I'm gonna break up this post now. Topics I still plan on covering: Dependencies, Places to get Packages, Making Packages. Later, Isamoor Last edited by isamoor on Wed Jul 30, 2003 12:46 am; edited 1 time in total Back to top isamoor Vectorite Joined: 21 May 2003 Posts: 186 Posted: Wed Jul 30, 2003 12:21 am Post subject: Dependencies Dependencies are Hell. I'm afraid it's the truth. This is one of the biggest turn-offs for most linux-converts. There are some nice solutions out there to handle dependencies. Debian has apt-get, Mandrake has urpmi, Gentoo and *BSD's have portage/emerge. Slack and VL don't really have jack-crap. There are projects here and there that attempt to help out. Dropline-Gnome is the only really useful one I can think of off the top of my head though. I've tried apt, urpmi, and even portage, and I can tell ya they're not always up to par. You have to rely on someone else to decide what depends on what. As long as you stay with the main packages, it works out well. But if you throw in some 3rd party apps, things go to hell. I don't like that locked in feeling. With VL, I can proudly say I've gotten every single app I've ever wanted working. It wasn't always easy, but they've always worked. I know of no other distro I can proudly say that. I did lie a little, VL has some manner of dependency checking. Not to the extreme of others of course. And it only exists in removepkg. If two apps share a file, and you remove one app, removepkg will not rip out the shared file. The other app should continue to work fine. This should make everyone feel a little safer. On the downside, this makes removepkg kinda slow. Can't have your cake and eat it too right? Okay, so dependencies exist, how to deal with them? My first answer would be to always compile from source, but I'll cover that later. I'm assuming you're not willing to go that far.. yet. Any .tgz will install. That doesn't mean the app will work. It does mean the command will exist. Let's take Tuxracer for example. On a default VL installation, any ol' tuxracer .tgz will go on there. Let's assume you're running 3.2 and you install a Slack 8.1 version, you're good so far. Maybe you make a cute little icon, but when you click on it nothing happens. That's very likely to occur. But how to fix it? First of all, never try a new app through an icon. Always open up a terminal and type the command. If it seems to work there, you probably need to read the man page. (For more info on any program just type "man (program name)") In the case of tuxracer, you're gonna get an error on the terminal. I believe it will say something to the effect of: "failed to load shared library libSDL.so.1" That's right, TuxRacer depends on libSDL. A quick google search (google is your friend!) shows that libSDL.so is found in a buncha .rpm's called SDL. So we go check if we have a package called SDL installed. We probably don't! (If we did, I'll cover that in a minute.) We go out and find one (Also covered later.) And we install our nice SDL package. Now we try tuxracer again. Now it complains about some libSDL_mixer.so! Go hug google again and you'll see there's also a package called SDL_mixer. Go grab it and install it. Now try tuxracer one more time. What?!? Some crap about libGL.so? Well, you're not gonna find that one in a package, at least not in the traditional sense. That has to do with 3d acceleration on your graphics. If you run an nVidia card, look around for some VL specific nVidia .tgz files. There's also some install scripts on nvidia's website, but those I don't guerrentee to work. If you're running anything else (ATI included) I recommend going over to check out DRI. They provide nice acceleration to almost anything else. http://dri.sourceforge.net Once you get 3d acceleration working (involves editing XF86Config), try tuxracer again, and TA-DA! You can snow-burn tux's belly all you want! Notice that in the VL 4.0 repository I actually put tuxracer with the sdl and sdl_mixer packages. Most package maintainers are your friend. Now what if you already had SDL installed but it still gave you the original error message? Well then someone probably didn't use the same sdl install as you have to build tuxracer. There is a cheap hack to get around this a lot of times. Do a search for a similar library name on your computer. For example, if it tried to load "libSDL.so.2" just look for "libSDL*". You will probably turn up a "libSDL.so.1" or something similar. Now we can cheat and point tuxracer to the right file. Go to the directory that has libSDL.so.1 and type these commands: ln -s libSDL.so.1 libSDL.so.2 ldconfig This is a definite hack and there are probably better ways to do this (like compile from source) but it should still work. The first command just makes a symbolic link. It means that anyone that looks for the .so.2 file will get redirected to the .so.1 file. The ldconfig just refreshes the database of shared libraries. There is one catch. You need to make sure the .so.1 file isn't actually a symlink itself. If it is, you'll need to point the .so.2 file to the same place as the .so.1 file for it to work. That last hack should help someone out in a few cases. It's not something I would depend on. That pretty much covers solving dependencies in packages. This will not always work. For example: the K3B package for Slack 9.0 depends on ALSA, which can't really be installed through a package. I'd still say your best bet is to go at it from a source install. I'll cover source installs a couple posts later, next I need to mention where to get these packages. Later, Isamoor Back to top isamoor Vectorite Joined: 21 May 2003 Posts: 186 Posted: Wed Jul 30, 2003 12:40 am Post subject: Gimmie packages!! So you want some packages! Well, let's get a game plan together to go get some. Where should you look? Well, I'll give you a list, start from the top and work your way down! 1. VL Package repository. This should be your first stop. Here's the address: ftp://ftp.ibiblio.org/pub/linux/distributions/vectorlinux/ Look under your releases directory, and there will probably be a few apps listed there. Those were compiled on a VL install, so they are your best bet for a working package. I just threw some VL 4.0 packages on there. I don't promise they'll work, but I'd be gracious if you gave them a shot. 2. Offical Slackware Packages: This should be your second stop. Make sure you match up versions of Slack with VL though. Each version of Slack has it's own list of packages. Here's 9.0's for example: ftp://ftp.planetmirror.com/pub/slackware/slackware-9.0/PACKAGES.TXT Any of these packages are almost guerrenteed to work. (Well the Slack 9.0 packages would only work on VL 4.0, but you know what I mean.) This is a great way to get library files you know will be good. Here's a list of mirrors: http://slackware.com/getslack/ 3. Linuxpackages.net http://www.linuxpackages.net This is just about the only community supported Slackware package repository. You can get just about anything you want here. I would only guess that half of it's gonna work. The packagers assume you have an already pimped out install. This is where I found the K3B package that required ALSA. The search engine isn't all that great. But you can browse around the ftp for a lot of hidden treasures here: (Make sure to match up versions!) http://www3.linuxpackages.net/packages/ 4. Google! Yes, google is still your friend. There are a few independent releasers out there. Do a good search around for what you want and you might stumble onto it. Here's a good example: http://kreiger.linuxgods.com/slackpack/ (May I recommend the rar package from there.) 5. Any .RPM! I did list this as a last resort. Yes, you can install .rpm's with VL. They're only about as likely to work as the packages from LinuxPackages.net though. First, how to do it. Get the rpm you want and go into that directory. Use the command "rpm2tgz". I think it's rather self explainatory. You should now have a nice tgz file. There is a catch, you will need to rename it. All .tgz files follow this naming scheme: package-version-arch-build#.tgz There are only three dashes allowed in the name! Only 3! You can't have one in the package name or the version number. There is only ONE period(dot). The one that goes before tgz. If you don't rename it, installpkg and removepkg are gonna give ya heck for it. Now, where to get those elusive rpm's. Most distros just ship with the same thing as VL, so you must be desperate for those special apps. May I suggest these places for searchable ideas: http://www.altlinux.com/index.php?module=sisyphus http://freshrpms.net/ http://www.rpmseek.com/index.html http://plf.zarb.org/ ftp://ftp.easynet.fr/plf If you use an rpm, it's likely files might go into the wrong place. Once you get a handle on things, make sure to look through the .tgz file first to see that everything is in the right place. Using a .rpm file is also when it becomes likely you will have to use symlinks to redirect shared libraries. I'm gonna do one more post on compiling from source. But first I need to break for food. Later, Isamoor P.S. I forgot the KDE packages! KDE releases it's own Slack and VL packages. (Well, in a way. They give the source to developers at these distros who compile it ahead of time and give it back) Anyway, KDE has packages available on their own FTP server. Use packages that match your version. Slack or VL doesn't make much difference: ftp://ftp.kde.org/pub/kde/stable Look under the contrib directory in each releases folder. And the Gnome packages. Or at least the Dropline-Gnome version. Be warned, this will pretty much hose KDE as it stands now. Dropline will take over and handle all dependencies. It does make for a nice Gnome desktop though. http://www.dropline.net/gnome/ Last edited by isamoor on Wed Jul 30, 2003 1:53 am; edited 2 times in total Back to top isamoor Vectorite Joined: 21 May 2003 Posts: 186 Posted: Wed Jul 30, 2003 1:48 am Post subject: Building from Source! This is by far the best way to install apps in my opinion. It should almost always work. You will have to deal with dependencies, but you should always be able to just install the dependency from source as well. Let me say that VL and Slack put almost any other distro out there to shame when it comes to compatability with installing from source. Another thing to say before I begin. These are only generic directions. Make sure and read any README or INSTALL file that comes with your source. This is where any details on the app in question will turn up. It's also where you can get options for ./configure a lot of the time. So what's the steps? 1. Get the source. You need to source! Google is of course your friend here. It should be easier to find the source than a package since you can just type in the name of what you want. A simple search for SDL immidiatly sends me to: http://www.libsdl.org/index.php There is a nice download link in the lower left of the page. Let's grap the 1.2 release. Now you should look for the file that ends in either .tar.gz or .tar.bz2. Almost all source is put together in a tar. It's then compressed into a .gz or .bz2 file. Go ahead and download the compressed source into your home somewhere. 2. Decompress it. *Note: we still want to be a user here. You don't need to be root until the last step. The tar command is your friend here. It can handle .gz and .bz2 with no problem. Just read the docs (man tar) and check out the j and z flags. KDE's ARK or a similar app can handle this too. Now just move into your expanded directory. Now would be a good time to read any docs you find there. 3. Configure It Source installs actually have a way to check for dependencies. They do that and more through the "./configure" command. When you run configure it will adapt the makefile for your system and look for any dependencies it needs. Not only that, but if it can't find something, it even generally gives you a nice explaination of what it needs. If everything goes well (Shouldn't take over a minute) it will create a makefile and dump you back to a prompt. The ./configure step is where you need to pass any extra options though. For example, with MPlayer, you need to pass "--enable-gui" to get a gtk gui with gmplayer after you compile and install it. Where can you find these secret options? In those docs your were supposed to have read! Another common flag is the "--prefix=/usr/local/" or whatever directory you want to install the app in. You can generally leave that off though, at least in VL. 4. Make! If your ./configure went well, it's time to actually build the app! All you need to do is just type "make". This is the part that can take awhile. Some big apps could take a long time. VL is about as fast as anything at compiling things though. VL 4.0 tore through everything I sent at it. This also depends on your processor too of course. There is a chance Make will fail. It happens to me maybe once every 10 times. You just need to read the error carefully and figure out what went wrong. Often, it's a dependency that ./configure missed (Or assumed you would have). Once I even got an error about having a space in the source's directory's name. I just renamed the directory and tried again. It all went smooth then. In general, if ./configure passes, make will work. Do be patient with it. VL is great at multitasking (actually all linucies are). You don't have to sit and watch it compile. I usually boot up UT and frag someone while I wait. 5. Checkinstall! Note: You need to be root for this last step. The old standard step from here is to do a "make install", but I don't recommend it. Make install simply copies all the binaries (compiled files) into your system. This makes it kinda hard to undo. The only way to reverse this is to be in the source directory and type "make uninstall". And that's only if you left all the source compiled there (more later). I really don't encourage make install unless as a last resort. Checkinstall is your replacement! Instead of typing "make install" type "checkinstall" (still as root). Checkinstall is a real slick tool. It takes your compiled binaries, creates a package out of them, and then installs them with "installpkg". Once it's done, not only can you see and remove the pkg with pkgtool, you should have a .tgz package sitting in the source directory to share with others! There are a few notes on checkinstall. You need to make sure that it uses a slackware package if it asks. Just to be nice to all those GPL zealots, you should put the url of the homepage of the app in the source location if you plan on giving out the package. A nice one-line description is helpful too. I say you can share this package. It's not always gonna work on someone else's computer. Remember those packages at Linuxpackages.net? ./configure adapted it to your computer and configuration. It still might work on someone else's though, it's not hopeless. At the least, it makes a nice backup package. I'm about to hose my install here with a 2.6 kernel, but I have packages of all the apps I installed. So it shouldn't take too long to rebuild if I do go down. Compiling can take up some hard drive space though. If everything goes well, you can type "make clean" in the source directory to clean up after yourself. Make sure you used checkinstall before you do this to everything though. Here is where "make install" is weak. You have to have all the source intact before you can remove the app with "make uninstall". If you used checkinstall, it should be safe to clean up or even delete your source directory (I would save the .tgz package from there though). Well I think that about covers it all. Feel free to ask if you have any questions. Maybe I'll get the itch again and write a general config faq sometime. Later, Isamoor Back to top gamfa Vectorite Joined: 21 May 2003 Posts: 391 Posted: Wed Jul 30, 2003 4:20 pm Post subject: Somebody make this puppy sticky in a hurry and back it up so it doesn't get lost!!!! _________________ "Don't tell my cattle I have leather seats in my truck" Athlon 1 ghz T-bird, Soyo K7VTA-B,384 mb VL 3.2, VL 4.0, VL 4.3 (sometimes), VL5 Dynamite Back to top isamoor Vectorite Joined: 21 May 2003 Posts: 186 Posted: Wed Jul 30, 2003 8:47 pm Post subject: I didn't quite mean... I just read this over again, and I didn't mean to come across as such an authority. These are more just tales from my experience more than anything else. If anyone has corrections or better suggestions, feel free to toss them in. I still consider myself mostly a newbie, and probably will be for many years to come. I do hope this helps someone out there though. I know asking about packages is one of the more common questions around here. Later, Isamoor Back to top dustin_wielenga32 Member Joined: 21 Jun 2004 Posts: 84 Location: Washington State, USA Posted: Mon Jun 28, 2004 9:25 pm Post subject: Just wondering...... Are .tar.gz = .tgz. I can only find .tar.gz on Sourceforge for VisualBoyAdvance and I am wondering if they are equivilent. Thanks. Back to top William Dojinn Vectorite Joined: 22 Dec 2003 Posts: 370 Location: Murfreesboro Posted: Mon Jun 28, 2004 11:09 pm Post subject: Yep. tar: everything's bundled together in one file group and uncompressed. tar.gz the files are grouped together then compressed. Back to top dustin_wielenga32 Member Joined: 21 Jun 2004 Posts: 84 Location: Washington State, USA Posted: Tue Jun 29, 2004 12:12 am Post subject: I have Freeciv 1.14.0 and it is a .tgz file and I installed it using Code: installpkg /mnt/cdrom/freeciv-1.14.0.tgz and it seemed to work. I have no idea how to open the file though. If you type "freeciv" in terminal it doesn't find it and I don't know where linux stores the executables so I can't look for it with XFC. Any help would be much appreciated. [/code] Back to top freakyc Testing Joined: 19 Jun 2003 Posts: 373 Location: Southwestern Ontario Posted: Tue Jun 29, 2004 2:33 pm Post subject: Freeciv requires a server to run before the client, and the commands are civserver and civclient. http://www.freeciv.org/startguide.html Back to top dustin_wielenga32 Member Joined: 21 Jun 2004 Posts: 84 Location: Washington State, USA Posted: Wed Jun 30, 2004 5:37 pm Post subject: Thanks, I got it running and its a great game. I don't understand the ./configure command. Where do you put it? I have VisualBoyAdvance located in /home/games/visualboyadvance/visualboyadvace.cfg or something like that. Is that even the right file? I also have the other file that looks like it is the on that runs the program. What to I type in XTerm (what do you call that is it console or something?) Thanks. Back to top arana Member Joined: 12 Sep 2004 Posts: 19 Posted: Thu Oct 07, 2004 5:58 pm Post subject: ok so for VL 4.3 are slack 10 packages ok? Back to top PersistentLurker Member Joined: 15 Aug 2004 Posts: 92 Location: GMT-5 Posted: Fri Oct 08, 2004 12:04 am Post subject: arana wrote: ok so for VL 4.3 are slack 10 packages ok? You can try: but VL4.3 is Slackware 9.1 based, so Slack9.1 packages woul be safer. _________________ System: 500 MHz i686 Celeron and 192 MB and CD-RW and a 18.4 GB HD. Runs great with VL5.1STANDARD. "If you keep your mind sufficiently open, people will throw a lot of rubbish into it." -- William Orton Back to top Display posts from previous: Help and info for VL users Forum Index -> HOWTOs All times are GMT Page 1 of 1 Jump to: You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum Powered by phpBB (c) 2001, 2005 phpBB Group