Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-02-2012, 09:11 PM
|
#1
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
|
Adding XZ utils to Slackware 12.1
I dual boot Slackware 12.1 with Slackware 13.37 on my "perfect" laptop, but still spend most of my time in 12.1 and still love it.
Today I needed to open a tar.xz archive and suddenly realized that I can't do that under 12.1.
I looked for xz utils for 12.1 on SBo but did not see anything. It looks like tar > 1.22 includes xz so I think that upgrading tar looks like the way to go (12.1 has 1.16) - but I recall that the Slackware package tools rely on some quirk of the older tar and am unsure whether I might break something that way.
Has anyone done this, or have other suggestion?
|
|
|
07-02-2012, 09:21 PM
|
#2
|
Senior Member
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367
|
You can see the SlackBuild for -current here. You should be able to modify that for use with 1.22 or just use 1.26; note the packaging of tar-1.13 alongside the modern tar. Of course you'll need tar 1.13 as well, which is available in the source directory. It might be a good idea to backup /bin/tar-1.13 just in case the upgrade goes horribly wrong. If it does, you can put tar-1.13 back into /bin and pkgtools should still work. It would probably be easier to just install xz and use `unxz` to unzip the file and then tar to extract the newly generated uncompressed tarball.
Last edited by T3slider; 07-02-2012 at 09:23 PM.
|
|
1 members found this post helpful.
|
07-02-2012, 10:28 PM
|
#3
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
Original Poster
|
Thanks T3slider.
I had not realized (or forgotten) that tar-1.13 was packaged alongside my own tar-1.16, so good refresher!
I just grabbed everything frrom -current and a non-xz tarball of tar and will try to build it all later tonight.
********** UPDATE ***************
I went ahead and built without any problems.
I will need to defer installation until later when I can test and verify without distractions.
Last edited by astrogeek; 07-02-2012 at 10:38 PM.
|
|
|
07-03-2012, 12:03 AM
|
#4
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
Original Poster
|
It installed and works fine - but it still requires xz as an external program. What the newer tar seems to include is the option to support xz, but not xz functionality itself.
From what I had read I thought that tar >1.22 itself included the xz support - apparently not.
So, I have a newer tar now, but still no xz. I'll look further...
|
|
|
07-03-2012, 12:21 AM
|
#5
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
Original Poster
|
OK this was easy...
I have a 13.37 mirror on my local network as PXE source, so I grabbed the source/a/xz/ directory including Slackbuild and source for xz.
Built and installed (using my new tar-1.26 package) and opened my tar.xz archive.
So based on this limited test, for Slackware 12.1 users - you CAN safely upgrade tar using a modified -current Slackbuild and a non-xz tar source archive, and you can build a working xz utils package from the 13.37 source and Slackbuild without other dependencies!
Thanks again T3slider.
Last edited by astrogeek; 07-03-2012 at 12:22 AM.
|
|
|
07-03-2012, 01:24 AM
|
#6
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557
|
FWIW, you didn't need to upgrade your tar at all. Only compile and install xz-utils. Even with your older tar you still could have opened xz compressed tarballs using a pipe as follows:
Code:
xzdec somearchive.tar.xz | tar x
And created new archives like so:
Code:
tar -cf- yourfiles/ | xz > newarchive.tar.xz
Alternatively if those methods would not be memorable to you, these would also have worked:
Extraction:
Code:
tar --use-compress-program xz -xf somearchive.tar.xz
Creation:
Code:
tar --use-compress-program xz -cf newarchive.tar.xz yourfiles/
|
|
|
07-03-2012, 01:46 AM
|
#7
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
Original Poster
|
Quote:
Originally Posted by ruario
FWIW, you didn't need to upgrade your tar at all. Only compile and install xz-utils.
|
HAHA! Yes, I see that now.
I did not find an SBo script for xz and along the way read that tar >1.22 includes xz and decided that was the way to go, hence my path through tar. That was not correct, or I mis-understood, and needed xz anyway - which was easy enough.
But in the end I have an updated tar, plus a new xz, and all I have to remember is '-J', or let tar figure it out for me! Simplicity is increasingly important as I pass through the golden years (golden-brown as in "toast"!).
Thanks!
|
|
|
07-03-2012, 01:54 AM
|
#8
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557
|
You don't need '-J' except for where tar can't read the file name (e.g. it is receiving the archive through a pipe). For decompression, you can usually leave it out. For compression using '-a' instead (a.k.a. --auto-compress) and it will pick the compressor based on extension of the archive you are creating.
|
|
|
07-03-2012, 02:27 AM
|
#9
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
Original Poster
|
Quote:
Originally Posted by ruario
You don't need '-J' except for where tar can't read the file name...
|
That is what I meant about letting tar figure it out for me.
Oddly enough, I think that tar was the third *nix command that I learned on my first exposure in the early/mid nineties, right after 'cd' and 'ls'. Even then I was a little overwhelmed by the number of options it offered.
Now it has become one of those things that I use all day, every day but rarely think much about. I consult the manual regularly to craft my use du jour, but nothing much sticks beyond -c/x/t/z/j/v/f combinations. I pipe through gzip and even use cpio on occasion, and rarely have any surprizes.
But earlier when I typed tar -xvzf ...xz and it balked, it was such a shock I didn't know where to start! It took me a minute or two just to realize that it was 'xz' and not 'gz'... then the adventure began!
But as of now, the world is spinning normally once more!
|
|
|
07-03-2012, 03:29 AM
|
#10
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557
|
As a side note, if some wants just the decompresser I host some self-contained (statically linked against liblzma) xzdec binaries on one of the websites owned by my employer. You can get them from here: http://snapshot.opera.com/unix/xzdec/. I made these to help Opera users of our public development snapshots. Some users need them because we only offer XZ compressed tarballs of Opera Next and older distros don't always have XZ Utils available, as you found.
The binaries were compiled on Ubuntu 6.06 LTS (Dapper Drake) LiveCDs with the following configure options: --disable-shared --disable-nls --disable-encoders --enable-small --disable-threads --disable-lzmainfo --disable-scripts --disable-xz --disable-lzma-links. Then I stripped them before packaging them up to share. So far they have worked for every user who has tried them. I haven't specifically tested Slackware 12.1 but since Dapper pre-dates it by about 2 years, I reckon they should work there are well.
P.S. There is a little more information on the blog post I wrote about XZ compressed Opera development snapshots.
Last edited by ruario; 07-03-2012 at 04:41 PM.
Reason: Simplified posting as the same examples were already on the site I linked to.
|
|
|
05-25-2014, 10:46 AM
|
#11
|
Member
Registered: Nov 2004
Distribution: Slackware/Solaris
Posts: 935
Rep:
|
Hi, I recently had this same problem but with Slack12 where you cannot use package from 13.37 because of glibc version.
So, I complied latest source of XZ then...
Code:
# ln -s /usr/local/bin/xz /usr/bin/xz
# ln -s /usr/local/lib/liblzma.so.5.0.5 /lib/liblzma.so.5
I probably should have linked rest of libs from /usr/local/lib/ but since system does not complain I just skipped that.
Works pretty good. Hope that helps to someone.
|
|
|
05-26-2014, 07:02 AM
|
#12
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557
|
@czezz: You could do that but it is much nicer to have a package, so I would suggest using the SlackBuild to create one, in three easy steps:
Fetch the latest XZ-Utils Slackbuild:
Code:
$ cd /tmp/
$ lftp -c 'open http://mirrors.slackware.com/slackware/slackware-current/source/a; mirror -x ".*\.mirrorlist" xz'
Build and package XZ-Utils:
Code:
$ su -
# cd /tmp/xz
# sh xz.SlackBuild
Install XZ-Utils:
Code:
# upgradepkg --install-new /tmp/xz-5.0.5-i486-1.tgz
|
|
|
05-26-2014, 07:26 AM
|
#13
|
Senior Member
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 2,557
|
If you just want to be able to decompress and don't care about packaging you could build only xzdec and stick it in /usr/local/bin, e.g.:
Code:
$ wget http://tukaani.org/xz/xz-5.0.5.tar.bz2 -qO- | tar xj
$ cd xz-5.0.5
$ ./configure --disable-encoders --disable-lzmainfo --disable-nls --disable-scripts --disable-shared --disable-threads --disable-xz --enable-small
$ make
$ strip --strip-debug src/xzdec/xzdec
$ su -c 'install -m755 src/xzdec/xzdec /usr/local/bin/xzdec'
|
|
|
All times are GMT -5. The time now is 01:24 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|