Announcement

Collapse
No announcement yet.

firefox install failed - dpkg-divert: mismatch on package

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    firefox install failed - dpkg-divert: mismatch on package

    Can anyone help me install firefox? Below I've cited what I've done and the resulting errors.
    I'm stuck b/c I can't use KDE's Software Manager (Add and Remove Software) nor can I use apt-get. Both result in errors.

    A few days ago I did an update/upgrade and since then I wasn't able to use firefox.
    So I did the following:
    1. sudo apt-get purge firefox
    2. turnoff/reboot
    3. sudo apt-get install firefox

    This didn't work. Firefox still didn't working. Then I removed firefox again. (sudo apt-get purge firefox)
    But this time I did something extra. I decided to scan for any remaining firefox files and delete them. So I logged in as sudo and used the following commands to manually delete any remaining firefox files.
    sudo su
    cd /
    find . -name "firefox*" -delete
    then I scanned again using (command: find . -name "firefox*") and found empty DIRs, which I also deleted manually.

    Now I no traces of firefox on my system; turnoff/reboot.


    Now I tried again to use KDE's software package manager and apt-get. Below describes what I did...


    Then I went to package manager (Add and Remove Software) and selected Settings|Edit Software Source|TAB:Other Software|

    Then I disabled: http://ppa.launchpad.net/ubuntu-mozi...ity/ppa/ubuntu lucid main
    Added: http://ppa.launchpad.net/mozillateam...-stable/ubuntu lucid main

    Applied changes.
    Rebooted.

    Then I went to package manager (Add and Remove Software) and selected Software Management and entered firefox
    Selected Package firefox - 12.0+build1-0ubuntu0.10.04.1 (amd64)

    Package Failed.


    Then I disabled source: http://ppa.launchpad.net/mozillateam...-stable/ubuntu lucid main
    Added: http://downloads.sourceforge.net/pro...la/mozilla/apt all main

    applied changes and exited software manager.

    Then entered terminal mode:
    sudo su
    apt-get update -> this failed b/c NO PUBKEY

    then tried:
    apt-key adv --recv-keys --keyserver keyserver.ubuntu.com C1289A29

    then tried:
    apt-get install firefox-mozilla-build

    Which resulted in the following errors...

    output:
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
    firefox-mozilla-build
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 20.6MB of archives.
    After this operation, 0B of additional disk space will be used.
    Get:1 http://downloads.sourceforge.net/pro...a/mozilla/apt/ all/main firefox-mozilla-build 12.0-0ubuntu1 [20.6MB]
    Fetched 20.6MB in 1min 49s (188kB/s)
    Selecting previously deselected package firefox-mozilla-build.
    (Reading database ... 189283 files and directories currently installed.)
    Unpacking firefox-mozilla-build (from .../firefox-mozilla-build_12.0-0ubuntu1_amd64.deb) ...
    dpkg-divert: `diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by firefox-mozilla-build' clashes with `local diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu'
    dpkg: error processing /var/cache/apt/archives/firefox-mozilla-build_12.0-0ubuntu1_amd64.deb (--unpack):
    subprocess new pre-installation script returned error exit status 2
    dpkg-divert: mismatch on package
    when removing `diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu by firefox-mozilla-build'
    found `local diversion of /usr/bin/firefox to /usr/bin/firefox.ubuntu'
    dpkg: error while cleaning up:
    subprocess new post-removal script returned error exit status 2
    Errors were encountered while processing:
    /var/cache/apt/archives/firefox-mozilla-build_12.0-0ubuntu1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    #2
    Does either of /usr/bin/firefox or /usr/bin/firefox.ubuntu exist? If so find out which package owns them using apt-file (may need to be installed).

    Comment


      #3
      Originally posted by james147 View Post
      Does either of /usr/bin/firefox or /usr/bin/firefox.ubuntu exist? If so find out which package owns them using apt-file (may need to be installed).
      NO.

      I have good news. I solved the problem. As always, I'm using trial and error and stumbled upon a solution.

      I returned to KDE's Software Manager (Add and Remove Software) with the intent to use another repository source for firefox. As mentioned previously in this thread, I was going to:
      remove: http://downloads.sourceforge.net/pro...la/mozilla/apt all main
      add: http://ppa.launchpad.net/mozillateam...-stable/ubuntu

      with the hope of finding the public key. So I noticed that an "X" appeared next to the package that I tried to install using apt-get (firefox-mozilla-build), which implies that it was installed. So I clicked to mark it for removal and pressed the "APPLY" button, but it failed. Then I tried to use apt-get...
      I used the command sudo apt-get purge firefox-mozilla-build but it also failed but this gave the following error message:

      dpkg: error processing firefox-mozilla-build (--remove):
      Package is in a very bad inconsistent state - you should
      reinstall it before attempting a removal.
      Errors were encountered while processing:
      firefox-mozilla-build
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      So I did what it said to do. I reinstalled it using command: apt-get install --reinstall firefox-mozilla-build

      And it successfully installed!

      So I reached into KDE start|Applications|Internet and there it was - a Firefox Icon named Browser (Mozilla Build of Firefox).
      I clicked this icon but then another message appeared: KDEinit could not launch firefox. Could not find firefox executable.

      So I went back to terminal mode in USER mode (not sudo), and looked for firefox files using command: find / -name "firefox*"
      I found /usr/bin/firefox.ubuntu and used it as a command and it worked! firefox appeared.

      Now the next step was to create a symbolic link so that the icon's command firefox %u would work.
      So I entered the following commands in terminal mode:
      sudo su
      cd /usr/bin
      link /usr/bin/firefox.ubuntu firefox

      These commands created the symbolic link that firefox needed and now my desktop icon for firefox works as expected - firefox version 12.0 opens and works as expected.

      All I have left to do is apply the "Sync" feature and my copy of firefox is fully restored to its former self.
      The Sync feature works great. In this case, it functioned as a backup for my firefox settings, bookmarks, etc.

      Comment


        #4
        In summary, I was able to get a copy of firefox installed but learned the following...

        1. There are too many ways to install firefox. First, there's KDE's Software manager. Second, there's apt-get and third there's the manual download and untar method. If these were the only methods then that would be OK. But it doesn't end there. You then have to factor in the added complexity of which repository you want to use and worse yet, you need to know which repository your system is currently using. So if you follow the advice from firefox's website then you would be using a different repository then that of your system installation CD which uses ubuntu's repository. So you would inadverently have two installations of firefox. And in fact, your could have multiple versions installed without knowing it.

        2. This thread raises the question as to why it is so difficult to completely remove firefox from a ubuntu based PC. Simply purging a package apparently leaves many files stranded about your system. And when you finally manually remove them all, you discover after the fact that when you try to reinstall the package (using apt-get's install method) half of those files you deleted are needed. This begs the question why is firefox's package dependent on symbolic links existing before someone can install their software? This sounds like a bug to me.

        3. As I dug into the system I also noticed how many tentacles firefox has. I found files lurking everywhere. There are files in /usr/bin; /usr/lib; /usr/lib32; /usr/lib64; /opt; /usr/share; and that's not including the files found each user's /home DIR. Why so many locations?

        4. Lastly, it appea

        Comment


          #5
          In summary, I was able to get a copy of firefox installed but learned the following...

          1. There are too many ways to install firefox. First, there's KDE's Software manager. Second, there's apt-get and third there's the manual download and untar method. If these were the only methods then that would be OK. But it doesn't end there. You then have to factor in the added complexity of which repository you want to use and worse yet, you need to know which repository your system is currently using. BTW, I found 3 repositories ( mozilla-security, mozillateam, mozilla-ubuntu). So if you follow the advice from firefox's website then you would be using a different repository (mozillteam) then that of your system installation CD (mozilla-ubuntu) which uses ubuntu's repository. So you would inadverently have two installations of firefox. And in fact, your could have multiple versions installed without knowing it. And this doesn't even begin to answer the question which repository should I choose? Which leads to which version should I use? (How's someone to know from the list of hundreds of choices in KDE's software manager?)

          2. This thread raises the question as to why it is so difficult to completely remove firefox from a ubuntu based PC. Simply purging a package apparently leaves many files stranded about your system. And when you finally manually remove them all, you discover after the fact that when you try to reinstall the package (using apt-get's install method) half of those files you deleted are needed. This begs the question why is firefox's package dependent on symbolic links existing before someone can install their software? This sounds like a bug to me.

          3. As I dug into the system I also noticed how many tentacles firefox has. I found files lurking everywhere. There are files in /usr/bin; /usr/lib; /usr/lib32; /usr/lib64; /opt; /usr/share; and that's not including the files found each user's /home DIR. Why so many locations?

          4. Lastly, it appears that firefox's behaviour is dependent on the which installation method was used. Over the years I've upgraded firefox several times and apparently used several methods. The consequence for my ignorance and inexperience is that my PC no longer can upgrade firefox without a fight. This time it took several days and hours of work. In the end, I still needed to manually update symbolic links and change the properties of its icon. So I have to ask, why don't firefox's various installation methods play nice?
          Last edited by nhtrader; May 02, 2012, 03:26 PM.

          Comment


            #6
            Originally posted by nhtrader View Post
            1. There are too many ways to install firefox.
            The are only about three main ways to install software, compile it from source (not recommended), run installer scripts found with the program (not recommended) and installing using the package manager (recommended).

            First, there's KDE's Software manager. Second, there's apt-get
            These are two different front ends to the same system (the package manager). So it should make no different which you use to install something (in the end they both use dpkg as the package manager)

            third there's the manual download and untar method.
            It is not recommended to use this method, generally its better to use a ppa or build a package your self then having unmanaged files littering your system. But this method exists as develops cannot package their software for every single distro out there so its normally left to the distro owners to do this. Some more popular software do create packages for the common distros though.

            You then have to factor in the added complexity of which repository you want to use and worse yet, you need to know which repository your system is currently using. So if you follow the advice from firefox's website then you would be using a different repository then that of your system installation CD which uses ubuntu's repository. So you would inadverently have two installations of firefox. And in fact, your could have multiple versions installed without knowing it.
            The repository system is more elegant that that, if you have two repos installed that provide the same package then apt-get should get the most up to date version and ignore the rest. These methods exists to allow others to package software (or newer versions) that don't ship with ubuntu.

            2. This thread raises the question as to why it is so difficult to completely remove firefox from a ubuntu based PC.
            Your problem was the packages ended up in an inconsistent state for some reason which caused all the problems. It normally isn't that hard to remove.

            Simply purging a package apparently leaves many files stranded about your system. And when you finally manually remove them all, you discover after the fact that when you try to reinstall the package (using apt-get's install method) half of those files you deleted are needed. This begs the question why is firefox's package dependent on symbolic links existing before someone can install their software? This sounds like a bug to me.
            Or those files are owned by another package that is linked to firefox, which is why you shouldn't manually delete files in the system unless you know what you are doing.

            3. As I dug into the system I also noticed how many tentacles firefox has. I found files lurking everywhere. There are files in /usr/bin; /usr/lib; /usr/lib32; /usr/lib64; /opt; /usr/share;
            Those are typical locations for an application be found: /usr/bin is the location of the actual executable, /usr/lib* are where the libraries firefox needs are stored, not sure why it would be in /opt unless you are using a ppa or non standard build and /usr/share is where application data is kept.

            and that's not including the files found each user's /home DIR. Why so many locations?
            The files in your home directory are the settings and configs that firefox needs to remember what you where doing/how you set it up. These files are not touched by the package manager ever.

            4. Lastly, it appears that firefox's behaviour is dependent on the which installation method was used. Over the years I've upgraded firefox several times and apparently used several methods. The consequence for my ignorance and inexperience is that my PC no longer can upgrade firefox without a fight. This time it took several days and hours of work. In the end, I still needed to manually update symbolic links and change the properties of its icon. So I have to ask, why don't firefox's various installation methods play nice?
            If you only use the package manager then they should play nicely, but manually installing packages causes files that that package manager doesn't know about to exist... which can cause problems.

            Comment

            Working...
            X