You are not logged in.

#1 2012-03-04 18:34:21

solar impulse
Member
From: Out in space.
Registered: 2011-12-24
Posts: 22

[SOLVED] Difference between upgrading and reinstalling

Assuming that package-x is already installed on my system, and that it is the only package that needs updating, what is the difference between:

sudo pacman -Syu

sudo pacman -S package-x

I know the first syncs, refreshes package list, and also install all updates, but I'm talking specifically about package-x. Is there a difference between 'upgrading', and 're-installing'?

Last edited by solar impulse (2012-03-04 19:05:37)


Arch | Xmonad

Offline

#2 2012-03-04 18:37:38

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

Re: [SOLVED] Difference between upgrading and reinstalling

You can run

sudo pacman -Syu package-x

too.


'sudo pacman -Syu' won't install any new packages (unless some packages get new dependencies, like pacman 3 -> pacman 4 upgrade) while 'sudo pacman -S package-x' will (re)-install package-x.

You shouldn't cherry-pick updates so just run 'sudo pacman -Syu'. If you want to install a new package, first update your system, then run 'sudo pacman -S package-x'.


Edit:

solar impulse wrote:

s there a difference between 'upgrading', and 're-installing'?

'upgrading' means 'installing a new version' while 're-installing' means 'installing the same version'.

Last edited by karol (2012-03-04 18:40:43)

Offline

#3 2012-03-04 18:42:14

solar impulse
Member
From: Out in space.
Registered: 2011-12-24
Posts: 22

Re: [SOLVED] Difference between upgrading and reinstalling

karol wrote:

You can run

sudo pacman -Syu package-x

too.


'sudo pacman -Syu' won't install any new packages (unless some packages get new dependencies, like pacman 3 -> pacman 4 upgrade) while 'sudo pacman -S package-x' will (re)-install package-x.

You shouldn't cherry-pick updates so just run 'sudo pacman -Syu'. If you want to install a new package, first update your system, then run 'sudo pacman -S package-x'.


Edit:

solar impulse wrote:

s there a difference between 'upgrading', and 're-installing'?

'upgrading' means 'installing a new version' while 're-installing' means 'installing the same version'.

Got it.

So is there any difference between updating and reinstalling? What does reinstalling do that udating doesn't? I'm assuming it's the same thing with a different label.


Arch | Xmonad

Offline

#4 2012-03-04 18:45:42

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

Re: [SOLVED] Difference between upgrading and reinstalling

Assuming you've run 'sudo pacman -Sy' first, when running 'sudo pacman -S package-x' you're not re-installing, you're updating / upgrading package-x.


Edit: Argh, I meant "when running 'sudo pacman -S package-x'". Fixed it now.

Last edited by karol (2012-03-04 18:47:22)

Offline

#5 2012-03-04 18:51:01

solar impulse
Member
From: Out in space.
Registered: 2011-12-24
Posts: 22

Re: [SOLVED] Difference between upgrading and reinstalling

karol wrote:

Assuming you've run 'sudo pacman -Sy' first, when running 'sudo pacman -S package-x' you're not re-installing, you're updating / upgrading package-x.


Edit: Argh, I meant "when running 'sudo pacman -S package-x'". Fixed it now.

That makes sense, thanks.


Arch | Xmonad

Offline

#6 2012-03-04 18:52:47

DSpider
Member
From: Romania
Registered: 2009-08-23
Posts: 2,273

Re: [SOLVED] Difference between upgrading and reinstalling

Here's what I think is the difference:

If you're missing a file from package foo (pacman -Ql foo) or that file is corrupt, reinstalling it will replace that file.

But if you're updating your system (pacman -Syu), pacman sees that it has package foo up to date and doesn't do anything.


"How to Succeed with Linux"

I have made a personal commitment not to reply in topics that start with a lowercase letter. Proper grammar and punctuation is a sign of respect, and if you do not show any, you will NOT receive any help (at least not from me).

Offline

#7 2012-03-04 18:54:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,143

Re: [SOLVED] Difference between upgrading and reinstalling

Won't 'pacman -S package-x' reinstall the existing version in the absence of an update? Whereas 'pacman -Syu' will only affect package-x if package-x is (1) not currently installed but a newly required dependency for a new version of an installed package or (2) already installed with a newer version available?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2012-03-04 19:05:05

solar impulse
Member
From: Out in space.
Registered: 2011-12-24
Posts: 22

Re: [SOLVED] Difference between upgrading and reinstalling

DSpider wrote:

Here's what I think is the difference:

If you're missing a file from package foo (pacman -Ql foo) or that file is corrupt, reinstalling it will replace that file.

But if you're updating your system (pacman -Syu), pacman sees that it has package foo up to date and doesn't do anything.

So what I learned was:

Installing an already-installed package can be seen as updating (if there is a newer version) or actual reinstalling if that package is damaged. Therefore when running pacman -Syu, pacman checks for new dependencies or updates to currently-installed packages, then does the equivalent of pacman -S on said packages, which either installs or updates depending on whether they are already installed or not.

Correct?


Arch | Xmonad

Offline

#9 2012-03-04 19:08:26

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

Re: [SOLVED] Difference between upgrading and reinstalling

solar impulse wrote:

Installing an already-installed package can be seen as updating

Again, only if you've run 'pacman -Sy' first, otherwise pacman won't know if there's a new version.

Apart from this, yes, you are correct.

Offline

#10 2012-03-04 22:43:14

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: [SOLVED] Difference between upgrading and reinstalling

Also, if you -Sy and package-x is NOT the only available package, you may break your system.

pacman -S package-x installs package-x from the database you already have (so even if there's an update it will not be installed until -Sy, as explained above).


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB