You are not logged in.

#1 2010-01-22 12:16:37

shrimphead
Member
Registered: 2008-10-13
Posts: 9

pacman -Sy <somepkg>: Why is this bad?

I read the above in this thread http://bbs.archlinux.org/viewtopic.php?id=89273

I have been using arch for a while and was under the impression that refreshing the package metadata when installing packages was a good thing to do so as to avoid any dependancy issues?

I can't find a conclusive reason why this is not the case in the pacman wiki page and was wondering if someone could enlighten me.

thanks
Matt

Offline

#2 2010-01-22 12:24:41

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,477
Website

Re: pacman -Sy <somepkg>: Why is this bad?

It can create dependency issues as Arch is designed only to have the latest versions of packages installed.

e.g. enable testing and install the latest firefox with "pacman -Sy firefox"...  that will pull in the new versions of libjpeg and libpng which will break a lot of your applications that still require the old version.   Updating all packages avoids that issue.

Issues with graphical packages is not so bad, but people got themselves into major trouble when updating readline (broken bash...)

Offline

#3 2010-01-22 14:57:16

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: pacman -Sy <somepkg>: Why is this bad?

Allan wrote:

It can create dependency issues as Arch is designed only to have the latest versions of packages installed.

e.g. enable testing and install the latest firefox with "pacman -Sy firefox"...  that will pull in the new versions of libjpeg and libpng which will break a lot of your applications that still require the old version.   Updating all packages avoids that issue.

Issues with graphical packages is not so bad, but people got themselves into major trouble when updating readline (broken bash...)

well, this is only partially true:
I did sudo pacman -Syu
got new rasqal that is not compatible with rasqal dependent software.

I don't think that pacman -Sy pkg is bad as long as you read what is going to be updated. Then say yes/no

Nobody can garantee that pacman -Syu will protect against mishaps. Only remedy is to keep last working version of pkg until you are certain that update did not break other related (but not updated) stuff.

Offline

#4 2010-01-22 15:06:40

Cows
Member
From: Brooklyn, NY
Registered: 2007-05-20
Posts: 101

Re: pacman -Sy <somepkg>: Why is this bad?

One should be reading pacman's output whether or not they are using -Sy(u). I'm going to have to go with Allan on this one though, it makes sense to update the whole system then to update a single application and risk that it's incompatible with previous versions of other applications/libraries/etc.

Offline

#5 2010-01-22 16:22:18

hatten
Arch Linux f@h Team Member
From: Sweden, Borlange
Registered: 2009-02-23
Posts: 736

Re: pacman -Sy <somepkg>: Why is this bad?

Well, there is a lot of "pacman -Sy pkg" in the wiki, could an admin write a script that changes all those to -S?

Offline

#6 2010-01-22 17:21:18

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: pacman -Sy <somepkg>: Why is this bad?

Allan wrote:

e.g. enable testing and install the latest firefox with "pacman -Sy firefox"...  that will pull in the new versions of libjpeg and libpng which will break a lot of your applications that still require the old version.   Updating all packages avoids that issue.

There is no xfdesktop in testing that depends on the new packages...?

Also I don't really understand why you are forced tu uninstall old libs. For example I installed firefox and it's deps from testing today and installed libpng and libjpeg from AUR so that I can run xfdesktop.
Yes, I know, I am doing it wrong. smile


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#7 2010-01-22 17:29:02

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: pacman -Sy <somepkg>: Why is this bad?

xfdesktop doesn't link to libpng/libjpeg. are you sure you are not using other cairo package rather the one from repos?

Last edited by wonder (2010-01-22 17:31:11)


Give what you have. To someone, it may be better than you dare to think.

Offline

#8 2010-01-22 17:38:47

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: pacman -Sy <somepkg>: Why is this bad?

Yes, I could not start xfdesktop without libjpeg7 and the libpng.
I installed the ones from AUR and it works good.

edit: xfdesktop needs at least libjpeg to render my desktop background

Last edited by Cdh (2010-01-22 17:39:25)


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#9 2010-01-22 17:46:40

barzam
Member
From: Sweden
Registered: 2009-01-27
Posts: 277

Re: pacman -Sy <somepkg>: Why is this bad?

Cows wrote:

One should be reading pacman's output whether or not they are using -Sy(u). I'm going to have to go with Allan on this one though, it makes sense to update the whole system then to update a single application and risk that it's incompatible with previous versions of other applications/libraries/etc.

