How to fix held broken packages?












14















Trying to install libssl-dev on ubuntu 14.04.2



$ make
fatal error: openssl/sha.h: No such file or directory
compilation terminated.

$ sudo apt-get install libssl-dev
The following packages have unmet dependencies:
libssl-dev : Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

$ sudo apt-get install zlib1g-dev
The following packages have unmet dependencies:
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.8.dfsg-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.


How can I remove the held package and install the correct?










share|improve this question

























  • When's the last time you ran sudo apt update and/or sudo apt upgrade?

    – DopeGhoti
    Aug 29 '17 at 20:24











  • Hi, I have done both between each steps.

    – Sam Healey
    Aug 29 '17 at 20:31
















14















Trying to install libssl-dev on ubuntu 14.04.2



$ make
fatal error: openssl/sha.h: No such file or directory
compilation terminated.

$ sudo apt-get install libssl-dev
The following packages have unmet dependencies:
libssl-dev : Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

$ sudo apt-get install zlib1g-dev
The following packages have unmet dependencies:
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.8.dfsg-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.


How can I remove the held package and install the correct?










share|improve this question

























  • When's the last time you ran sudo apt update and/or sudo apt upgrade?

    – DopeGhoti
    Aug 29 '17 at 20:24











  • Hi, I have done both between each steps.

    – Sam Healey
    Aug 29 '17 at 20:31














14












14








14


3






Trying to install libssl-dev on ubuntu 14.04.2



$ make
fatal error: openssl/sha.h: No such file or directory
compilation terminated.

$ sudo apt-get install libssl-dev
The following packages have unmet dependencies:
libssl-dev : Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

$ sudo apt-get install zlib1g-dev
The following packages have unmet dependencies:
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.8.dfsg-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.


How can I remove the held package and install the correct?










share|improve this question
















Trying to install libssl-dev on ubuntu 14.04.2



$ make
fatal error: openssl/sha.h: No such file or directory
compilation terminated.

$ sudo apt-get install libssl-dev
The following packages have unmet dependencies:
libssl-dev : Depends: zlib1g-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

$ sudo apt-get install zlib1g-dev
The following packages have unmet dependencies:
zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.8.dfsg-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.


How can I remove the held package and install the correct?







ubuntu package-management






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 29 '17 at 22:00









Jeff Schaller

39.3k1054125




39.3k1054125










asked Aug 29 '17 at 20:23









Sam HealeySam Healey

174114




174114













  • When's the last time you ran sudo apt update and/or sudo apt upgrade?

    – DopeGhoti
    Aug 29 '17 at 20:24











  • Hi, I have done both between each steps.

    – Sam Healey
    Aug 29 '17 at 20:31



















  • When's the last time you ran sudo apt update and/or sudo apt upgrade?

    – DopeGhoti
    Aug 29 '17 at 20:24











  • Hi, I have done both between each steps.

    – Sam Healey
    Aug 29 '17 at 20:31

















When's the last time you ran sudo apt update and/or sudo apt upgrade?

– DopeGhoti
Aug 29 '17 at 20:24





When's the last time you ran sudo apt update and/or sudo apt upgrade?

– DopeGhoti
Aug 29 '17 at 20:24













Hi, I have done both between each steps.

– Sam Healey
Aug 29 '17 at 20:31





Hi, I have done both between each steps.

– Sam Healey
Aug 29 '17 at 20:31










2 Answers
2






active

oldest

votes


















12














First, try entering this:
sudo dpkg --configure -a



This will go a long way toward fixing broken dependencies.
If that does not suffice, try:
sudo apt-get install -f



Then clean and update:
sudo apt-get clean && sudo apt-get update



Then upgrade:
sudo apt-get upgrade
(say 'y' to upgrades)



If you get a message saying some packages are "held back", do this:



sudo apt-get dist-upgrade



Now do these two commands:



sudo apt-get purge zlib1g-dev
sudo apt-get autoremove


Then see what happens when you enter:
sudo apt-get install libssl-dev



If it still doesn't work, try this:



sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1


If it still doesn't work, open up Synaptic Package Manager (It should be in your Launcher. If you can't find it, then at the Terminal enter synaptic-pkexec).



Search for zlib1g-dev.
If the box next to zlib1g-dev is not green, click on it and select "Mark for installation". If you see more than one version, pick 1:1.2.8.dfsg-1ubuntu1 .
Then search for libssl-dev. If the box next to libssl-dev is not green, click on it and select "Mark for installation".



Then select "Apply".






share|improve this answer


























  • Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

    – Sam Healey
    Aug 30 '17 at 8:13











  • what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

    – user192526
    Aug 30 '17 at 8:32











  • @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

    – gracious1
    Aug 30 '17 at 23:43











  • @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

    – gracious1
    Aug 31 '17 at 0:05






  • 1





    @Bahamut Why no sudo with graphical program?

    – gracious1
    Sep 11 '17 at 0:51



















