[SOLVED] why does /sbin/upgradepkg install a package twice?
SlackwareThis 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.
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.
Why do you care what it does? I assume that there were cases in the past where doing just the first two steps resulted in a broken installation.
EDIT: Looking through /sbin/upgradepkg itself, you can read about the --no-paranoia option and the comments related to it.
It seems that if a package used to directly manage a file and then someone changes the package to move the file into place, the install-new/delete-old method will result in the moved file disappearing. So, it's install-new/remove-old/install-new to ensure such files (normally configuration files) are correctly installed.
Last edited by Richard Cranium; 09-11-2015 at 07:44 AM.
Reason: Actually looked at the source.
It seems that if a package used to directly manage a file and then someone changes the package to move the file into place, the install-new/delete-old method will result in the moved file disappearing. So, it's install-new/remove-old/install-new to ensure such files (normally configuration files) are correctly installed.
thx a lot for your help. i read the source but i didn't understand, but now i think i do.
example: an installed pkg has a file etc/c.conf in its file list. the new version uses the config() routine in doinst.sh to create this file. when removing the old pkg, etc/c.conf will be removed, because it's not part of the filelist of the new package.
Whilst looking at some pkgtools changes for 14.2 and reviewing the speedup patches that ARM has, I came across this note I'd saved years ago when I asked Pat the same question:
thanks for sharing, so i can be sure my assumption are right. btw, it's another great example of how bad and harmful symlinks are (plan 9 has no symlinks for good reasons). you better avoid them like the plaque.
rob pike's comment on symlinks:
Quote:
It started to go wrong when the BSD signal stuff went in (I complained at the time), then symlinks, sockets, X11 windowing, and so on, none of which were added with proper appreciation of the Unix model and its simplifications.
p.s.: are there important pkgtool changes in 14.2?
I think much of these problems can be laid at the feet of the utilities themselves. cpio seems to handle symlinks far more sensibly than tar does. It's a shame it's not been updated to support the POSIX.1-2001 archive format and has fallen out of use due to the limitations of 'ustar'. There is 'pax' from the heirloom toolset of course, but as that tends not to be commonly installed, its probably not wise to become dependent upon it.
Having said that, directories turning into symlinks and vice versa from one release to another is a complex situation, and it's probably not fair to lay the responsibility of dealing with it on an underlying archive tool. The package management tools themselves should deal with that sort of stuff. Installing the package twice seems like a quick and dirty workaround for the situation, but I guess it works.
now i remember another question i forgot to ask in the first place: why bother preinstalling a pkg? just to make sure the package will install without problems? i doubt that, because installpkg will happily install (at least it tries) a package onto my readonly /usr partition without complaining.
now i remember another question i forgot to ask in the first place: why bother preinstalling a pkg? just to make sure the package will install without problems? i doubt that, because installpkg will happily install (at least it tries) a package onto my readonly /usr partition without complaining.
Without the first install, if you were to upgradepkg tar, coreutils, sed, grep, or such packages, the remove will remove those tools, and (what is the second) install would fail due to missing programs. With the first install those tools won't be removed, since they are found in more than the package that is removed.
now i remember another question i forgot to ask in the first place: why bother preinstalling a pkg? just to make sure the package will install without problems? i doubt that, because installpkg will happily install (at least it tries) a package onto my readonly /usr partition without complaining.
Patrick says:-
Quote:
The directory - symlink rationale for the install/uninstall/reinstall cycle is a rare thing. At this point, the .new files are the real reason.
The problem happens when a package used to install /etc/some/conffile.conf directly, and then a newer package changes to using /etc/some/conffile.conf.new.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.