You are not logged in.

#1 2014-06-18 11:33:09

bdantas
Member
Registered: 2014-05-13
Posts: 94

[SOLVED] Would "pacman -S foo" fail if system's package list is old?

I'm new to Arch and want to understand my system as much as possible.

In several places in the wiki it is recommended to install a single package with "pacman -S foo" instead of "pacman -Sy foo" unless I'm doing a system upgrade at the same time, so that versions of foo and its dependencies are in sync with all the other packages on my system. This seems to be good advice and I follow it.

However, I recently read that the Arch repos only have the latest version of any given package. Now I'm confused. So what happens if the versions of foo and its dependencies on my package masterlist are outdated? Would "pacman -S foo" fail? If not, how can it possibly work if pacman is trying to install package versions that are no longer in the repository?

Last edited by bdantas (2014-06-18 12:34:01)

Offline

#2 2014-06-18 11:40:36

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Would "pacman -S foo" fail if system's package list is old?

It won't work, pacman will error out saying that it can't find the file.
You should always update your whole system before installing new software i.e. run 'pacman -Syu' first or you can run 'pacman -Syu foo'.

Offline

#3 2014-06-18 11:44:04

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,456
Website

Re: [SOLVED] Would "pacman -S foo" fail if system's package list is old?

To be safest, always use `pacman -Syu <newpackage>`.

I generally use `pacman -S <newpackage>` which is a bit quicker - and this is fine if you update frequently.  I do a `-Syu` at least once a day.

Never ever do a `pacman -Sy <newpackage>`.  This can lead to severe breakage and potentially a completely unbootable system.  In fact never do `pacman -Sy` in any way unless there is also a 'u' there (i.e. "-Syu").  I think a feature request for pacman could be made to have a prompt when such a command is entered "Are you an idiot?[Y/n]  Do you want pacman to destroy your system? [Y/n]".

In contrast, `pacman -S <newpackage>` should never do any damage.  If your package database is still current, it will work fine.  If you package database is too old, it will exit with an error message without making any changes to your system.  The error message is along the lines of the package/file not being found in the repos or on the server(s).

EDIT: as this is already well covered in the wiki this may be best suited to the NC.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2014-06-18 12:33:15

bdantas
Member
Registered: 2014-05-13
Posts: 94

Re: [SOLVED] Would "pacman -S foo" fail if system's package list is old?

Thank you both. Everything is crystal-clear now. I appreciate the help.

Offline

Board footer

Powered by FluxBB