# pacman -Sy [pkg] doesn't update a single package, it syncs the pacman database and then installs. That way the newly installed program was installed from a fresher sync than the last -Syu operation which can potentially lead to trouble.

Offline

#10 2010-01-22 17:49:57

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: pacman -Sy <somepkg>: Why is this bad?

Cdh wrote:

Yes, I could not start xfdesktop without libjpeg7 and the libpng.
I installed the ones from AUR and it works good.

edit: xfdesktop needs at least libjpeg to render my desktop background

you really think that i don't know what i'm talking about?

pacman -Qlq xfdesktop | xargs file | grep ELF | awk -F: '{print $1}' | while read elfobj; do readelf -d $elfobj | grep NEEDED | sed 's/\[//;s/\]//' | nl | while read c1 c2 c3 c4 c5 c6; do echo $p,$elfobj,$c1,$c6; done; done

it doesn't link! other dependency link to libjpeg/libpng.

Last edited by wonder (2010-01-22 18:37:28)


Give what you have. To someone, it may be better than you dare to think.

Offline

#11 2010-01-22 17:57:48

thayer
Fellow
From: Vancouver, BC
Registered: 2007-05-20
Posts: 1,560
Website

Re: pacman -Sy <somepkg>: Why is this bad?

hatten wrote:

Well, there is a lot of "pacman -Sy pkg" in the wiki, could an admin write a script that changes all those to -S?

I know and it's annoying.  Someone keeps going through the articles I've written and changing the flags to -Sy.  It should be assumed that whenever installing a new application the user has already run -Syu to ensure their system is up to date.  Therefore the -y is not necessary and just slows down the installation process for those who copy/paste from the wiki.


thayer williams ~ cinderwick.ca

Offline

#12 2010-01-22 18:31:17

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: pacman -Sy <somepkg>: Why is this bad?

I've always considered the behavior and lack of documentation a bug.  Unix command switches are supposed to be orthogonal and safe to use in combination.  Combinations not intended to be used should not exist, should not parse, or at least should be loudly documented.  More importantly, unsafe actions should be obvious.  "rm -rf /" is pretty obvious from reading the docs.  "pacman -Sy <package>" is not.  It is amazing the denials people will go through so that they do not have to talk about this.

thayer wrote:

Someone keeps going through the articles I've written and changing the flags to -Sy.

Some people are evil and/or misinformed and/or hate Arch.

I've resorted to never using pacman, instead writing a wrapper (pacmatic) to take care of the most dangerous, trivial and easy to patch problems.

Edit: The devs are cool, but there is just such a huge gap between how they understand pacman should be used, and what users actually do with it.

Last edited by keenerd (2010-01-22 18:55:10)

Offline

#13 2010-01-22 19:37:29

pointone
Wiki Admin
From: Waterloo, ON
Registered: 2008-02-21
Posts: 379

Re: pacman -Sy <somepkg>: Why is this bad?

Unfortunately, this (mis)information has propagated to many pacman translations on the wiki (which would explain why editors are using these flags). This was amended only in June 2009 (see this revision). I've added a note to the English version, for what it's worth.


M*cr*s*ft: Who needs quality when you have marketing?

Offline

#14 2010-01-22 19:38:49

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: pacman -Sy <somepkg>: Why is this bad?

wonder wrote:

it doesn't link! other dependency link to libjpeg/libpng.

Maybe not directly, I don't know.

What I know is:
I typed xfdesktop in the terminal and got the error about the missing libjpeg. I didn't research what xfdesktop might have called that needs libjpeg.
Try -Rd libjpeg and starting xfdesktop yourself.


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#15 2010-01-22 19:54:49

sausageandeggs
Member
Registered: 2009-12-05
Posts: 66

Re: pacman -Sy <somepkg>: Why is this bad?

thayer wrote:
hatten wrote:

Well, there is a lot of "pacman -Sy pkg" in the wiki, could an admin write a script that changes all those to -S?

I know and it's annoying.  Someone keeps going through the articles I've written and changing the flags to -Sy.  It should be assumed that whenever installing a new application the user has already run -Syu to ensure their system is up to date.  Therefore the -y is not necessary and just slows down the installation process for those who copy/paste from the wiki.

Hmm.. I've seen this coming up a few times lately, in fact i recently changed one "-Sy" to "-S" on the beginers guide that seemed to be catching a few people out. It might be worth adding some sort of warning about running "pacman -Sy <somepkg>" so that hopefully people know the risks right from the off (might link this disscusion as well). What do people think?

