Could not calculate the upgrade, what happened?

63,704

Solution 1

What worked for me was removing any broken packages, as they were preventing the upgrade.

First find out which packages are broken:

grep Broken /var/log/dist-upgrade/apt.log

Then remove them:

sudo apt-get remove <packages to remove>

Some might be reinstalled during the upgrade, others you may have to reinstall yourself.

Solution 2

After your system fails to upgrade, check the file /var/log/dist-upgrade/main.log

I found the line:

2013-10-17 15:00:30,543 ERROR Dist-upgrade failed: 'The package 'xubuntu-desktop' is marked for removal but it is in the removal blacklist.'

I manually removed xubuntu-desktop. The upgrade then continued without issue.

Solution 3

Similar issue here. Last few lines in the "main.log" file indicated in the previous post were:

2013-10-17 23:44:38,233 DEBUG blacklist expr 'unity$' matches 'unity'
2013-10-17 23:44:38,233 DEBUG The package 'unity' is marked for removal but it's in the removal blacklist
2013-10-17 23:44:43,585 ERROR Dist-upgrade failed: 'The package 'unity' is marked for removal but it is in the removal blacklist.'
2013-10-17 23:44:43,586 DEBUG abort called
2013-10-17 23:44:43,592 DEBUG openCache()
2013-10-17 23:44:43,592 DEBUG failed to SystemUnLock() (E:Not locked) 
2013-10-17 23:44:46,786 DEBUG /openCache(), new cache size 41453
2013-10-17 23:44:46,786 DEBUG enabling apt cron job

Manually de-installed unity and upgrade now proceeds. Not quite sure what causes this issue in the first place and whether this is truly a good "solution" but I guess I'll find out after the update is completed?!?

Solution 4

In my case, the problem was caused by a package that was in hold state. Putting it back to install state resolved the problem.


A possible way to put or remove a package in hold state is using dpkg. First, you get the current state of all packages, and put it into a file:

dpkg --get-selections > myselection

Then, you edit the file and replace install by hold, or vice-versa. Finally, you set the new selection:

sudo dpkg --set-selections < myselection
sudo apt-get update
sudo apt-get upgrade

Other ways are described in How to hold a package back from being upgraded?

Solution 5

If you are using the proprietary AMD/ATI fglrx video drivers, removing the fglrx packages and the xorg video driver will likely fix it:

sudo apt-get remove fglrx fglrx-amdcccle-updates
sudo apt-get remove xserver-xorg-video-ati:amd64

In my case, I had the fglrx drivers installed from the xorg-edgers PPA, and removing those packages cleared up my upgrade. Once the upgrade is complete, you can go through the process of setting up the proprietary drivers again.

Share:
63,704

Related videos on Youtube

topless
Author by

topless

Updated on September 18, 2022

