LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How do I remove a specific version of a package with yum? (https://www.linuxquestions.org/questions/linux-software-2/how-do-i-remove-a-specific-version-of-a-package-with-yum-4175489114/)

rokyo 12-25-2013 05:10 AM

How do I remove a specific version of a package with yum?
 
Hello and merry Christmas everybody!

I installed Fedora 20 x64 (KDE) yesterday and started running into a problem today:

After installing the distro on my Core2Duo machine, Apper notified me that some 1000+ updates where available, so I let Apper update them. Since Apper seemed to hang at 10% of downloading the updates, I cancelled the process by clicking the stop button in the KDE notification and ran
Code:

sudo yum update
in a terminal instead, because yum usually worked fine for me.

Apparently just in this moment, Apper decided to finally continue and was about to install "libgcc" right when I killed the Apper process on the console with "kill", since clicking the stop button didn't work.

Yum completed the update process anyways and installed all the updates, but complained about libgcc already being installed and advised me to run
Code:

sudo yum-complete-transaction
.

Running that command lead to yum reporting a list of all the packages it just updated with the notion that "this package is already installed and the latest version", until it hit the libgcc package which it marked for update and tried to update, but failed with the following error (some parts are in German, but you get the picture):

Code:

Abhängigkeiten werden aufgelöst
--> Transaktionsprüfung wird ausgeführt
---> Paket libgcc.x86_64 0:4.8.2-1.fc20 markiert, um aktualisiert zu werden
---> Paket libgcc.x86_64 0:4.8.2-7.fc20 markiert, um eine Aktualisierung zu werden
--> Abhängigkeitsauflösung beendet

Abhängigkeiten aufgelöst

============================================================================================================================
 Package                    Arch                      Version                            Paketquelle                Größe
============================================================================================================================
Aktualisieren:
 libgcc                    x86_64                    4.8.2-7.fc20                      updates                      84 k

Transaktionsübersicht
============================================================================================================================
Aktualisieren  1 Paket

Gesamte Downloadgröße: 84 k
Is this ok [y/d/N]: y
Downloading packages:
Not downloading deltainfo for updates, MD is 448 k and rpms are 84 k
libgcc-4.8.2-7.fc20.x86_64.rpm                                                                      |  84 kB  00:00:00   
Running transaction check
Running transaction test


Transaction check error:
  package libgcc-4.8.2-7.fc20.x86_64 is already installed

Fehler-Zusammenfassung
----------------------

So, basically it said that libgcc should be updated, but won't update it because it's already the lastest version. Sounds to me like my killing Apper right when it installed libgcc kinda broke the whole thing. :(

I tried reinstalling libgcc with "yum reinstall libgcc", but it complained about a protected multilib version like this:

Code:

sudo yum reinstall libgcc
Geladene Plugins: langpacks, refresh-packagekit
Abhängigkeiten werden aufgelöst
--> Transaktionsprüfung wird ausgeführt
---> Paket libgcc.x86_64 0:4.8.2-1.fc20 markiert, um reinstalliert zu werden
---> Paket libgcc.x86_64 0:4.8.2-1.fc20 markiert, um aktualisiert zu werden
---> Paket libgcc.x86_64 0:4.8.2-7.fc20 markiert, um eine Aktualisierung zu werden
---> Paket libgcc.x86_64 0:4.8.2-7.fc20 markiert, um gelöscht zu werden
--> Abhängigkeitsauflösung beendet
Fehler:  Multilib version problems found. This often means that the root
        cause is something else and multilib version checking is just
        pointing out that there is a problem. Eg.:
       
          1. You have an upgrade for libgcc which is missing some
            dependency that another package requires. Yum is trying to
            solve this by installing an older version of libgcc of the
            different architecture. If you exclude the bad architecture
            yum will tell you what the root cause is (which package
            requires what). You can try redoing the upgrade with
            --exclude libgcc.otherarch ... this should give you an error
            message showing the root cause of the problem.
       
          2. You have multiple architectures of libgcc installed, but
            yum can only see an upgrade for one of those architectures.
            If you don't want/need both architectures anymore then you
            can remove the one with the missing update and everything
            will work.
       
          3. You have duplicate versions of libgcc installed already.
            You can use "yum check" to get yum show these errors.
       
        ...you can also use --setopt=protected_multilib=false to remove
        this checking, however this is almost never the correct thing to
        do as something else is very likely to go wrong (often causing
        much more problems).
       
        Geschützte Multilib-Versionen: libgcc-4.8.2-1.fc20.x86_64 != libgcc-4.8.2-7.fc20.x86_64

So I'm stuck with a broken libgcc which I can't seem to update or reinstall. Is there any way to fix this with yum without reinstalling Fedora?

Thank you all in advance for any help!

Greets,
rokyo

rokyo 12-25-2013 05:46 AM

I just realised that the yum error message actually says that there are two different versions of libgcc installed (4.8.2-1 and 4.8.2-7), yum --showduplicates confirms this:

Code:

yum --showduplicates list libgcc
Geladene Plugins: langpacks, refresh-packagekit
Installierte Pakete
libgcc.x86_64                                  4.8.2-1.fc20                                    @koji-override-0/$releasever
libgcc.x86_64                                  4.8.2-7.fc20                                    installed                 
Verfügbare Pakete
libgcc.i686                                    4.8.2-1.fc20                                    fedora                     
libgcc.x86_64                                  4.8.2-1.fc20                                    fedora                     
libgcc.i686                                    4.8.2-7.fc20                                    updates                   
libgcc.x86_64                                  4.8.2-7.fc20                                    updates

But, how do I uninstall the older version specifically without uninstalling the newer one? :(

rokyo 12-25-2013 07:09 AM

Ok, I solved the problem. Looks like I can remove the duplicate package with RPM instead of YUM, doing:

Code:

sudo rpm -e libgcc-4.8.2-1.fc20.x86_64
Everything works now! :)

Wulfuric 09-25-2015 09:15 AM

Alternative Solution
 
For anyone else that comes across this problem, I had duplicate installs of db4 so yum list installed showed

Code:

db4.x86_64                          4.7.25-19.el6_6                    @base
db4.x86_64                          4.7.25-20.el6_7                    installed

reading up on how to remove just one package said the syntax was package-version, so naturally I tried yum remove db4.x86_64-4.7.25-19.el6_6 which did not work, what worked was yum remove db4-4.7.25-19.el6_6.x86_64 maybe this will save someone some time.


All times are GMT -5. The time now is 10:57 AM.