Offline

#16 2010-01-22 20:00:45

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: pacman -Sy <somepkg>: Why is this bad?

Cdh wrote:

What I know is:
I typed xfdesktop in the terminal and got the error about the missing libjpeg. I didn't research what xfdesktop might have called that needs libjpeg.
Try -Rd libjpeg and starting xfdesktop yourself.

fully updated from testing, xfdesktop working fine. like i said before be sure you are not using some packages from aur. is simple to debug, using my previous command find out on what it links, find out the package that contain that so and see if you have the latest version.

Last edited by wonder (2010-01-22 20:04:05)


Give what you have. To someone, it may be better than you dare to think.

Offline

#17 2010-01-22 21:34:54

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,477
Website

Re: pacman -Sy <somepkg>: Why is this bad?

keenerd wrote:

I've always considered the behavior and lack of documentation a bug.  Unix command switches are supposed to be orthogonal and safe to use in combination.  Combinations not intended to be used should not exist, should not parse, or at least should be loudly documented.  More importantly, unsafe actions should be obvious.  "rm -rf /" is pretty obvious from reading the docs.  "pacman -Sy <package>" is not.  It is amazing the denials people will go through so that they do not have to talk about this.

Here goes my denial....  tongue

On a "stable release" distro where there are no library soname bumps, "pacman -Sy <pkg>" is perfectly safe.  So it is not a bug as far as pacman is concerned.

On Arch, we only support the package version that are currently in the repos.  "pacman -Sy <pkg>" can lead to a mixture of packages that are currently in the repos and some that are outdated so leads to an unsupported system...  Its use is still not a bug and in fact I use it quite often when I do not do a full update, but I know exactly what I am doing and am prepare to fix breakage.

Offline

#18 2010-01-22 22:38:43

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: pacman -Sy <somepkg>: Why is this bad?

shrimphead wrote:

I read the above in this thread http://bbs.archlinux.org/viewtopic.php?id=89273

I have been using arch for a while and was under the impression that refreshing the package metadata when installing packages was a good thing to do so as to avoid any dependancy issues?

I can't find a conclusive reason why this is not the case in the pacman wiki page and was wondering if someone could enlighten me.

thanks
Matt

pacman -Sy is perfectly fine for experienced users, imho..and certainly preferable under a few conditions. There have been times when this has been recommended in the front page news.

I believe it should not be recommended in the wiki because a.) we have people who are very new, following  howtos line by line and b.) it can, in some cases lead to breakage or pacman complaints (especially if you have not upgraded the entire system in a while).

In conclusion, it is appropriate rarely, and should be recommended rarely..imho.

Offline

#19 2010-01-22 22:46:19

keenerd
Package Maintainer (PM)
Registered: 2007-02-22
Posts: 647
Website

Re: pacman -Sy <somepkg>: Why is this bad?

Thank you Allan.  I hope this does not come off as being personal, but you clearly outlined two major points.

Allan wrote:

On a "stable release" distro where there are no library soname bumps, "pacman -Sy <pkg>" is perfectly safe.  So it is not a bug as far as pacman is concerned.

A broken clock is still correct twice a day.  "Stable clock" users only look at their clock twice a day, and it is correct when they do.  It works flawlessly for this possibly-hypothetical-but-possibly-very-important-minority of people, so it is not a bug.

Allan wrote:

but I know exactly what I am doing and am prepare to fix breakage.

