LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   upgradepkg -- what is it used for? (http://www.linuxquestions.org/questions/slackware-14/upgradepkg-what-is-it-used-for-543445/)

arcanex 04-04-2007 09:31 PM

upgradepkg -- what is it used for?
 
I've never been clear on what exactly upgradepkg does that the other pkgtool scripts doesn't do.

What I've always done is simply remove the old package then install the new package-- which, from its man page, is almost exactly what upgradepkg would've done.

Does upgradepkg does anything else that's so special?

Xian 04-04-2007 10:35 PM

Quote:

Originally Posted by arcanex
Does upgradepkg does anything else that's so special?

No, just as you described. That's it.

rworkman 04-04-2007 10:45 PM

No, not exactly as he described it.
installpkg(8) installs the contents of a package.
removepkg(8) removes the contents of a package.
upgradepkg(8) first renames the original package (the one that will be removed), then installs the new package, then removes the original package. It won't remove files that are contained in any other package, so the new package that was just installed will be left alone - the only files that will actually be removed are ones that are not contained in the new package. One benefit of this is that you can actually see what changed in the package structure - this has saved my butt on more than a few occasions, because I could see immediately that there was something wrong with my package.
Long story short, it might seem like semantics, but using upgradepkg(8), you always have a copy of the package contents on your system, whereas with the original poster's method, you don't. I'll leave it as an exercise for the reader as to why this is important... :)

KleB 04-06-2007 02:46 AM

upgrdepkg is also great for automating installing procedure a bit - if you have many packages, you can upgradepkg *.tgz and only the ones you already have an older version installed will be upgraded. And the --install-new option enables you exactly what it says. So, besides what has already been told it's also more practical than removing/installing by hand. ;)


All times are GMT -5. The time now is 09:15 PM.