Is it bad to use "-Syu" every time I install a package through pacman?
Every time I want to install something using pacman I always use:
pacman -Syu <package>
But when I see application installation/config instructions online, it usually says:
pacman -S <package>
If I understand correctly, -Syu will just make sure all my packages are up to date before installing <package>; is this correct? Is there any problems associated with doing this for each install?
About this post
- Posted
- Archived
- Score
- 12 · 100% up
- Kind
- Text
- ID
- sfmtj
16 comments
Doing -Syu when installing a package may take longer but is preferred.
It's -Sy package that is to be avoided at all costs as this updates the database but doesn't upgrade packages and can result in version conflicts and breakage.
Actually if your installing Program A that requires LibB >=2.0, but you only have LibB 1.9 pacman will add the newest version to the install list as it would with any dependencies. In the rare event the packager hasn't set the minimal dependency versions correctly your new program will simply not start and a simple
-Suafterwards will fix it.Though if it's boot/kernel related and you don't catch it till you reboot, prepare to be
chroot'ing in from another system to fix it. ;PIt depends on how often you do a Syu. I do a pacman Syu every day so repeating it again whenever i install a new package is pointless and just wastes time.
It is better to Syu before you install a package, because a package could require a specific version of a package that your local pacman db does not know about yet
I thought packages did a version check of the dependencies.
Yes they do, nothing bad should happen, it will just fail.
actually, it will just try and fail to get the old versions of the files. Happened to me a couple of times
It's not bad. In fact, it's a good practice that many just simply neglect.
On a related question, is it bad to use yaourt for updates?
Nope. Yaourt is just a wrapper for pacman, you're doing
with the addition of searching for updated AUR pkgbuilds.
EDIT: If you have yaourt installed, this is the preferred way to update, actually.
Thanks. I don't remember why I was thinking that yaourt mishandled updates, but I've been using pacman to update from the official repos and only using yaourt for the AUR. I'll start using it for all updates now.
No, that's not bad. All it'll do is check for new versions of all your packages everytime you install something, which will be slow. It's exactly equivalent to
pacman -Syu; pacman -S <package>. Doingpacman -S <package>will pull whatever your computer thinks is the latest rather than what actually is the latest, which will fail if the package has been updated since you last synced, but the only time I've ever encountered this is on an install that hadn't been updated in 3 months. The only thing that should cause problems ispacman -Sy <package>since that'll install the latest version of the package but won't update your system to match, and so if that package's dependencies are out of date it'll install but fail to run.You should be okay. Something to keep in mind is to check archlinux.org before you do an -Syu incase something needs manual intervention.
-S is to install packages, and is generally recommended if you just want to install a new package. unless you are ready to update. I think updating your entire system for one package if the dependency versions didn't change since your last update is a bit overkill, and might lead to unexpected breakage that can take longer to fix, which is bad if you don't have the time.
Just for installing a package, I might at most do an -Sy, but later that day or the next will do a full system upgrade so I don't screw something up on accident.
Deleted before we saved it.
I actually use -Syyu for my first install for the day to ensure consistency with repos, but I think it's overkill. -Syu is probably enough. Although, I've been using Arch with -Syyu installs daily for several months and it has never broken (on its own, anyway). That's with the testing repo. For a repo that's a day or so behind the mainline kernel, I think that's amazing, compared to when I used to use Ubuntu.
The whole minimal packages thing (well I use XFCE) seems to really increase stability compared to Ubuntu, even with cutting edge packages.