0














you have to look for all files related with your package and purge them, then reinstall.
1.-sudo dpkg --list
2.-sudo apt-get purge "file-name"



repeat 2. with every file. then just reinstall.





share








New contributor




Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f389156%2fhow-to-fix-held-broken-packages%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    12














    First, try entering this:
    sudo dpkg --configure -a



    This will go a long way toward fixing broken dependencies.
    If that does not suffice, try:
    sudo apt-get install -f



    Then clean and update:
    sudo apt-get clean && sudo apt-get update



    Then upgrade:
    sudo apt-get upgrade
    (say 'y' to upgrades)



    If you get a message saying some packages are "held back", do this:



    sudo apt-get dist-upgrade



    Now do these two commands:



    sudo apt-get purge zlib1g-dev
    sudo apt-get autoremove


    Then see what happens when you enter:
    sudo apt-get install libssl-dev



    If it still doesn't work, try this:



    sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1


    If it still doesn't work, open up Synaptic Package Manager (It should be in your Launcher. If you can't find it, then at the Terminal enter synaptic-pkexec).



    Search for zlib1g-dev.
    If the box next to zlib1g-dev is not green, click on it and select "Mark for installation". If you see more than one version, pick 1:1.2.8.dfsg-1ubuntu1 .
    Then search for libssl-dev. If the box next to libssl-dev is not green, click on it and select "Mark for installation".



    Then select "Apply".






    share|improve this answer


























    • Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

      – Sam Healey
      Aug 30 '17 at 8:13











    • what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

      – user192526
      Aug 30 '17 at 8:32











    • @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

      – gracious1
      Aug 30 '17 at 23:43











    • @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

      – gracious1
      Aug 31 '17 at 0:05






    • 1





      @Bahamut Why no sudo with graphical program?

      – gracious1
      Sep 11 '17 at 0:51
















    12














    First, try entering this:
    sudo dpkg --configure -a



    This will go a long way toward fixing broken dependencies.
    If that does not suffice, try:
    sudo apt-get install -f



    Then clean and update:
    sudo apt-get clean && sudo apt-get update



    Then upgrade:
    sudo apt-get upgrade
    (say 'y' to upgrades)



    If you get a message saying some packages are "held back", do this:



    sudo apt-get dist-upgrade



    Now do these two commands:



    sudo apt-get purge zlib1g-dev
    sudo apt-get autoremove


    Then see what happens when you enter:
    sudo apt-get install libssl-dev



    If it still doesn't work, try this:



    sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1


    If it still doesn't work, open up Synaptic Package Manager (It should be in your Launcher. If you can't find it, then at the Terminal enter synaptic-pkexec).



    Search for zlib1g-dev.
    If the box next to zlib1g-dev is not green, click on it and select "Mark for installation". If you see more than one version, pick 1:1.2.8.dfsg-1ubuntu1 .
    Then search for libssl-dev. If the box next to libssl-dev is not green, click on it and select "Mark for installation".



    Then select "Apply".






    share|improve this answer


























    • Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

      – Sam Healey
      Aug 30 '17 at 8:13











    • what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

      – user192526
      Aug 30 '17 at 8:32











    • @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

      – gracious1
      Aug 30 '17 at 23:43











    • @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

      – gracious1
      Aug 31 '17 at 0:05






    • 1





      @Bahamut Why no sudo with graphical program?

      – gracious1
      Sep 11 '17 at 0:51














    12












    12








    12







    First, try entering this:
    sudo dpkg --configure -a



    This will go a long way toward fixing broken dependencies.
    If that does not suffice, try:
    sudo apt-get install -f



    Then clean and update:
    sudo apt-get clean && sudo apt-get update



    Then upgrade:
    sudo apt-get upgrade
    (say 'y' to upgrades)



    If you get a message saying some packages are "held back", do this:



    sudo apt-get dist-upgrade



    Now do these two commands:



    sudo apt-get purge zlib1g-dev
    sudo apt-get autoremove


    Then see what happens when you enter:
    sudo apt-get install libssl-dev



    If it still doesn't work, try this:



    sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1


    If it still doesn't work, open up Synaptic Package Manager (It should be in your Launcher. If you can't find it, then at the Terminal enter synaptic-pkexec).



    Search for zlib1g-dev.
    If the box next to zlib1g-dev is not green, click on it and select "Mark for installation". If you see more than one version, pick 1:1.2.8.dfsg-1ubuntu1 .
    Then search for libssl-dev. If the box next to libssl-dev is not green, click on it and select "Mark for installation".



    Then select "Apply".






    share|improve this answer















    First, try entering this:
    sudo dpkg --configure -a



    This will go a long way toward fixing broken dependencies.
    If that does not suffice, try:
    sudo apt-get install -f



    Then clean and update:
    sudo apt-get clean && sudo apt-get update



    Then upgrade:
    sudo apt-get upgrade
    (say 'y' to upgrades)



    If you get a message saying some packages are "held back", do this:



    sudo apt-get dist-upgrade



    Now do these two commands:



    sudo apt-get purge zlib1g-dev
    sudo apt-get autoremove


    Then see what happens when you enter:
    sudo apt-get install libssl-dev



    If it still doesn't work, try this:



    sudo aptitude install libssl-dev zliblg-dev=1:1.2.8.dfsg-1ubuntu1


    If it still doesn't work, open up Synaptic Package Manager (It should be in your Launcher. If you can't find it, then at the Terminal enter synaptic-pkexec).



    Search for zlib1g-dev.
    If the box next to zlib1g-dev is not green, click on it and select "Mark for installation". If you see more than one version, pick 1:1.2.8.dfsg-1ubuntu1 .
    Then search for libssl-dev. If the box next to libssl-dev is not green, click on it and select "Mark for installation".



    Then select "Apply".







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Sep 11 '17 at 0:49

























    answered Aug 29 '17 at 21:04









    gracious1gracious1

    29119




    29119













    • Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

      – Sam Healey
      Aug 30 '17 at 8:13











    • what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

      – user192526
      Aug 30 '17 at 8:32











    • @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

      – gracious1
      Aug 30 '17 at 23:43











    • @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

      – gracious1
      Aug 31 '17 at 0:05






    • 1





      @Bahamut Why no sudo with graphical program?

      – gracious1
      Sep 11 '17 at 0:51



















    • Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

      – Sam Healey
      Aug 30 '17 at 8:13











    • what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

      – user192526
      Aug 30 '17 at 8:32











    • @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

      – gracious1
      Aug 30 '17 at 23:43











    • @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

      – gracious1
      Aug 31 '17 at 0:05






    • 1





      @Bahamut Why no sudo with graphical program?

      – gracious1
      Sep 11 '17 at 0:51

















    Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

    – Sam Healey
    Aug 30 '17 at 8:13





    Hi, thank you for replying. I did everything above and got the same error as in my original post. When I ran upgrade I got the following message. The following packages have been kept back: linux-generic-lts-utopic linux-headers-generic-lts-utopic linux-image-generic-lts-utopic 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

    – Sam Healey
    Aug 30 '17 at 8:13













    what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

    – user192526
    Aug 30 '17 at 8:32





    what gives apt-cache policy zlib1g-dev and grep -P '^[ t]*[^#[ t]+' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

    – user192526
    Aug 30 '17 at 8:32













    @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

    – gracious1
    Aug 30 '17 at 23:43





    @Bahamut Are you sure you mean "-P" ? For me, I get E: Command line option 'P' [from -P] is not known.

    – gracious1
    Aug 30 '17 at 23:43













    @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

    – gracious1
    Aug 31 '17 at 0:05





    @SamHealey I modified my answer somewhat. Try what I suggest there, and let us know how it goes.

    – gracious1
    Aug 31 '17 at 0:05




    1




    1





    @Bahamut Why no sudo with graphical program?

    – gracious1
    Sep 11 '17 at 0:51





    @Bahamut Why no sudo with graphical program?

    – gracious1
    Sep 11 '17 at 0:51













    0














    you have to look for all files related with your package and purge them, then reinstall.
    1.-sudo dpkg --list
    2.-sudo apt-get purge "file-name"



    repeat 2. with every file. then just reinstall.





    share








    New contributor




    Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.

























      0














      you have to look for all files related with your package and purge them, then reinstall.
      1.-sudo dpkg --list
      2.-sudo apt-get purge "file-name"



      repeat 2. with every file. then just reinstall.





      share








      New contributor




      Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.























        0












        0








        0







        you have to look for all files related with your package and purge them, then reinstall.
        1.-sudo dpkg --list
        2.-sudo apt-get purge "file-name"



        repeat 2. with every file. then just reinstall.





        share








        New contributor




        Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.










        you have to look for all files related with your package and purge them, then reinstall.
        1.-sudo dpkg --list
        2.-sudo apt-get purge "file-name"



        repeat 2. with every file. then just reinstall.






        share








        New contributor




        Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.








        share


        share






        New contributor




        Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.









        answered 15 mins ago









        AlexAlex

        1




        1




        New contributor




        Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.





        New contributor





        Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






        Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
        Check out our Code of Conduct.






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f389156%2fhow-to-fix-held-broken-packages%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            サソリ

            広島県道265号伴広島線

            Setup Asymptote in Texstudio