LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 08-25-2009, 10:21 PM   #1
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Rep: Reputation: 16
Questions about upgradepkg and slackpkg


Hey everyone,

I just had some technical questions about these two package tools.

As I understand, 'upgradepkg new_pkg' will first install the new package and then remove the old package.

First, how does upgradepkg identify that the new package is an updated version of the old package? Generally packages seemed to be labeled with the program name, version number, and architecture. Does it use this naming scheme to identify the name of the old package and its version number?

Second, let's say that the binary file name and location stays the same between the new and old versions, then installing the new package will overwrite this file. Now when the old package is removed, wouldn't this file also be removed since it's part of the old package? Or does the removal tool analyze which files are similar and which are different before removing?

Third, assume you have configuration files associated with the program. Wouldn't installing the new package overwrite these config files? Or does upgradepkg treat configuration files uniquely?


As for slackpkg:

First, is this essentially an automated method for upgradepkg? Is upgradepkg what it uses? Will changes made by slackpkg be documented by pkgtool?

Second, say I want to live in -current. If I'm using 12.2 and I want to head into -current, all I would do is change the configuration file to read from the -current directory and run update, install-new, etc.? How does this work for things such as the kernel?

Thanks for any help you can provide,
Coto
 
Old 08-25-2009, 10:37 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by Cotobear View Post
Hey everyone,
Hi there

Quote:
As I understand, 'upgradepkg new_pkg' will first install the new package and then remove the old package.
Code:
shell# upgradepkg --install-new
upgradepkg will remove the old package, and install the new package. The --install-new option will install stuff that is not installed yet (while ALSO upgrading all other stuff too IIRC).

Quote:
First, how does upgradepkg identify that the new package is an updated version of the old package? Generally packages seemed to be labeled with the program name, version number, and architecture. Does it use this naming scheme to identify the name of the old package and its version number?
Yep, the naming scheme is consistent across versions of Slack, with the exception of many of the packages in Slack-current, which are .txz instead of all .tgz
Quote:
Second, let's say that the binary file name and location stays the same between the new and old versions, then installing the new package will overwrite this file. Now when the old package is removed, wouldn't this file also be removed since it's part of the old package? Or does the removal tool analyze which files are similar and which are different before removing?
See above: the old stuff is removed first.

Quote:
Third, assume you have configuration files associated with the program. Wouldn't installing the new package overwrite these config files? Or does upgradepkg treat configuration files uniquely?
Much/most/all of the time, configuration files within Slack-packages end with an extension like .new so that they will not overwrite your existing config files. You can configure slackpkg to ask you after the upgrades, what you want to do with the .new files : Keep, overwrite, delete, or Diff.
Quote:
As for slackpkg:

First, is this essentially an automated method for upgradepkg? Is upgradepkg what it uses? Will changes made by slackpkg be documented by pkgtool?
Ssackpkg uses the exact same stuff that pkgtool is made of, and it adds functionality of being able to download stuff off the server. Pkgtool itself doesn't do this, but if you were inclined, you could google up "pkgtool-Tukaani" which is a 3rd party version of pkgtool, and it can do downloading and net-install sort of features.

As such, slackpkg and pkgtool both install/remove/upgrade packages the proper way, so the processes are tracked appropriately (documented) for easy upgrade/removal.
Quote:
Second, say I want to live in -current. If I'm using 12.2 and I want to head into -current, all I would do is change the configuration file to read from the -current directory and run update, install-new, etc.? How does this work for things such as the kernel?
Technically you could that, but NO: It is not "just that easy", especially if you want to upgrade to -current, and even more especially if you want to upgrade to 64-current from 32. To upgrade properly from one to the next, follow the UPGRADE.TXT file which is included with every Slackware. It will tell you how to upgrade the right way.
Upgrading to 64-current from 32 is not supported.

Quote:
Thanks for any help you can provide,
Coto
Hope this helps you out
Sasha

Last edited by GrapefruiTgirl; 08-25-2009 at 10:44 PM.
 
Old 08-26-2009, 12:20 AM   #3
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Original Poster
Rep: Reputation: 16
Thanks for your reply Sasha.

This definitely clears things up.

Just a couple of follow up questions:

Assuming I upgrade to Slackware-current (properly.) Is it possible to maintain -current using slackpkg, or is this unwise?

From the slackbook:
"upgradepkg works by first installing the new package and then removing the old package so that old files are no longer around on the system"

http://www.slackbook.org/html/packag...utilities.html

This seems to be the opposite of what you suggested, though your way seems to make more sense. Is this a typo in the book then? Otherwise it seems you would have to have some stored knowledge of what was replaced, which files are new, and which files will no longer be used.

Thanks again,
Coto
 
Old 08-26-2009, 12:32 AM   #4
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by Cotobear View Post
Assuming I upgrade to Slackware-current (properly.) Is it possible to maintain -current using slackpkg, or is this unwise?
It can be done, yes. But I can't give specifics at the moment. I'm updating my -current install using rsync, not slackpkg, but other members are I believe using slackpkg to do so. If you search around a bit, you'll find other threads in /Slackware here, that will likely address this.
Quote:
From the slackbook:
"upgradepkg works by first installing the new package and then removing the old package so that old files are no longer around on the system"

http://www.slackbook.org/html/packag...utilities.html

This seems to be the opposite of what you suggested, though your way seems to make more sense. Is this a typo in the book then? Otherwise it seems you would have to have some stored knowledge of what was replaced, which files are new, and which files will no longer be used.
It's possible the book is wrong (it is rather out of date) but it is equally (or even *more* than equally) possible that I am wrong
I based my answer on what I see in the console, when I upgrade stuff: IIRC, I see:

