Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question about pkgtools

55 views
Skip to first unread message

Steven Woody

unread,
Sep 16, 2008, 8:59:17 PM9/16/08
to
I can't understand the purpose of upgradepkg, specifically, what is
the difference between upgradepkg and removepkg + installpkg? Thanks.

Dan C

unread,
Sep 16, 2008, 9:26:57 PM9/16/08
to
On Tue, 16 Sep 2008 17:59:17 -0700, Steven Woody wrote:

> I can't understand the purpose of upgradepkg, specifically, what is
> the difference between upgradepkg and removepkg + installpkg? Thanks.

One stop shopping, mostly.

man upgradepkg

> User-Agent: G2/1.0
> X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1;

Great. A n00b and a Win-droid, all in one.


--
"Ubuntu" -- an African word, meaning "Slackware is too hard for me".
The Usenet Improvement Project: http://improve-usenet.org

Message has been deleted

Steven Woody

unread,
Sep 16, 2008, 10:58:37 PM9/16/08
to

I did read the man page, and my question is still there: it seems
upgradepkg will do same thing almost exactly as removepkg + installpkg
will do on a system. This is what confuse me. Actually, in man page,
it says that upgradepkg will firstly do install then do removing, but
I am thinking, will it make difference? And, what's the design purpose
compared to do removing first and then do install ( as removepkg +
installpkg will do).

I hope you experts get my point. Thanks.

-
narke

~kurt

unread,
Sep 16, 2008, 11:40:55 PM9/16/08
to
Steven Woody <narke...@gmail.com> wrote:
>
> I did read the man page, and my question is still there: it seems
> upgradepkg will do same thing almost exactly as removepkg + installpkg

Well, as hinted to before, it is just a time saving tool.

> will do on a system. This is what confuse me. Actually, in man page,
> it says that upgradepkg will firstly do install then do removing, but

It says "It does this by INSTALLING the new package onto the system,
and then REMOVING any files from the old package that aren't in
the new package."

> I am thinking, will it make difference? And, what's the design purpose
> compared to do removing first and then do install ( as removepkg +
> installpkg will do).

It is the difference between typing two commands vs. one - that is my guess.

I believe the idea is to do this as efficiently as possible. Files with
the same name will be overwritten. Things that are not needed are deleted.
I guess it could save some system resources, although it might not be as much
of an issue now days - hard drives are pretty quick....

I imagine the only real difference in the end result is where stuff would
get placed on the hard drive. Not sure which way would be better - that
probably depends on the condition of the hard drive, and all sorts of other
hardware stuff.

To know the real reason for the command, you would have to ask Pat.

- Kurt

Grant

unread,
Sep 17, 2008, 12:02:37 AM9/17/08
to
On Tue, 16 Sep 2008 19:58:37 -0700 (PDT), Steven Woody <narke...@gmail.com> wrote:

...


>I am thinking, will it make difference? And, what's the design purpose
>compared to do removing first and then do install ( as removepkg +
>installpkg will do).

Try doing this with removepkg + installpkg:

Update my slackware-11.0 install to latest patches:

~# upgradepkg /home/slack/slackware-11.0/patches/packages/*tgz

This updates any packages to the latest available under the patches
area in the local install mirror at /home/slack, got it?

Grant.
--
http://bugsplatter.id.au/

Robby Workman

unread,
Sep 17, 2008, 12:10:27 AM9/17/08
to
On 2008-09-17, Steven Woody <narke...@gmail.com> wrote:
> I can't understand the purpose of upgradepkg, specifically, what is
> the difference between upgradepkg and removepkg + installpkg? Thanks.


Big difference. :)

In reality, there's some footbullet protectors in place for this
sort of scenario, but pretend for a moment that there aren't.