Comments

  • topless
    topless almost 2 years

    I am running sudo update-manager -d and start the upgrade process. I select upgrade option and when then manager enters Setting new software channels it throws an error.

    Could not calculate the upgrade
    
    An unresolvable problem occurred while calculating the upgrade.
    
     This can be caused by:
     * Upgrading to a pre-release version of Ubuntu
     * Running the current pre-release version of Ubuntu
     * Unofficial software packages not provided by Ubuntu
    
    If none of this applies, then please report this bug using the command 'ubuntu-bug ubuntu-release-upgrader-core' in a terminal.
    

    I have disabled all unofficial and third party packages, I am not running a pre-release version since I am at 13.04 and I am trying to update to beta 2 which is not a pre-release. Before I fill a bug report, since its happening to both of my systems I would like to figure out if anyone else had same issues.

    EDIT: added output for comment.

    $ sudo dpkg -l | grep -w "rc"`
    rc google-chrome-beta 31.0.1650.16-1 amd64 The web browser from Google
    ii sysv-rc 2.88dsf-13.10ubuntu15 all System-V-like runlevel change mechanism
    

    $ cat /etc/apt/sources.list
    
    deb http://dk.archive.ubuntu.com/ubuntu/ raring main restricted
    deb-src http://dk.archive.ubuntu.com/ubuntu/ raring main restricted
    
    deb http://dk.archive.ubuntu.com/ubuntu/ raring-updates main restricted
    deb-src http://dk.archive.ubuntu.com/ubuntu/ raring-updates main restricted
    
    deb http://dk.archive.ubuntu.com/ubuntu/ raring universe
    deb-src http://dk.archive.ubuntu.com/ubuntu/ raring universe
    deb http://dk.archive.ubuntu.com/ubuntu/ raring-updates universe
    deb-src http://dk.archive.ubuntu.com/ubuntu/ raring-updates universe
    
    deb http://dk.archive.ubuntu.com/ubuntu/ raring multiverse
    deb-src http://dk.archive.ubuntu.com/ubuntu/ raring multiverse
    deb http://dk.archive.ubuntu.com/ubuntu/ raring-updates multiverse
    deb-src http://dk.archive.ubuntu.com/ubuntu/ raring-updates multiverse
    
    deb http://security.ubuntu.com/ubuntu raring-security main restricted
    deb-src http://security.ubuntu.com/ubuntu raring-security main restricted
    deb http://security.ubuntu.com/ubuntu raring-security universe
    deb-src http://security.ubuntu.com/ubuntu raring-security universe
    deb http://security.ubuntu.com/ubuntu raring-security multiverse
    deb-src http://security.ubuntu.com/ubuntu raring-security multiverse
    
    deb http://extras.ubuntu.com/ubuntu raring main
    deb-src http://extras.ubuntu.com/ubuntu raring main
    deb http://dk.archive.ubuntu.com/ubuntu/ raring-proposed multiverse universe restricted main
    

    $ lsb_release -c
    Codename:   raring
    

    $ sudo apt-get -y install aptitude && \
          sudo rename 's/\.list$/.list.disable/' /etc/apt/sources.list.d/*.list && \
          sudo aptitude update && \
          aptitude search '?narrow(?installed, !?archive(raring))'`
    
    i   dropbox                       - cloud synchronization engine - CLI and Nautilus extension                      
    i   google-chrome-stable          - The web browser from Google                                                    
    i   google-talkplugin             - Google Talk Plugin                                                             
    i   libdrm-intel1                 - Userspace interface to intel-specific kernel DRM services -- runtime           
    i   libdrm-nouveau2               - Userspace interface to nouveau-specific kernel DRM services -- runtime         
    i   libdrm-radeon1                - Userspace interface to radeon-specific kernel DRM services -- runtime          
    i   libdrm2                       - Userspace interface to kernel DRM services -- runtime                          
    i   libegl1-mesa                  - free implementation of the EGL API -- runtime                                  
    i   libegl1-mesa-drivers          - free implementation of the EGL API -- hardware drivers                         
    i   libgbm1                       - generic buffer management API -- runtime                                       
    i   libgl1-mesa-dri               - free implementation of the OpenGL API -- DRI modules                           
    i   libgl1-mesa-glx               - free implementation of the OpenGL API -- GLX runtime                           
    i   libglapi-mesa                 - free implementation of the GL API -- shared library                            
    i A libgles2-mesa                 - free implementation of the OpenGL|ES 2.x API -- runtime                        
    i   libllvm3.3                    - Low-Level Virtual Machine (LLVM), runtime library                              
    i   libopenvg1-mesa               - free implementation of the OpenVG API -- runtime                               
    i   libxatracker1                 - X acceleration library -- runtime                                              
    i   nodejs                        - Node.js event-based server-side javascript engine                              
    id  nvidia-persistenced           - Load the NVIDIA kernel driver and create device files                          
    id  nvidia-settings-331           - Tool for configuring the NVIDIA graphics driver                                
    i   simplescreenrecorder          - A feature-rich screen recorder that supports X11 and OpenGL.                   
    i A simplescreenrecorder-lib      - A feature-rich screen recorder that supports X11 and OpenGL.                   
    i   sublime-text                  - Sublime Text is a sophisticated text editor for code, markup and prose         
    i   vokoscreen                    - easy to use screencast creator                                                 
    i   xserver-common                - common files used by various X servers                                         
    i   xserver-xorg-core             - Xorg X server - core server                                                    
    i   xserver-xorg-input-synaptics  - Synaptics TouchPad driver for X.Org server                                     
    i   xserver-xorg-video-ati        - X.Org X server -- AMD/ATI display driver wrapper                               
    i   xserver-xorg-video-cirrus     - X.Org X server -- Cirrus display driver                                        
    i   xserver-xorg-video-intel      - X.Org X server -- Intel i8xx, i9xx display driver                              
    i   xserver-xorg-video-mach64     - X.Org X server -- ATI Mach64 display driver                                    
    i   xserver-xorg-video-nouveau    - X.Org X server -- Nouveau display driver                                       
    i   xserver-xorg-video-r128       - X.Org X server -- ATI r128 display driver                                      
    i   xserver-xorg-video-radeon     - X.Org X server -- AMD/ATI Radeon display driver                                
    i   xserver-xorg-video-vmware     - X.Org X server -- VMware display driver        
    
    • Admin
      Admin over 10 years
      It looks like its being caused by propriety video drivers.
    • Admin
      Admin over 10 years
      Run this command and post the output in your answer after editing: sudo dpkg -l | grep -w "rc"
    • Admin
      Admin over 10 years
      @Braiam I have added the output you asked for, apt-get check is Building dependency tree and Reading state information... Done, and dpkg doesn't give an output.
    • Admin
      Admin over 10 years
      Could you do the following: sudo apt-get -y install aptitude && sudo rename 's/\.list$/.list.disable/' /etc/apt/sources.list.d/*.list && sudo aptitude update && aptitude search '?narrow(?installed, !?archive(raring))' and paste the results? The first command will install aptitude, second will disable all PPA's, third will update your list and fourth will list all the package that don't comes from the repository.
  • topless
    topless over 10 years
    It looks that I have a big list of xserver-xorg-video-* pacakges that are broken. I am not really sure but I feel like if I start removing them my system will break. Did you manage to remove them successfully? What kind of packages were causing you trouble?
  • DaShaun
    DaShaun over 10 years
    I had to remove the same. The "good" versions came back when the upgrade completed. My upgrade was a success.
  • guntbert
    guntbert over 10 years
    sudo apt-get remove doesn't do anything.
  • seyDoggy
    seyDoggy over 10 years
    Ahh, but it does list the packages that could be removed with auto remove. :) there is madness to my method.
  • topless
    topless over 10 years
    why don't you tell us how you did it? This is not a complete answer, try describing your steps. How did you find the package and the actions you took.
  • Abdulsattar Mohammed
    Abdulsattar Mohammed over 10 years
    Is there any way I keep this package and still update? I have postgresql-9.2 and I dont want to remove it.
  • ImaginaryRobots
    ImaginaryRobots over 10 years
    you could just re-install it after the upgrade is complete.
  • Braiam
    Braiam over 10 years
    Please, don't just throw this kind of answers. That procedure is potentially dangerous done without care.
  • mmstick
    mmstick over 10 years
    Actually no it's not. It's not dangerous at all. The fact that you think it is dangerous means you don't know much about it. I've run it many times in the past and with many people. If you actually read the entire command you can see I have accounted for all possible issues. All the user needs to do is just watch the output of the command. Ubuntu 13.10 has a lot of issues with upgrading, but this fixes everything neatly and conveniently in one long command. I advise you to look into documentation of how 'do-release-upgrade' works, because it is precisely what this command does.
  • topless
    topless over 10 years
    @mmstick You can elaborate a bit more on your long command and the issues it resolves, as long as the actual problem and how it tackles it. I see that you are calling multiple times apt-get upgrade and the rest of commands, so maybe again you can split it in line by line, and explain your process and why its working. I don't have the luxury to experiment with high risk, irreversible commands. Thanks for the effort though. We are all here to learn..
  • topless
    topless over 10 years
    @mmstick, I am looking for your answer, you mentioned a while back and it looks its after my question, so you could have looked a bit better before replying in rude fashion to me and Braiam.
  • mmstick
    mmstick over 10 years
    @topless: No, I have just answered many questions like yours, dating as far back as a week BEFORE 13.10 came out, which your question is not that early.
  • mmstick
    mmstick over 10 years
    @topless. It does what it does, changes sources.list to saucy, moves PPAs out because they interfere with upgrades, normal upgrade, distribution upgrade, aptitude upgrade/dist-upgrade/install -f to fix any additional dependencies and resolve errors, puts PPAs back and converts them to saucy, attempts to upgrade with these PPAs, and installs ubuntu-desktop to pull in any new additions to Ubuntu. Simple and easy to understand. You shouldn't downvote an answer you don't properly understand.
  • topless
    topless over 10 years
    @mmstick don't be lazy edit your answer, to be complete for future reference. Its good that you contributed early but the problem I faced it for first time with 13.10 upgrade.
  • Braiam
    Braiam over 10 years
    @topless if the first command fail, it means that nothing was done. If apt-get update doesn't work, it means another thing.
  • topless
    topless over 10 years
    on apt-get update I get this kind of errors N: Ignoring file 'xorg-edgers-ppa-raring.list.disable' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension
  • Braiam
    Braiam over 10 years
    That's an info/warning, can be ignored, and is expected since we don't want PPA's in the way.
  • modulitos
    modulitos about 10 years
    I am having the same issues with the xserver-xorg-video-* packages. How did you remove them? sudo apt-get remove xserver-xorg-video-*? I have a question here with more details.
  • modulitos
    modulitos about 10 years
    So, is this a valid solution? I have numerous broken packages, mostly from libboost-* and xserver-xorg-video-* and I am not sure whether it is sufficient to simply remove these packages and then upgrade. Should I run this script? What does it do? I have my question here.
  • DaShaun
    DaShaun about 10 years
    That is exactly what I did 'sudo apt-get remove xserver-xorg-video-*'
  • mmstick
    mmstick about 10 years
    It's a perfectly valid solution. It has a 100% success rate, which I can't say the same for the default upgrade script. You may want to make some modifications for your new case, which I shall post.
  • Nick Grealy
    Nick Grealy about 10 years
    This was what worked for me!
  • Nick Grealy
    Nick Grealy about 10 years
    +1 - I had to run sudo apt-get autoremove
  • Zoltán
    Zoltán about 10 years
    For me this was shoing about 25 broken packages, many of which looked like system packages. Jake's answer, on the other hand, showed a single misbehaving package. After uninstalling it, I could upgrade without problems.
  • Nate Totten
    Nate Totten over 9 years
    How do you find out which packages are in hold state?
  • Nate Totten
    Nate Totten over 9 years
    Note that you may not have to remove all of the broken packages to upgrade. Most of my broken packages were variations of gnuplot. So I used aptitude search gnuplot to see which I had installed (it was gnuplot-x11) and I purged it. Running update-manager after that listed an updated gnuplot package which I then installed. Running update-manager again, I got a complaint about texmaker. Again, used aptitude to search which texmaker package I had installed and then removed it. Ran update-manager again and this time I could start the upgrade process without errors.
  • Michael Hoffmann
    Michael Hoffmann over 8 years
    fglrx-core was still left on my system after doing this. Others may also need to remove it.
  • northern-bradley
    northern-bradley over 8 years
    After i had removed the only ERROR present i got a 2nd different ERROR when running do-release-upgrade again so had to manually remove this one as well. You might have to do this a number of times if you are unlucky enough. It is also possible that one of the other methods might have also highlighted these like hold or broken but I did not try them.
  • jocull
    jocull about 8 years
    Postgres seemed to be the thing that was holding me back. Thanks for pointing that out @AbdulsattarMohammed !
  • pasha.zhukov
    pasha.zhukov almost 8 years
    grep Broken grep Broken /var/log/dist-upgrade/apt.log gives me 700+ rows. Definitely can't remove them all.
  • Efren
    Efren over 7 years
    It can also help looking at the end of the log, sometimes a broken package keeps trying to install based on a non broken package. It happened with postgresql trying to install postgresql-9.x-postgis, and the scripts. This had some weird gdal dependency inconsistency whith libgdal and libspatialite, which keep uninstalling and installing the deps needed.
  • michael meyer
    michael meyer over 7 years
    For me it was boost and ROS packages that were causing the issues. Removed them and now my system is upgrading like normal.
  • nyxee
    nyxee almost 7 years
    I will include "an eficient way" of removing packages "one-by-one" in my answer below. Its just a collection of all the tips i have got from all over the place.
  • David Baucum
    David Baucum over 5 years
    It's definitely NOT necessary to remove everything that shows as broken with this method. I only had to remove libopenblas and wine1.8 to get the upgrade to move forward. Even when the upgrade starts working you will see "Broken" entries in the apt.log.
  • cheekybanana
    cheekybanana over 4 years
    Thank you! Autoremove solved my issue. Turns out I had hundreds of broken/unusable remnants from past failed installations.
  • Pablo Bianchi
    Pablo Bianchi over 3 years
    @Dennis with apt-mark showhold
  • Malachi Bazar
    Malachi Bazar over 3 years
    I only had to remove python2.7-minimal.
  • MRule
    MRule over 2 years
    This is the wrong answer; Simply grepping for "Broken" finds hundreds of critical system packages which cannot be removed. Jake's answer is the correct one.
  • rosch
    rosch over 2 years
    I removed packages gnome-shell and ubuntu-desktop from the Broken list. This was enough to get the do-release-upgrade -d going.