You are not logged in.

#1 2014-08-26 02:52:31

authentec
Member
Registered: 2008-06-16
Posts: 18

[SOLVED] Pacman broken by partial upgrade. How to fix and update?

Pacman partially upgraded a system during pacman -Syu and, as a result, pacman itself is broken.
So I'm facing two issues, the one which caused the upgrade to fail and the fact that pacman no longer works.

I answered yes to all of the below:

:: Starting full system upgrade...
:: Replace kactivities with extra/kactivities4? [Y/n] y
:: Replace lzo2 with core/lzo? [Y/n] y
:: Replace phonon-gstreamer with extra/phonon-qt4-gstreamer? [Y/n] y
:: Replace phonon-gstreamer with extra/phonon-qt5-gstreamer? [Y/n] y
:: Replace polkit-qt with extra/polkit-qt4? [Y/n] y
:: Replace shared-color-profiles with extra/colord? [Y/n] y
:: Replace twisted with extra/python2-twisted? [Y/n] y

All seemed well until all the downloads and verifications were finished.

(646/646) checking for file conflicts              [######################] 100%
(1/6) removing lzo2                                [######################] 100%
(2/6) removing shared-color-profiles               [######################] 100%
(3/6) removing polkit-qt                           [######################] 100%
(4/6) removing phonon-gstreamer                    [######################] 100%
(5/6) removing kactivities                         [######################] 100%
(6/6) removing twisted                             [######################] 100%
(  1/646) upgrading linux-api-headers              [######################] 100%
(  2/646) upgrading tzdata                         [######################] 100%
(  3/646) upgrading filesystem                     [######################] 100%
warning: /etc/group installed as /etc/group.pacnew
warning: /etc/passwd installed as /etc/passwd.pacnew
warning: /etc/gshadow installed as /etc/gshadow.pacnew
warning: /etc/shadow installed as /etc/shadow.pacnew
error: extract: not overwriting dir with file /var/run
error: problem occurred while upgrading filesystem
error: could not commit transaction
error: failed to commit transaction (transaction aborted)
Errors occurred, no packages were upgraded.

The upgrade failed because of "extract: not overwriting dir with file /var/run".
The last line is not entirely true because I don't think the removals were rolled back.
Since pacman depends on lzo2 I now get the error below whenever I try to launch it.

pacman: error while loading shared libraries: liblzo2.so.2: cannot open shared object file: No such file or directory

So I need to figure out a way to fix pacman and correct the issue that is causing the update to fail without causing even bigger problems.
I'd appreciate any suggestions!

Thanks.

Last edited by authentec (2014-08-26 07:02:00)

Offline

#2 2014-08-26 03:41:34

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

pacman tried to replace lzo2 with lzo and "package replacement" is not an atomic operation. It removed lzo2 first then started doing other stuff and got broken because of filesystems package. lzo was never installed.

I suggest to make following steps:
- find the old lzo2 package. It should be in you pacman cache.
- unpack required shared libraries (liblzo2.so.2 and liblzo2.so files)
- install lzo package only, so it will avoid the same problem again. You need to force install to replace just copied liblzo2.so files - pacman thinks these files are already removed from filesystem. pacman -S lzo --force
- now you should be good, update the rest of the system.


It works for any "pacman: error while loading shared libraries" problem, not just for lzo2.


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

#3 2014-08-26 04:15:33

authentec
Member
Registered: 2008-06-16
Posts: 18

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

Thanks for putting me on the right track anatolik.
I thought I'd have to manually install lzo2 but wasn't sure where to go from there because it seemed as if I'd have the same problem all over again.
I'll update the thread title after the problem is solved.

Offline

#4 2014-08-26 04:29:16

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,553

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

I'm more concerned with /var/run being a dir instead of a symlink. What version of the filesystem package are you on? That symlink has been in place since June of 2012.

Offline

#5 2014-08-26 07:01:25

authentec
Member
Registered: 2008-06-16
Posts: 18

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

After forcing the installation of lzo2 I was able to upgrade the whole system.
Thanks anatolik.

Scimmia wrote:

I'm more concerned with /var/run being a dir instead of a symlink. What version of the filesystem package are you on? That symlink has been in place since June of 2012.

Scimmia, after I got pacman working again pacman -Qe outputted 'filesystem 2014.07-1'.
That was after manually copying the lzo libraries but before running the upgrade again.

Offline

#6 2014-08-26 07:10:34

headkase
Member
Registered: 2011-12-06
Posts: 1,976

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

Your filesystem package was upgraded, you had 646 packages to upgrade.  You haven't run "pacman -Syu" in years.  Your system will be near impossible to upgrade.  Reinstall, and update regularly.

Am I wrong?

Offline

#7 2014-08-26 09:26:25

authentec
Member
Registered: 2008-06-16
Posts: 18

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

headkase wrote:

Your filesystem package was upgraded, you had 646 packages to upgrade.  You haven't run "pacman -Syu" in years.  Your system will be near impossible to upgrade.  Reinstall, and update regularly.

Am I wrong?

According to pacman.log my last successful upgrade was in April May 2014 (hardly anything upgraded so I missed it in the logs at first).
Strangely enough, pacman -Qe reports the same filesystem version (filesystem 2014.07-1) both before and after the upgrade today.
Unless I'm mistaken that would mean it wasn't upgraded (or it was upgraded and not rolled back when the transaction failed which wouldn't be my first guess).
So it would appear you are wrong on both counts, headkase.

After I forced installation of the replacement lzo the upgrade went ahead without a hitch.
So no, the system wasn't impossible to upgrade either. Wrong there too.
I'm not sure exactly what went wrong though. It might have all been due to lzo2 not being automatically replaced successfully. Yet I'm not sure why it would have attempted to upgrade filesystem when it failed then report the same version after the full system upgrade completed successfully.

Last edited by authentec (2014-08-26 16:16:46)

Offline

#8 2014-08-26 11:27:13

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

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

It's hard to speculate on the cause of an isolated incident.  Updating every few months should be just fine - but if practical, you'll likely find it much easier if you can update much more frequently.

Personally I update daily.  No update takes more than a few seconds, and if there is an issue, it is much easier to pin it down.  My daily updates are probably at the other extreme of your current quarter-annually ... but somewhere in between should keep things going smooth in the future.  I'd recommend at least every week or two for full updates.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2014-08-26 16:21:26

authentec
Member
Registered: 2008-06-16
Posts: 18

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

OK, thanks for the advice.
I transitioned to daily use of Open Source OSs with FreeBSD and then Ubuntu before switching to Arch.
So my past experience probably influences the rate at which I upgrade even though I've been using Arch since at least 2008.

Offline

#10 2014-08-27 17:15:57

anatolik
Developer
Registered: 2012-09-27
Posts: 458

Re: [SOLVED] Pacman broken by partial upgrade. How to fix and update?

FYI: Added this question to the FAQ https://wiki.archlinux.org/index.php/Pa … ct_file.22


Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster

Offline

Board footer

Powered by FluxBB