1) deleting old stuff
2) preparing for install
3) installing new package

But I may be remembering funnily as it's late at night here!

And yes, for each and every installed package, there is a PAK archive stored in /var/log/packages, which contains details/records of the installed package, so that the package managers can know what went where, and thus, what to remove or upgrade.
Quote:
Thanks again,
Coto
You're welcome! Sorry for any confusion I may have induced!

Sasha

Last edited by GrapefruiTgirl; 08-26-2009 at 12:33 AM.
 
Old 08-26-2009, 12:40 AM   #5
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by GrapefruiTgirl View Post
You're welcome! Sorry for any confusion I may have induced!
None at all . Have a good night!
 
Old 08-26-2009, 12:43 AM   #6
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Thanks, and you as well!

Sasha
 
Old 08-26-2009, 12:57 AM   #7
w1k0
Senior Member
 
Registered: May 2008
Location: Poland
Distribution: Slackware, Mint
Posts: 1,241

Rep: Reputation: 196Reputation: 196
Since you ask about upgradepkg maybe you'll be interested in that thread: Possible bug or strange feature of upgradepkg?. It describes some non-obvious and confusing feature of that program. It's good to know about it instead assume that the program works according to our expectations.
 
Old 08-26-2009, 08:19 AM   #8
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
Quote:
Originally Posted by Cotobear View Post
As I understand, 'upgradepkg new_pkg' will first install the new package and then remove the old package.
Upgradepkg will install the program and overwrite any existing files that are contained in that package. It then removes the old package but will not remove files if they also belong to one or more other packages. I think it then does one last install to be sure everything is in place.
Quote:
Originally Posted by Cotobear View Post
First, how does upgradepkg identify that the new package is an updated version of the old package? Generally packages seemed to be labeled with the program name, version number, and architecture. Does it use this naming scheme to identify the name of the old package and its version number?
pkgtools does not care about the version number. It just needs to see that the packages are different. in any (or all) of VER, ARCH or BUILD below.
Code:
 
package-name-<VER>-<ARCH>-<BUILD>.t?z
It will work on packages in the order you feed it in regardless of numbers being higher or lower.
You are in charge and it will do as instructed.

Quote:
Originally Posted by Cotobear View Post
Second, let's say that the binary file name and location stays the same between the new and old versions, then installing the new package will overwrite this file. Now when the old package is removed, wouldn't this file also be removed since it's part of the old package? Or does the removal tool analyze which files are similar and which are different before removing?
see explanation above

Quote:
Originally Posted by Cotobear View Post
Third, assume you have configuration files associated with the program. Wouldn't installing the new package overwrite these config files? Or does upgradepkg treat configuration files uniquely?
The .conf files are not normally over-written because the configuration files are supposed to be named "something.conf.new". There is a routine that will check to see if something.conf already exists. If not then it is written as something.conf or left with the .new extension to prevent your custom config being over-written.

It is left to the admin to check and merge/delete/over-write these files.
If you use slackpkg it will actually look for these .new files and offer to deal with them.
 
Old 08-26-2009, 08:58 AM   #9
hitest
Senior Member
 
Registered: Mar 2004
Location: Prince Rupert, B.C., Canada
Distribution: Slackware, OpenBSD
Posts: 4,282

Rep: Reputation: 588Reputation: 588Reputation: 588Reputation: 588Reputation: 588Reputation: 588
Quote:
Originally Posted by Cotobear View Post
Assuming I upgrade to Slackware-current (properly.) Is it possible to maintain -current using slackpkg, or is this unwise?
I'm maintaining my install of -current with slackpkg, it is working properly for me. Nothing has gone awry yet. I like slackpkg.
 
Old 08-26-2009, 09:55 AM   #10
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
@ Cotobear,

Here's a thought too:

If you're any good with bash, OR for some practice, you could always open up the pkgtool scripts in your favorite editor and examine them, to see exactly how the procedures are untertaken

For the most part (save for the associated binaries that get called, like tar or gzip) pkgtools is written in bash script.

Sasha
 
Old 08-26-2009, 02:45 PM   #11
Cotobear
Member
 
Registered: Nov 2007
Location: Canada
Distribution: Slackware 12.0
Posts: 100

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by GrapefruiTgirl View Post
@ Cotobear,
If you're any good with bash, OR for some practice, you could always open up the pkgtool scripts in your favorite editor and examine them, to see exactly how the procedures are untertaken
One day quite possibly I will. For now I'm clueless about the formalities of bash

Quote:
Originally Posted by mRgOBLIN View Post
The .conf files are not normally over-written because the configuration files are supposed to be named "something.conf.new". There is a routine that will check to see if something.conf already exists. If not then it is written as something.conf or left with the .new extension to prevent your custom config being over-written.

It is left to the admin to check and merge/delete/over-write these files.
If you use slackpkg it will actually look for these .new files and offer to deal with them.
This makes much more sense and seems to be in line with the Slack philosophy.

Thanks very much both,
Coto
 
  


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
patching questions - upgradepkg hua Slackware 5 04-26-2009 05:57 AM
Slackpkg questions jerf Slackware 1 03-25-2008 09:41 AM
how to use upgradepkg somae Slackware 4 06-07-2007 07:04 AM
upgradepkg -- what is it used for? arcanex Slackware 3 04-06-2007 03:46 AM
Slackpkg: missing something in /usr/libexec/slackpkg/functions.d/dialog-functions.sh michelino Slackware 4 03-20-2007 01:22 PM


All times are GMT -5. The time now is 11:37 PM.

Main Menu
Advertisement
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