[SOLVED] Possible bug or strange feature of upgradepkg?
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.
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309
Rep:
Possible bug or strange feature of upgradepkg?
I use Slackware 12.2 on two machines. Today fan in my primary machine broke down so I started my secondary machine. I didn't use it for a few months, so I decided to upgrade all out of date packages. I put into the directory with the patches sixteen new packages from USB flash drive. Among them there were newer versions of six packages already existing in that directory: bind, mozilla-firefox, mozilla-thunderbird, ntp, samba, and seamonkey. In result I had in that directory these six packages in two versions each:
During the update process I observed that upgradepkg program had problems with mentioned packages. Instead of simply upgrade all the packages it did strange things. In the case of bind, mozilla-thunderbird, ntp, and seamonkey it first downgraded these packages and then upgraded them. In the case of mozilla-firefox and samba it first upgraded these packages and then downgraded them. So it did a lot of unnecessary work and after the upgrade process I remained with the old versions of mozilla-firefox and samba.
This is concise abstract from upgradepkg log:
Code:
Upgrading bind-9.4.3_P3-i486-1_slack12.2 package using ./bind-9.4.3_P1-i486-1_slack12.2.tgz
Upgrading bind-9.4.3_P1-i486-1_slack12.2 package using ./bind-9.4.3_P3-i486-1_slack12.2.tgz
Upgrading mozilla-firefox-3.0.6-i686-1 package using ./mozilla-firefox-3.0.13-i686-1.tgz
Upgrading mozilla-firefox-3.0.13-i686-1 package using ./mozilla-firefox-3.0.6-i686-1.tgz
Upgrading mozilla-thunderbird-2.0.0.22-i686-1 package using ./mozilla-thunderbird-2.0.0.19-i686-1.tgz
Upgrading mozilla-thunderbird-2.0.0.19-i686-1 package using ./mozilla-thunderbird-2.0.0.22-i686-1.tgz
Upgrading ntp-4.2.4p7-i486-1_slack12.2 package using ./ntp-4.2.4p6-i486-1_slack12.2.tgz
Upgrading ntp-4.2.4p6-i486-1_slack12.2 package using ./ntp-4.2.4p7-i486-1_slack12.2.tgz
Upgrading samba-3.2.7-i486-1_slack12.2 package using ./samba-3.2.13-i486-1_slack12.2.tgz
Upgrading samba-3.2.13-i486-1_slack12.2 package using ./samba-3.2.7-i486-1_slack12.2.tgz
Upgrading seamonkey-1.1.17-i486-1_slack12.2 package using ./seamonkey-1.1.14-i486-1_slack12.2.tgz
Upgrading seamonkey-1.1.14-i486-1_slack12.2 package using ./seamonkey-1.1.17-i486-1_slack12.2.tgz
This is longer log including all packages skipped and updated:
Is it a bug or a ``feature'' of upgradepkg? Have I report it to Patrick or just remember to manually remove older package's sources before updating to the newer ones?
It's always done that. Caught me out a long while ago too, when I used to manually download all the patches (nowadays I use a rsync mirror so I don't see the duplicates). Upgradepkg doesn't make any distinctions about whether the version is newer than the installed version or not. Probably best to think of it as 'replacepkg'.
It is a feature, not a bug!
The slackware package tools do not work with the concept of "older" or "newer", only with the concept of "different". So, using upgradepkg you can just as easily downgrade a package to an earlier version as upgrade to a newer version.
It is you, the admin of the Slackware system, who is being forced to do some housekeeping.
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309
Original Poster
Rep:
I only wonder why upgradepkg used with the wildcard such as *.tgz or mozilla-firefox-* doesn't try to inspect the entire directory and doesn't try to recognize the newest packages.
Nope... upgradepkg is not intelligent, it just assumes that you know what you are doing. If you give it a wildcard list of packages to chew on, it will "upgrade" every single one of those.
Program upgradepkg interpreting wildcards in an intelligent way could be still used to downgrade the programs.
except ofcourse, it's not upgradepkg that's doing the wildcard expansion. It's the shell.
upgradepkg is a simple tool designed to update a single package. The fact that it can be given a list of them is just a convenience to the user. Having it check for duplicates is probably outside of its scope, though if it really bothers you, it shouldn't be that hard for you to write a wrapper script that does what you want.
Not all of us enjoy fast downloads and generous download limits. I regularly update my desktop using slackpkg but have the downloads saved rather than deleted (DELALL=off in slackpkg.conf). Then I can copy the contents of /var/cache/packages to a usb key for updating my laptop. Plug the key, change to the directory holding the copied contents, su to root and then 'upgradepkg ./*/*/*.t?z'. This works well for me, but I do need to remember to be careful of multiple versions of packages and also to check for .new files with 'slackpkg new-config'.
I propose because 3.0.6 is being considered higher number than 3.0.13 it downgrades firefox. Or am i mistaken?
Just like Alien BOB said before, upgradepkg doesnt care about versions.
If you point it to a file which has a different version than the one you have installed, it will "upgrade" it even if its in essense a downgrade.
It wouldnt matter even if the file was firefox-2.1.
So you are mistaking, yes.
Remember, this is Slackware. The package manager is the admin.
Distribution: Slackware (personalized Window Maker), Mint (customized MATE)
Posts: 1,309
Original Poster
Rep:
Quote:
Originally Posted by Alien Bob
Learn to live with it, it's the Slackware way ;-)
I'm learning to live with it for nine years. So far I always removed old packages from the directory including updates before I started upgradepkg. Today I was forced to use the other machine and I was in a rush so I just copied newer packages from USB flash drive to the directory with the updates and I started upgradepkg immediately. In result I observed that strange feature of that program. It isn't strange for those who know about it -- it was strange for me because I saw it for the first time.
Just the same as allend I always download new packages only once and then ``clone'' them on two other machines: my secondary and mine friend's primary. As a matter of fact I have ``fast downloads and generous download limits'' but I don't like to generate unwanted traffic. Perhaps I'm slightly old-fashioned.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.