Announcement

Collapse
No announcement yet.

How to get rid of a broken package [libreoffice-base]

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

    How to get rid of a broken package [libreoffice-base]

    When the new Libreoffice 1:4.3 came out, it was not in the repositories yet, so I decided to install it from ppa http://ppa.launchpad.net/libreoffice/libreoffice-4-3/ubuntu/.
    I saw that it is now available in the normal repository, so I uninstalled the ppa version and want to install it from the normal repo.

    While uninstalling, an error came up and I was left with a broken package, libreoffice-base, and I don't seem to be able to get rid of it
    I tried sudo apt-get -fm remove libreoffice-base (first without the fm options) and sudo dpkg --remove libreoffice-base
    and this is the result, I am still left with a broken package

    Code:
    Removing libreoffice-base (1:4.3.0-0ubuntu1~trusty1) ...
    No diversion 'diversion of /usr/lib/libreoffice/share/basic/dialog.xlc to /usr/lib/libreoffice/share/basic/dialog.xlc.noaccess by libreoffice-base', none removed.
    No diversion 'diversion of /usr/lib/libreoffice/share/basic/script.xlc to /usr/lib/libreoffice/share/basic/script.xlc.noaccess by libreoffice-base', none removed.
    /var/lib/dpkg/info/libreoffice-base.postrm: 28: /var/lib/dpkg/info/libreoffice-base.postrm: Syntax error: end of file unexpected (expecting "fi")
    dpkg: error processing package libreoffice-base (--remove):
     subprocess installed post-removal script returned error exit status 2
    Errors were encountered while processing:
     libreoffice-base
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    When I look into /var/lib/dpkg/info/libreoffice-base.postrm: Syntax error: end of file unexpected (expecting "fi")
    there does not seem to be a missing fi or should I be looking in some other script ?

    Code:
    #!/bin/sh
    
    set -e
    
    
    if [ "$1" = remove -o "$1" = abort-install -o "$1" = disappear ]; then
        dpkg-divert --package $DPKG_MAINTSCRIPT_PACKAGE --remove --rename \
            --divert /usr/lib/libreoffice/share/basic/dialog.xlc.noaccess \
                            /usr/lib/libreoffice/share/basic/dialog.xlc
        dpkg-divert --package $DPKG_MAINTSCRIPT_PACKAGE --remove --rename \
            --divert /usr/lib/libreoffice/share/basic/script.xlc.noaccess \
                            /usr/lib/libreoffice/share/basic/script.xlc
    fi
    if [ "$1" = abort-upgrade ] && dpkg --compare-versions "$2" lt dpkg --compare-versions "$2" lt 1:4.3.0~beta1-1; then
        dpkg-divert --package $DPKG_MAINTSCRIPT_PACKAGE --remove --rename \
            --divert /usr/lib/libreoffice/share/basic/dialog.xlc.noaccess \
                            /usr/lib/libreoffice/share/basic/dialog.xlc
        dpkg-divert --package $DPKG_MAINTSCRIPT_PACKAGE --remove --rename \
            --divert /usr/lib/libreoffice/share/basic/script.xlc.noaccess \
    fi
    
    # Automatically added by dh_installmenu
    if [ -x "`which update-menus 2>/dev/null`" ]; then update-menus ; fi
    # End automatically added section
    
    
    exit 0
    So how can I get rid of this and install LO from the normal repo again ?

    I suppose removing via root all LO related directories will not help because apt will still have something left over and will not know what to do with it.
    In another thread, I saw someone sugesting reinstalling Kubuntu altogether to solve a similar LO broken package problem, but that seems overkill to me.
    Besides this may be a good opportunity to learn more about solving deb packaging errors, so if possible I'd prefer to understand what is the problem
    and how to solve it instead of just avoiding it by reinstalling the complete OS.
    Last edited by SteveRiley; Aug 16, 2014, 10:30 PM.
    Je suis Charlie, how many more people have to die for religions
    linux user #447706 on https://linuxcounter.net
    A good place to start:
    Topic: Top 20 Kubuntu FAQs & Answers


    #2
    Deleting /var/lib/dpkg/info/libreoffice-base.postrm solved the problem.
    Once this file was gone, I could uninstall libreoffice-base.

    Still I would like to understand why, so if anyone has suggestions about the why, they are very welcome

    Oh, another thing, libreoffice 1:4.3 is not available in the normal repo
    Je suis Charlie, how many more people have to die for religions
    linux user #447706 on https://linuxcounter.net
    A good place to start:
    Topic: Top 20 Kubuntu FAQs & Answers

    Comment


      #3
      I think I found the source of my problem.
      When installing another package, I came across a similar problem, and from the apt-get error msg I could see that my / partition is full.
      So I'll have to increase the size of /
      Je suis Charlie, how many more people have to die for religions
      linux user #447706 on https://linuxcounter.net
      A good place to start:
      Topic: Top 20 Kubuntu FAQs & Answers

      Comment


        #4
        You may get by if you ensure that your downloaded packages are removed.
        Code:
        sudo apt-get --purge autoremove && sudo apt-get clean
        Windows no longer obstructs my view.
        Using Kubuntu Linux since March 23, 2007.
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          When did you install the packages from the PPA?

          I ask because there actually is an error in the postrm script you posted -- a line is missing. However, I just checked the PPA now and the postrm script for libreoffice-base is correct. The file is dated yesterday (August 15). Perhaps the version you installed contained this bug and it got fixed yesterday?
          Last edited by SteveRiley; Aug 17, 2014, 11:06 PM.

          Comment


            #6
            I installed it the moment I saw the announcement that the new LO release was available, I think last week or so, not sure when exactly.
            There were some interesting new features, and as it was not available in the Kubuntu repo, I decided to install it from the ppa.

            Yesterday I mistakenly thought the new release arrived in the normal repo, so I wanted to uninstall the ppa version and install from the normal repo
            and came across this problem.
            In the mean time I see there is a newer LO release in the ppa, I see they threw out the middle part with the dpkg diverts in the postrm script.

            I also found out why my / partition suddenly got full.
            I started playing with KVM and virtual machine manager, and it turns out it saves the kvm images in var/lib/libvirt instead of in my home directory.

            Also thx to Snowhog, I already did the autoremove part, but still had some apt-get hickups after that, I suppose the clean part now also got rid of that.

            The thing I like about linux is that you can have a look under the hood an tinker with it a bit.
            Occasionally you get in trouble, but while trying to solve things, each time you get a better insight on how things works.
            Je suis Charlie, how many more people have to die for religions
            linux user #447706 on https://linuxcounter.net
            A good place to start:
            Topic: Top 20 Kubuntu FAQs & Answers

            Comment


              #7
              synaptic repari broken...there is a button

              Comment


                #8
                I don't think Synaptic could have fixed this particular problem. Bugs in debconf scripts require either removing the offending script (like the OP did) or hauling out the big gun: dpkg --force-things.

                Comment

                Working...
                X