Before you could know, you had to learn.  How did you learn exactly what "-Sy package" does?  It is not in the fine man page.  No first timer understands what it does.  RTDM (Read The Dev's Mind) appears to be the only way.

Offline

#20 2010-01-22 23:58:59

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: pacman -Sy <somepkg>: Why is this bad?

wonder wrote:

fully updated from testing, xfdesktop working fine. like i said before be sure you are not using some packages from aur. is simple to debug, using my previous command find out on what it links, find out the package that contain that so and see if you have the latest version.

Maybe there is something in testing that prevents it. I don't know and at the moment I don't care too much. smile


Actually I sometimes run into such situations:
I do pacman -Syu, then I see "oh, 500 mb updates, I will do that later" and abort.
After doing something else I want to install something with pacman -S which is not very good. Yes, pacman tells me what it is doing but I do not always have in mind I did not upgrade yet.


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#21 2010-01-23 00:31:06

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,477
Website

Re: pacman -Sy <somepkg>: Why is this bad?

keenerd wrote:
Allan wrote:

but I know exactly what I am doing and am prepare to fix breakage.

Before you could know, you had to learn.  How did you learn exactly what "-Sy package" does?  It is not in the fine man page.  No first timer understands what it does.  RTDM (Read The Dev's Mind) appears to be the only way.

The man page tell you exactly what "-Sy <pkg>" does;  updates the database installs the package, pulling in any needed dependencies.  This is not a bug in pacman.  It does exactly what is asked, and being flexible package management system is a good thing.

The fact that pulling some new deps might break your system is an Arch packaging choice.  Given we only support the packages currently in our repos, we do not see this as an issue as if your system is fully up-to-date when you do this, nothing will break.  We expect our users to be competent enough to fix very minor issues like this.  Worst case scenario requires a rescue disk and a full update and that should not be beyond the competent Linux user that Arch is aimed at.

Note that last time this was brought up, someone went through the wiki changing many references of "pacman -Sy <pkg>" to just "pacman -S <pkg>" but then other people know better and changed them back...

Offline

#22 2010-01-23 04:51:49

Cows
Member
From: Brooklyn, NY
Registered: 2007-05-20
Posts: 101

Re: pacman -Sy <somepkg>: Why is this bad?

barzam wrote:
Cows wrote:

One should be reading pacman's output whether or not they are using -Sy(u). I'm going to have to go with Allan on this one though, it makes sense to update the whole system then to update a single application and risk that it's incompatible with previous versions of other applications/libraries/etc.

# pacman -Sy [pkg] doesn't update a single package, it syncs the pacman database and then installs. That way the newly installed program was installed from a fresher sync than the last -Syu operation which can potentially lead to trouble.

Yes but it essentially ends up doing the same thing, at least for this example.

pacman -Sy refreshes database, and then you install whatever application you want that's new from the refreshed database. New application, maybe new libs and other things attached to that new application. The system hasn't been updated as a whole and therefore could have compatibility issues.

pacman -Syu refreshes database and updates all installed applications. Then you can install whatever application you want and it would have a better chance of it working fine because the system is up to date.

Offline

#23 2010-01-23 04:51:57

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: pacman -Sy <somepkg>: Why is this bad?

Let me review and see if I've got this right. If I want to install a new package foo, the best approach is:

pacman -Syu
pacman -S foo

The following, alternative approach is dangerous because it might update some of the libraries I already have installed that some of my other packages use, without upgrading those other packages:

pacman -Sy foo

(Is that really true? `pacman -Sy foo` might upgrade some dependencies, it won't restrict itself to only pulling in packages I don't yet have installed? Or have I misidentified what it is bad that `pacman -Sy foo` might do?)
This is allegedly somewhat better:

pacman -S foo

though not as good as the first option. One reason it's better is that it doesn't waste time synching. But it's also allegedly safer. (Why exactly?) However, if my local cache of the repo metadata is out of date, say locally I think the latest version of foo (or of a lib foo depends on that I don't have installed) is 1.0, but remotely the latest version is 2.0, what will happen when I do `pacman -S foo`? I'll get version 2.0? The install will fail? I don't think I'll get version 1.0, will I?

I understand why the first choice is better than the other two, but I don't understand clearly why the third choice should be more reliable or safer than the second. And I've been using Arch for a while now...

Last edited by Profjim (2010-01-23 04:53:00)

Offline

#24 2010-01-23 05:19:23

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: pacman -Sy <somepkg>: Why is this bad?

Another problem with doing pacman -Sy pkg. Even if that doesn't break anything, if you then go and install other packages without upgrading the system, you might (or might not) eventually break something. So you are always just better off to pacman -Syu if you are after the latest version of a package.


neutral

Offline

#25 2010-01-23 05:42:43

Profjim
Member
From: NYC
Registered: 2008-03-24
Posts: 658

Re: pacman -Sy <somepkg>: Why is this bad?

sand_man wrote:

Another problem with doing pacman -Sy pkg. Even if that doesn't break anything, if you then go and install other packages without upgrading the system, you might (or might not) eventually break something. So you are always just better off to pacman -Syu if you are after the latest version of a package.

Yes, but I think this thread is about how best to install new packages, not about doing piecemeal upgrades.

Offline

Board footer

Powered by FluxBB