You have bash-3.1.000-i486-1.tgz installed, and you need to have
bash-3.1.017-i486-1.tgz installed. If "upgradepkg" doesn't exist,
what do you do? You certainly can't do "removepkg bash" unless
you change root's shell first. Ultimately, the same can be said
for many other packages - if you have to remove the existing package
first, then there's a non-zero amount of time where Bad Things can
happen. To work around it, you'd do this first:
installpkg bash-3.1.017-i486-1.tgz
This would overwrite most files in the old bash package with the
ones from the newer package. Next, you'd do this:
removepkg bash-3.1.000-i486-1.tgz
This would remove all the files in the old bash package, EXCEPT
it won't remove any files that are listed in /var/log/packages/*
as belonging to another package. Therefore, since most of its
files will belong to the *new* bash package, they won't be removed
(which is correct behavior, since they were overwritten by the new
files).

Some things can go wrong with that manual approach though - here's
one potential failure case:
Pretend bash-3.1.000 has a /somewhere/somefile present, and it
also creates a symlink /somewhere_else --> /somewhere.
Now pretent bash-3.1.017 has moved somefile to /somewhere_else/somefile
for whatever reason, and the old /somewhere directory is now obsolete.
When you install bash-3.1.017, 'somefile' will be put in /somewhere_else,
BUT keep in mind that /somewhere_else --> /somewhere symlink, so really
the file is in /somewhere. Everything is still working, so you're happy,
and all is right with the world. Then you remove the old bash package.
This happily removes the /somewhere_else --> /somewhere symlink because
it's not present in any other package, and to add insult to injury, the
/somewhere/somefile ( the one that your new bash package thought was in
/somewhere_else, but isn't thanks to the symlink) is also removed, because
it's not part of an existing package. You need to install the new
bash package one more time to make sure everything is as intended.

Long story short, upgradepkg(8) is there for a reason - use it :-)

-RW

L

Sylvain Robitaille

unread,
Sep 17, 2008, 12:53:36 AM9/17/08
to
Steven Woody wrote:

> I did read the man page, and my question is still there: ...

You could try examining the script: /sbin/upgradepkg Everything you're
trying to understand is in there.

> it seems upgradepkg will do same thing almost exactly as removepkg +

> installpkg will do on a system. ...

It's not "almost exactly". It may have the same effect in the end, but
the procedure is different.

> I am thinking, will it make difference? And, what's the design purpose
> compared to do removing first and then do install ( as removepkg +
> installpkg will do).

Try removepkg followed by installpkg on a running system the next time
you upgrade something like libc. You'll understand why upgradepkg works
the way it does.

I hope that helps.

--
----------------------------------------------------------------------
Sylvain Robitaille s...@alcor.concordia.ca

Network and Systems analyst Concordia University
Instructional & Information Technology Montreal, Quebec, Canada
----------------------------------------------------------------------

Steven Woody

unread,
Sep 17, 2008, 4:37:44 AM9/17/08
to
On Sep 17, 12:10 pm, Robby Workman <newsgro...@rlworkman.net> wrote:

Thank you Robby! I think I understand what you said. So I believe
upgradepkg did things in a way so much different than what removepkg
and installpkg did.

Munra

unread,
Sep 17, 2008, 5:16:22 PM9/17/08
to
On Sep 16, 11:10 pm, Robby Workman <newsgro...@rlworkman.net> wrote:

Thanks Robby.

Munra

unread,
Sep 17, 2008, 5:17:01 PM9/17/08
to
On Sep 16, 11:10 pm, Robby Workman <newsgro...@rlworkman.net> wrote:

Thanks Robby.

Munra

unread,
Sep 17, 2008, 5:16:43 PM9/17/08
to
On Sep 16, 11:10 pm, Robby Workman <newsgro...@rlworkman.net> wrote:

Thanks Robby.

Loki Harfagr

unread,
Sep 18, 2008, 2:56:14 AM9/18/08
to
Wed, 17 Sep 2008 14:17:01 -0700, Munra did cat :

>> L
>
> Thanks Robby.

# kbdrate -d 500 -r 2.0 -s

notbob

unread,
Sep 22, 2008, 3:59:56 PM9/22/08
to
On 2008-09-17, Robby Workman <newsg...@rlworkman.net> wrote:

> Big difference. :)

[...]

As usual, an excellent explanation from RW. I'll add my "thanks Robby" to the
chorus. :)

nb

0 new messages