LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Arch (http://www.linuxquestions.org/questions/arch-29/)
-   -   Anyone else 'pacman -Sy' instead of simply 'pacman -S'-ing packages? (http://www.linuxquestions.org/questions/arch-29/anyone-else-pacman-sy-instead-of-simply-pacman-s-ing-packages-865093/)

Kenny_Strawn 02-25-2011 10:55 PM

Anyone else 'pacman -Sy' instead of simply 'pacman -S'-ing packages?
 
How do you make use of pacman to install software? Personally, I would rather update the cache before I install, to ensure that I am installing the most up-to-date software possible. However, if you don't want to that's fine too. Please explain your votes.

Novartum 02-26-2011 11:23 PM

It's a very bad idea to use -Sy and will lead to breakage without extreme vigilance. You'll end up mixing up all kinds of old and new versions of software/libraries which can result in dependency issues for various apps. Always use the -S flag and stick to system-wide updates (-Syu) unless you know what you are doing.

EDIT: Please see this thread - https://bbs.archlinux.org/viewtopic.php?id=89328

Arch developer on pacman -Sy :
Quote:

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...)
Quote:

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 versions 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 prepared to fix breakage.

Greenfuse 03-02-2011 04:03 AM

I had mostly used pacman -Sy to synchronise so whatever I was asking for what was in the repos. It was my understanding that I needed an up-to-date list or there would be an error if I attempted to install an outdated package which was no longer there.

TobiSGD 03-02-2011 04:22 AM

I always update my Arch system when I start it, so I think there is no need to install software with -Sy, I always use -S.

reed9 03-02-2011 12:10 PM

I put my vote for pacman -S, since I don't refresh before installing something, but really I alias bauerbill

Code:

alias in='sudo bauerbill -S --aur'

jspaces 03-03-2011 12:51 AM

I usually use "pacman -Sy".
I build quite of few local packages and the cache requires the update in order to find it in my local repository.
I run "pacman -Syu" before installing any regular package(s) or building a package thus ensuring consistency.

Mr. Alex 03-03-2011 05:59 AM

I always install with -Sy. And full update with -Syyu.

posixculprit 03-04-2011 06:21 AM

I use `pacman -S`. Always using `pacman -Sy` reminds me of `yum`. The last time I used Fedora/CentOS yum seemed to always start by refreshing the package lists. Perhaps there are ways to prevent this from happening, I didn't stay in Fedora-land long enough to care to find out.

Thor_2.0 03-11-2011 05:25 AM

@ Novartum:

Quote:

It's a very bad idea to use -Sy and will lead to breakage without extreme vigilance. You'll end up mixing up all kinds of old and new versions of software/libraries which can result in dependency issues for various apps. Always use the -S flag and stick to system-wide updates (-Syu) unless you know what you are doing.
I fully concur, installing software should NEVER be automated. You MUST keep at least the depencencies in check.

Thor

IgnorantGuru 03-17-2011 11:44 AM

I frequently do -Sy to see what updates are available. So when I do install a package, my sync is usually already updated. But I've never had a problem doing it this way. If I did, I guess a full update would cure it.

But due to the lack of package security in Arch, I recommend adding packages with paccheck:
Code:

paccheck --install PACKAGELIST
which compares the database and packages on several mirrors to help avoid compromised mirrors.

Thor_2.0 03-22-2011 01:36 PM

@ IgnorantGuru,

Yo! Tnx for paccheck, which I still have to get up and running. I installed it using the "install" command, running

Quote:

sudo paccheck
gives me "paccheck not found"

I added myself to the sudoers config (did not have sudo installed) but to no avail...any tips?

Tnx!

Thor

Edit
Got something out of it:

Quote:

THERE WERE DOWNLOAD FAILURES - This indicates unresponsive mirror(s) or
files missing on the mirror(s).

WARNING: USING MORE THAN ONE MIRROR IS RECOMMENDED

System update is NOT recommended until the above issues are addressed.
aarnet failed, it seemed. But all in all a safer thing. Now, what? Do I wait unitl something happens? Anything I can tweak from my end?

IgnorantGuru 03-22-2011 01:57 PM

Quote:

Originally Posted by linusr@flanders (Post 4299512)
@ IgnorantGuru,

Yo! Tnx for paccheck, which I still have to get up and running. I installed it using the "install" command

Hi, You don't need sudo to run paccheck - in fact it won't let you run it as root (unless you modify the script). So first just try "paccheck". If that doesn't work, perhaps /usr/local/bin is for some reason not in your path? You could also try installing it to /usr/bin - no harm in that...

Code:

wget http://downloads.sourceforge.net/project/ig-scripts/paccheck-0.8.12.sh
sudo install paccheck-0.8.12.sh /usr/bin/paccheck

(Script Installation Instructions here)

As for why sudo said paccheck not found, maybe /usr/local/bin isn't accessible by sudo on your system. But as I said you don't need sudo for paccheck. (If you really want to run it as root for some reason, after modifying the script so it won't say "do not run as root", you could use "sudo /usr/local/bin/paccheck".)

Also note that paccheck is in the AUR, though I recommend following the verify instructions prior to installing from the AUR.

Also, paccheck does use sudo within it to run pacman. If you want to use paccheck without sudo installed, use the --no-sync option, but you will need to run these commands first as root, prior to running paccheck each time:
Code:

pacman -Sy
pacman -w --noconfirm -Su

HTH

IgnorantGuru 03-22-2011 02:03 PM

Quote:

Originally Posted by linusr@flanders (Post 4299512)
aarnet failed, it seemed. But all in all a safer thing. Now, what? Do I wait unitl something happens? Anything I can tweak from my end?

I would use a few (3 or 4) mirrors for best results. These can be configured in /etc/paccheck/mirrorlist, as discussed here. If you only used one mirror and the download failed, then paccheck couldn't accomplish anything.

If most of the mirrors respond and you're satisfied with the results, then you can proceed to update your system (pacman -Su). If you have any question on interpreting the results, just let me know.

Thor_2.0 03-23-2011 11:33 AM

Hi IgnorantGuru,

Let me take you up on your generous offer:

Quote:

If you have any question on interpreting the results, just let me know.
Ehhh, how do I make a mirrorlist for pacckeck? By the way, the thing purrs like a kitten. Real sweet, let me say this!:hattip:
Okay, after following the install instructs, I still do not have a file /etc/paccheck/mirrorlist, I may need to make one...I guess.

Sorry for my (many) questions...I use Linux for a while now, but every day it challenges me...just like being married, I guess...

Thor

IgnorantGuru 03-23-2011 12:05 PM

Quote:

Originally Posted by linusr@flanders (Post 4300573)
Okay, after following the install instructs, I still do not have a file /etc/paccheck/mirrorlist, I may need to make one...I guess.

Good point - I'll put a note about that in the install instructions. Unless you install using the AUR, you'll need to manually create that folder and file (as root):
Code:

mkdir /etc/paccheck
touch /etc/paccheck/mirrorlist

Then edit that file as root, and copy any mirrors you want to use from /etc/pacman.d/mirrorlist (paccheck accepts mirror entries in the same format as that file).

Also, just to be clear, if no mirrors are defined in /etc/paccheck/mirrorlist or its missing, paccheck uses its built-in config which includes a few mirrors. Mirror for full compare, if desired, can be specified on the command line with --compare or can be included in mirrorlist as compare=MIRROR.

Here is the default mirrorlist distributed with paccheck in the AUR:
Code:

# Compare pacman sync and package cache to these mirrors:
# Copy desired mirrors from /etc/pacman.d/mirrorlist

Server = http://mirror.aarnet.edu.au/pub/archlinux/$repo/os/$arch
Server = ftp://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/$arch
Server = http://ftp.tku.edu.tw/Linux/ArchLinux/$repo/os/$arch

# Example - Do full package download and compare on this mirror
#          (same as --compare command line option):
# Compare = ftp://ftp5.gwdg.de/pub/linux/archlinux/$repo/os/$arch

Quote:

Sorry for my (many) questions...
No problem - others usually have similar questions so answering them in a forum is good for everyone.


All times are GMT -5. The time now is 02:50 AM.