unable to install jdk and jre in ubuntu 14.04












0















I want to install jdk and jre in my ubuntu 14.04 and I got these following errors:



anil@anil:~$ sudo apt-get install default-jre
[sudo] password for anil:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
default-jre : Depends: default-jre-headless (= 2:1.7-51) but it is not going to be installed
Depends: openjdk-7-jre (>= 7~u3-2.1.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.









share|improve this question

























  • can you provide me the output of /etc/apt/sources.list?

    – orvi
    Aug 14 '15 at 4:21











  • can you provide me the output of /etc/apt/sources.list? anil@anil:~$ /etc/apt/sources.list bash: /etc/apt/sources.list: Permission denied

    – Ravan
    Aug 14 '15 at 5:33













  • login as root

    – orvi
    Aug 14 '15 at 12:46











  • You've probably turned off automatic updates to stop it bugging you! Turn it back on? This worked for me.

    – Alexander Kartun-Giles
    Apr 27 '16 at 15:09


















0















I want to install jdk and jre in my ubuntu 14.04 and I got these following errors:



anil@anil:~$ sudo apt-get install default-jre
[sudo] password for anil:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
default-jre : Depends: default-jre-headless (= 2:1.7-51) but it is not going to be installed
Depends: openjdk-7-jre (>= 7~u3-2.1.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.









share|improve this question

























  • can you provide me the output of /etc/apt/sources.list?

    – orvi
    Aug 14 '15 at 4:21











  • can you provide me the output of /etc/apt/sources.list? anil@anil:~$ /etc/apt/sources.list bash: /etc/apt/sources.list: Permission denied

    – Ravan
    Aug 14 '15 at 5:33













  • login as root

    – orvi
    Aug 14 '15 at 12:46











  • You've probably turned off automatic updates to stop it bugging you! Turn it back on? This worked for me.

    – Alexander Kartun-Giles
    Apr 27 '16 at 15:09
















0












0








0


2






I want to install jdk and jre in my ubuntu 14.04 and I got these following errors:



anil@anil:~$ sudo apt-get install default-jre
[sudo] password for anil:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
default-jre : Depends: default-jre-headless (= 2:1.7-51) but it is not going to be installed
Depends: openjdk-7-jre (>= 7~u3-2.1.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.









share|improve this question
















I want to install jdk and jre in my ubuntu 14.04 and I got these following errors:



anil@anil:~$ sudo apt-get install default-jre
[sudo] password for anil:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
default-jre : Depends: default-jre-headless (= 2:1.7-51) but it is not going to be installed
Depends: openjdk-7-jre (>= 7~u3-2.1.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.






14.04 software-installation java dependencies openjdk






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 24 '15 at 2:35







Ravan

















asked Aug 14 '15 at 3:56









RavanRavan

5,733154577




5,733154577













  • can you provide me the output of /etc/apt/sources.list?

    – orvi
    Aug 14 '15 at 4:21











  • can you provide me the output of /etc/apt/sources.list? anil@anil:~$ /etc/apt/sources.list bash: /etc/apt/sources.list: Permission denied

    – Ravan
    Aug 14 '15 at 5:33













  • login as root

    – orvi
    Aug 14 '15 at 12:46











  • You've probably turned off automatic updates to stop it bugging you! Turn it back on? This worked for me.

    – Alexander Kartun-Giles
    Apr 27 '16 at 15:09





















  • can you provide me the output of /etc/apt/sources.list?

    – orvi
    Aug 14 '15 at 4:21











  • can you provide me the output of /etc/apt/sources.list? anil@anil:~$ /etc/apt/sources.list bash: /etc/apt/sources.list: Permission denied

    – Ravan
    Aug 14 '15 at 5:33













  • login as root

    – orvi
    Aug 14 '15 at 12:46











  • You've probably turned off automatic updates to stop it bugging you! Turn it back on? This worked for me.

    – Alexander Kartun-Giles
    Apr 27 '16 at 15:09



















can you provide me the output of /etc/apt/sources.list?

– orvi
Aug 14 '15 at 4:21





can you provide me the output of /etc/apt/sources.list?

– orvi
Aug 14 '15 at 4:21













can you provide me the output of /etc/apt/sources.list? anil@anil:~$ /etc/apt/sources.list bash: /etc/apt/sources.list: Permission denied

– Ravan
Aug 14 '15 at 5:33







can you provide me the output of /etc/apt/sources.list? anil@anil:~$ /etc/apt/sources.list bash: /etc/apt/sources.list: Permission denied

– Ravan
Aug 14 '15 at 5:33















login as root

– orvi
Aug 14 '15 at 12:46





login as root

– orvi
Aug 14 '15 at 12:46













You've probably turned off automatic updates to stop it bugging you! Turn it back on? This worked for me.

– Alexander Kartun-Giles
Apr 27 '16 at 15:09







You've probably turned off automatic updates to stop it bugging you! Turn it back on? This worked for me.

– Alexander Kartun-Giles
Apr 27 '16 at 15:09












5 Answers
5






active

oldest

votes


















1














Your computer is missing packages needed to install default-jre.

Update the package list sudo apt-get update and then run sudo apt-get -f install this may fix the problem. or you can run sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless
The last command is same as @Noctane said except he made a typo mistake in the command.






share|improve this answer































    1














    In regards to the broken packages, try installing the same package with aptitude. it will give up less easily, and will attempt to find solutions
    which may involve modifying other packages.

    You can also get a list of held packages with dpkg --get-selections | grep hold, which could show you the issue.



    Otherwise, maybe try installing openjdk and jre:



    Doing a apt-cache search jdk or apt-cache search jre lists a lot of packages that might interest you. To install open JDK and JRE you would use
    sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless

    you can replace the 7 with 6 or 8 if you would prefer openjdk 6 or 8



    EDIT:

    Fixed apt-get command, thanks @lesslazy






    share|improve this answer


























    • anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

      – Ravan
      Aug 14 '15 at 5:36



















    1














    First run these commands in terminal (press Ctrl+Alt+T):




    • sudo apt-get --fix-broken install


    • sudo apt-get clean

    • sudo apt-get autoclean

    • sudo apt-get autoremove


    • sudo dpkg --configure -a


    • sudo apt-get update then following




      1. Changed software and updates to main server


      2. Unmarked all "other software" sources





    ims




    1. Reload it and run for software update,it installed tzdata(i think this is the reason)



    2. Run



      sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless







    share|improve this answer

































      0














      Maybe:
      1) Try this:
      http://www.upubuntu.com/2013/05/how-to-fix-broken-packages-using.html
      2) Try to install java again.






      share|improve this answer































        0














        You can try this:



        sudo apt install python-software-properties
        sudo add-apt-repository ppa:webupd8team/java


        Then, you will need to fully update the system with the following command:



        sudo apt update


        You can also install Java by using one of the following commands:



        sudo apt install oracle-java6-installer
        sudo apt install oracle-java7-installer
        sudo apt install oracle-java8-installer




        share








        New contributor




        mitesh7172 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: "89"
          };
          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: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          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%2faskubuntu.com%2fquestions%2f661228%2funable-to-install-jdk-and-jre-in-ubuntu-14-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          5 Answers
          5






          active

          oldest

          votes








          5 Answers
          5






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          Your computer is missing packages needed to install default-jre.

          Update the package list sudo apt-get update and then run sudo apt-get -f install this may fix the problem. or you can run sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless
          The last command is same as @Noctane said except he made a typo mistake in the command.






          share|improve this answer




























            1














            Your computer is missing packages needed to install default-jre.

            Update the package list sudo apt-get update and then run sudo apt-get -f install this may fix the problem. or you can run sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless
            The last command is same as @Noctane said except he made a typo mistake in the command.






            share|improve this answer


























              1












              1








              1







              Your computer is missing packages needed to install default-jre.

              Update the package list sudo apt-get update and then run sudo apt-get -f install this may fix the problem. or you can run sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless
              The last command is same as @Noctane said except he made a typo mistake in the command.






              share|improve this answer













              Your computer is missing packages needed to install default-jre.

              Update the package list sudo apt-get update and then run sudo apt-get -f install this may fix the problem. or you can run sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless
              The last command is same as @Noctane said except he made a typo mistake in the command.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Aug 14 '15 at 5:48









              lesslazylesslazy

              499




              499

























                  1














                  In regards to the broken packages, try installing the same package with aptitude. it will give up less easily, and will attempt to find solutions
                  which may involve modifying other packages.

                  You can also get a list of held packages with dpkg --get-selections | grep hold, which could show you the issue.



                  Otherwise, maybe try installing openjdk and jre:



                  Doing a apt-cache search jdk or apt-cache search jre lists a lot of packages that might interest you. To install open JDK and JRE you would use
                  sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless

                  you can replace the 7 with 6 or 8 if you would prefer openjdk 6 or 8



                  EDIT:

                  Fixed apt-get command, thanks @lesslazy






                  share|improve this answer


























                  • anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

                    – Ravan
                    Aug 14 '15 at 5:36
















                  1














                  In regards to the broken packages, try installing the same package with aptitude. it will give up less easily, and will attempt to find solutions
                  which may involve modifying other packages.

                  You can also get a list of held packages with dpkg --get-selections | grep hold, which could show you the issue.



                  Otherwise, maybe try installing openjdk and jre:



                  Doing a apt-cache search jdk or apt-cache search jre lists a lot of packages that might interest you. To install open JDK and JRE you would use
                  sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless

                  you can replace the 7 with 6 or 8 if you would prefer openjdk 6 or 8



                  EDIT:

                  Fixed apt-get command, thanks @lesslazy






                  share|improve this answer


























                  • anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

                    – Ravan
                    Aug 14 '15 at 5:36














                  1












                  1








                  1







                  In regards to the broken packages, try installing the same package with aptitude. it will give up less easily, and will attempt to find solutions
                  which may involve modifying other packages.

                  You can also get a list of held packages with dpkg --get-selections | grep hold, which could show you the issue.



                  Otherwise, maybe try installing openjdk and jre:



                  Doing a apt-cache search jdk or apt-cache search jre lists a lot of packages that might interest you. To install open JDK and JRE you would use
                  sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless

                  you can replace the 7 with 6 or 8 if you would prefer openjdk 6 or 8



                  EDIT:

                  Fixed apt-get command, thanks @lesslazy






                  share|improve this answer















                  In regards to the broken packages, try installing the same package with aptitude. it will give up less easily, and will attempt to find solutions
                  which may involve modifying other packages.

                  You can also get a list of held packages with dpkg --get-selections | grep hold, which could show you the issue.



                  Otherwise, maybe try installing openjdk and jre:



                  Doing a apt-cache search jdk or apt-cache search jre lists a lot of packages that might interest you. To install open JDK and JRE you would use
                  sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless

                  you can replace the 7 with 6 or 8 if you would prefer openjdk 6 or 8



                  EDIT:

                  Fixed apt-get command, thanks @lesslazy







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Aug 14 '15 at 9:19

























                  answered Aug 14 '15 at 4:15









                  NoctaneNoctane

                  118




                  118













                  • anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

                    – Ravan
                    Aug 14 '15 at 5:36



















                  • anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

                    – Ravan
                    Aug 14 '15 at 5:36

















                  anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

                  – Ravan
                  Aug 14 '15 at 5:36





                  anil@anil:~$ sudo apt-get install openjdk-7-jdk open-jdk-7-jre Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package open-jdk-7-jre

                  – Ravan
                  Aug 14 '15 at 5:36











                  1














                  First run these commands in terminal (press Ctrl+Alt+T):




                  • sudo apt-get --fix-broken install


                  • sudo apt-get clean

                  • sudo apt-get autoclean

                  • sudo apt-get autoremove


                  • sudo dpkg --configure -a


                  • sudo apt-get update then following




                    1. Changed software and updates to main server


                    2. Unmarked all "other software" sources





                  ims




                  1. Reload it and run for software update,it installed tzdata(i think this is the reason)



                  2. Run



                    sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless







                  share|improve this answer






























                    1














                    First run these commands in terminal (press Ctrl+Alt+T):




                    • sudo apt-get --fix-broken install


                    • sudo apt-get clean

                    • sudo apt-get autoclean

                    • sudo apt-get autoremove


                    • sudo dpkg --configure -a


                    • sudo apt-get update then following




                      1. Changed software and updates to main server


                      2. Unmarked all "other software" sources





                    ims




                    1. Reload it and run for software update,it installed tzdata(i think this is the reason)



                    2. Run



                      sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless







                    share|improve this answer




























                      1












                      1








                      1







                      First run these commands in terminal (press Ctrl+Alt+T):




                      • sudo apt-get --fix-broken install


                      • sudo apt-get clean

                      • sudo apt-get autoclean

                      • sudo apt-get autoremove


                      • sudo dpkg --configure -a


                      • sudo apt-get update then following




                        1. Changed software and updates to main server


                        2. Unmarked all "other software" sources





                      ims




                      1. Reload it and run for software update,it installed tzdata(i think this is the reason)



                      2. Run



                        sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless







                      share|improve this answer















                      First run these commands in terminal (press Ctrl+Alt+T):




                      • sudo apt-get --fix-broken install


                      • sudo apt-get clean

                      • sudo apt-get autoclean

                      • sudo apt-get autoremove


                      • sudo dpkg --configure -a


                      • sudo apt-get update then following




                        1. Changed software and updates to main server


                        2. Unmarked all "other software" sources





                      ims




                      1. Reload it and run for software update,it installed tzdata(i think this is the reason)



                      2. Run



                        sudo apt-get install openjdk-7-jdk openjdk-7-jre-headless








                      share|improve this answer














                      share|improve this answer



                      share|improve this answer








                      edited Mar 9 '17 at 18:04









                      Community

                      1




                      1










                      answered Aug 14 '15 at 6:48









                      RavanRavan

                      5,733154577




                      5,733154577























                          0














                          Maybe:
                          1) Try this:
                          http://www.upubuntu.com/2013/05/how-to-fix-broken-packages-using.html
                          2) Try to install java again.






                          share|improve this answer




























                            0














                            Maybe:
                            1) Try this:
                            http://www.upubuntu.com/2013/05/how-to-fix-broken-packages-using.html
                            2) Try to install java again.






                            share|improve this answer


























                              0












                              0








                              0







                              Maybe:
                              1) Try this:
                              http://www.upubuntu.com/2013/05/how-to-fix-broken-packages-using.html
                              2) Try to install java again.






                              share|improve this answer













                              Maybe:
                              1) Try this:
                              http://www.upubuntu.com/2013/05/how-to-fix-broken-packages-using.html
                              2) Try to install java again.







                              share|improve this answer












                              share|improve this answer



                              share|improve this answer










                              answered Aug 14 '15 at 9:22









                              Mario KamenjakMario Kamenjak

                              6551924




                              6551924























                                  0














                                  You can try this:



                                  sudo apt install python-software-properties
                                  sudo add-apt-repository ppa:webupd8team/java


                                  Then, you will need to fully update the system with the following command:



                                  sudo apt update


                                  You can also install Java by using one of the following commands:



                                  sudo apt install oracle-java6-installer
                                  sudo apt install oracle-java7-installer
                                  sudo apt install oracle-java8-installer




                                  share








                                  New contributor




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

























                                    0














                                    You can try this:



                                    sudo apt install python-software-properties
                                    sudo add-apt-repository ppa:webupd8team/java


                                    Then, you will need to fully update the system with the following command:



                                    sudo apt update


                                    You can also install Java by using one of the following commands:



                                    sudo apt install oracle-java6-installer
                                    sudo apt install oracle-java7-installer
                                    sudo apt install oracle-java8-installer




                                    share








                                    New contributor




                                    mitesh7172 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 can try this:



                                      sudo apt install python-software-properties
                                      sudo add-apt-repository ppa:webupd8team/java


                                      Then, you will need to fully update the system with the following command:



                                      sudo apt update


                                      You can also install Java by using one of the following commands:



                                      sudo apt install oracle-java6-installer
                                      sudo apt install oracle-java7-installer
                                      sudo apt install oracle-java8-installer




                                      share








                                      New contributor




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










                                      You can try this:



                                      sudo apt install python-software-properties
                                      sudo add-apt-repository ppa:webupd8team/java


                                      Then, you will need to fully update the system with the following command:



                                      sudo apt update


                                      You can also install Java by using one of the following commands:



                                      sudo apt install oracle-java6-installer
                                      sudo apt install oracle-java7-installer
                                      sudo apt install oracle-java8-installer





                                      share








                                      New contributor




                                      mitesh7172 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




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









                                      answered 1 min ago









                                      mitesh7172mitesh7172

                                      1




                                      1




                                      New contributor




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





                                      New contributor





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






                                      mitesh7172 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 Ask Ubuntu!


                                          • 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%2faskubuntu.com%2fquestions%2f661228%2funable-to-install-jdk-and-jre-in-ubuntu-14-04%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

                                          GameSpot

                                          日野市

                                          Tu-95轟炸機