cannot install mysql-server in ubuntu16.0.4





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







3















sudo apt-get install mysql-server
fail
it blocks at this point



var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory


which I found the solution to this bug is comment the line 143 in the /var/lib/dpkg/info/mysql-server-5.7.postinst file.



but my problem is I cannot find the /var/lib/dpkg/info/mysql-server-5.7.postinst file .. not to say comment one line in it .



so how to do to get rid of stuck situation





ps: I have installed mariadb and uninstall it by the steps I googled





update:



I have followed the steps given by the first answer, and it still prompted that error before



surprisingly, this time I can sudo vim /var/lib/dpkg/info/mysql-server-5.7.postinst file and I comment the line 143 , however.. it report another error



ERROR: Unable to start MySQL server:
2017-11-26T08:51:57.033255Z 0 [Note] mysqld (mysqld 5.7.20-0ubuntu0.16.04.1-log) starting as process 22612 ...
2017-11-26T08:51:57.034651Z 0 [ERROR] You have enabled the binary log, but you haven't provided the mandatory server-id. Please refer to the proper server start-up parameters documentation
2017-11-26T08:51:57.035603Z 0 [ERROR] Aborting









share|improve this question































    3















    sudo apt-get install mysql-server
    fail
    it blocks at this point



    var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory


    which I found the solution to this bug is comment the line 143 in the /var/lib/dpkg/info/mysql-server-5.7.postinst file.



    but my problem is I cannot find the /var/lib/dpkg/info/mysql-server-5.7.postinst file .. not to say comment one line in it .



    so how to do to get rid of stuck situation





    ps: I have installed mariadb and uninstall it by the steps I googled





    update:



    I have followed the steps given by the first answer, and it still prompted that error before



    surprisingly, this time I can sudo vim /var/lib/dpkg/info/mysql-server-5.7.postinst file and I comment the line 143 , however.. it report another error



    ERROR: Unable to start MySQL server:
    2017-11-26T08:51:57.033255Z 0 [Note] mysqld (mysqld 5.7.20-0ubuntu0.16.04.1-log) starting as process 22612 ...
    2017-11-26T08:51:57.034651Z 0 [ERROR] You have enabled the binary log, but you haven't provided the mandatory server-id. Please refer to the proper server start-up parameters documentation
    2017-11-26T08:51:57.035603Z 0 [ERROR] Aborting









    share|improve this question



























      3












      3








      3








      sudo apt-get install mysql-server
      fail
      it blocks at this point



      var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory


      which I found the solution to this bug is comment the line 143 in the /var/lib/dpkg/info/mysql-server-5.7.postinst file.



      but my problem is I cannot find the /var/lib/dpkg/info/mysql-server-5.7.postinst file .. not to say comment one line in it .



      so how to do to get rid of stuck situation





      ps: I have installed mariadb and uninstall it by the steps I googled





      update:



      I have followed the steps given by the first answer, and it still prompted that error before



      surprisingly, this time I can sudo vim /var/lib/dpkg/info/mysql-server-5.7.postinst file and I comment the line 143 , however.. it report another error



      ERROR: Unable to start MySQL server:
      2017-11-26T08:51:57.033255Z 0 [Note] mysqld (mysqld 5.7.20-0ubuntu0.16.04.1-log) starting as process 22612 ...
      2017-11-26T08:51:57.034651Z 0 [ERROR] You have enabled the binary log, but you haven't provided the mandatory server-id. Please refer to the proper server start-up parameters documentation
      2017-11-26T08:51:57.035603Z 0 [ERROR] Aborting









      share|improve this question
















      sudo apt-get install mysql-server
      fail
      it blocks at this point



      var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory


      which I found the solution to this bug is comment the line 143 in the /var/lib/dpkg/info/mysql-server-5.7.postinst file.



      but my problem is I cannot find the /var/lib/dpkg/info/mysql-server-5.7.postinst file .. not to say comment one line in it .



      so how to do to get rid of stuck situation





      ps: I have installed mariadb and uninstall it by the steps I googled





      update:



      I have followed the steps given by the first answer, and it still prompted that error before



      surprisingly, this time I can sudo vim /var/lib/dpkg/info/mysql-server-5.7.postinst file and I comment the line 143 , however.. it report another error



      ERROR: Unable to start MySQL server:
      2017-11-26T08:51:57.033255Z 0 [Note] mysqld (mysqld 5.7.20-0ubuntu0.16.04.1-log) starting as process 22612 ...
      2017-11-26T08:51:57.034651Z 0 [ERROR] You have enabled the binary log, but you haven't provided the mandatory server-id. Please refer to the proper server start-up parameters documentation
      2017-11-26T08:51:57.035603Z 0 [ERROR] Aborting






      server apt dpkg mysql






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 '17 at 8:55







      LFBuildAMountain

















      asked Nov 26 '17 at 3:36









      LFBuildAMountainLFBuildAMountain

      3815




      3815






















          3 Answers
          3






          active

          oldest

          votes


















          2














          Just purge all mysql packages and reinstall:



          sudo apt-get remove --purge *mysql*
          sudo apt-get autoremove
          sudo apt-get autoclean
          sudo apt-get install mysql-server mysql_secure_installation





          share|improve this answer


























          • if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

            – Yaron
            Nov 26 '17 at 8:28






          • 1





            @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

            – LFBuildAMountain
            Nov 26 '17 at 8:50











          • @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

            – Andrew Bainbridge
            Nov 27 '17 at 16:32






          • 1





            @AndrewBainbridge Sometimes this happens when you clean up your logs.

            – e200
            Nov 28 '17 at 17:19











          • If my answer helps you, you can upvote it. ;)

            – e200
            Nov 28 '17 at 17:20



















          0














          I fixed the problem by adding a blank file that the install script was looking for and then giving rwx permissions for everyone. Probably not the best way but it worked for me.



              sudo touch /usr/share/mysql-common/configure-symlinks
          sudo chmod 777 /usr/share/mysql-common/configure-symlinks
          sudo apt-get update
          sudo apt-get upgrade





          share|improve this answer































            0














            I solved this problem by removing mariadb's deb sources and purging mysql-common and then reinstalling it.



            do:
            sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main



            comment it out by putting a # in front of it.
            then run



            sudo apt update
            sudo apt purge mysql-common
            sudo apt install mysql-common


            after that you can installed mysql-server properly via sudo apt install mysql-server



            if it ever dissapears from the repo the script was:



            #!/bin/sh
            set -e

            case "$1" in
            install)
            variant="$2"
            my_cnf_path="$3"
            update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200
            ;;
            remove)
            variant="$2"
            my_cnf_path="$3"
            update-alternatives --remove my.cnf "$my_cnf_path"
            ;;
            esac
            ```





            share|improve this answer








            New contributor




            bigibas123 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%2f980314%2fcannot-install-mysql-server-in-ubuntu16-0-4%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              Just purge all mysql packages and reinstall:



              sudo apt-get remove --purge *mysql*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get install mysql-server mysql_secure_installation





              share|improve this answer


























              • if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

                – Yaron
                Nov 26 '17 at 8:28






              • 1





                @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

                – LFBuildAMountain
                Nov 26 '17 at 8:50











              • @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

                – Andrew Bainbridge
                Nov 27 '17 at 16:32






              • 1





                @AndrewBainbridge Sometimes this happens when you clean up your logs.

                – e200
                Nov 28 '17 at 17:19











              • If my answer helps you, you can upvote it. ;)

                – e200
                Nov 28 '17 at 17:20
















              2














              Just purge all mysql packages and reinstall:



              sudo apt-get remove --purge *mysql*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get install mysql-server mysql_secure_installation





              share|improve this answer


























              • if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

                – Yaron
                Nov 26 '17 at 8:28






              • 1





                @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

                – LFBuildAMountain
                Nov 26 '17 at 8:50











              • @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

                – Andrew Bainbridge
                Nov 27 '17 at 16:32






              • 1





                @AndrewBainbridge Sometimes this happens when you clean up your logs.

                – e200
                Nov 28 '17 at 17:19











              • If my answer helps you, you can upvote it. ;)

                – e200
                Nov 28 '17 at 17:20














              2












              2








              2







              Just purge all mysql packages and reinstall:



              sudo apt-get remove --purge *mysql*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get install mysql-server mysql_secure_installation





              share|improve this answer















              Just purge all mysql packages and reinstall:



              sudo apt-get remove --purge *mysql*
              sudo apt-get autoremove
              sudo apt-get autoclean
              sudo apt-get install mysql-server mysql_secure_installation






              share|improve this answer














              share|improve this answer



              share|improve this answer








              edited Nov 26 '17 at 8:37

























              answered Nov 26 '17 at 8:04









              e200e200

              130111




              130111













              • if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

                – Yaron
                Nov 26 '17 at 8:28






              • 1





                @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

                – LFBuildAMountain
                Nov 26 '17 at 8:50











              • @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

                – Andrew Bainbridge
                Nov 27 '17 at 16:32






              • 1





                @AndrewBainbridge Sometimes this happens when you clean up your logs.

                – e200
                Nov 28 '17 at 17:19











              • If my answer helps you, you can upvote it. ;)

                – e200
                Nov 28 '17 at 17:20



















              • if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

                – Yaron
                Nov 26 '17 at 8:28






              • 1





                @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

                – LFBuildAMountain
                Nov 26 '17 at 8:50











              • @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

                – Andrew Bainbridge
                Nov 27 '17 at 16:32






              • 1





                @AndrewBainbridge Sometimes this happens when you clean up your logs.

                – e200
                Nov 28 '17 at 17:19











              • If my answer helps you, you can upvote it. ;)

                – e200
                Nov 28 '17 at 17:20

















              if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

              – Yaron
              Nov 26 '17 at 8:28





              if you'll edit your answer and add some information to the set of commands you publish as answer, will improve its quality.

              – Yaron
              Nov 26 '17 at 8:28




              1




              1





              @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

              – LFBuildAMountain
              Nov 26 '17 at 8:50





              @e200 no ..it doesn't work. it still prompt this error /var/lib/dpkg/info/mysql-server-5.7.postinst: line 143: /usr/share/mysql-common/configure-symlinks: No such file or directory

              – LFBuildAMountain
              Nov 26 '17 at 8:50













              @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

              – Andrew Bainbridge
              Nov 27 '17 at 16:32





              @e200: I had a different failure installing mysql-server. And your advice fixed it. The error was, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'".

              – Andrew Bainbridge
              Nov 27 '17 at 16:32




              1




              1





              @AndrewBainbridge Sometimes this happens when you clean up your logs.

              – e200
              Nov 28 '17 at 17:19





              @AndrewBainbridge Sometimes this happens when you clean up your logs.

              – e200
              Nov 28 '17 at 17:19













              If my answer helps you, you can upvote it. ;)

              – e200
              Nov 28 '17 at 17:20





              If my answer helps you, you can upvote it. ;)

              – e200
              Nov 28 '17 at 17:20













              0














              I fixed the problem by adding a blank file that the install script was looking for and then giving rwx permissions for everyone. Probably not the best way but it worked for me.



                  sudo touch /usr/share/mysql-common/configure-symlinks
              sudo chmod 777 /usr/share/mysql-common/configure-symlinks
              sudo apt-get update
              sudo apt-get upgrade





              share|improve this answer




























                0














                I fixed the problem by adding a blank file that the install script was looking for and then giving rwx permissions for everyone. Probably not the best way but it worked for me.



                    sudo touch /usr/share/mysql-common/configure-symlinks
                sudo chmod 777 /usr/share/mysql-common/configure-symlinks
                sudo apt-get update
                sudo apt-get upgrade





                share|improve this answer


























                  0












                  0








                  0







                  I fixed the problem by adding a blank file that the install script was looking for and then giving rwx permissions for everyone. Probably not the best way but it worked for me.



                      sudo touch /usr/share/mysql-common/configure-symlinks
                  sudo chmod 777 /usr/share/mysql-common/configure-symlinks
                  sudo apt-get update
                  sudo apt-get upgrade





                  share|improve this answer













                  I fixed the problem by adding a blank file that the install script was looking for and then giving rwx permissions for everyone. Probably not the best way but it worked for me.



                      sudo touch /usr/share/mysql-common/configure-symlinks
                  sudo chmod 777 /usr/share/mysql-common/configure-symlinks
                  sudo apt-get update
                  sudo apt-get upgrade






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 10 '18 at 0:04









                  u458625u458625

                  1




                  1























                      0














                      I solved this problem by removing mariadb's deb sources and purging mysql-common and then reinstalling it.



                      do:
                      sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main



                      comment it out by putting a # in front of it.
                      then run



                      sudo apt update
                      sudo apt purge mysql-common
                      sudo apt install mysql-common


                      after that you can installed mysql-server properly via sudo apt install mysql-server



                      if it ever dissapears from the repo the script was:



                      #!/bin/sh
                      set -e

                      case "$1" in
                      install)
                      variant="$2"
                      my_cnf_path="$3"
                      update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200
                      ;;
                      remove)
                      variant="$2"
                      my_cnf_path="$3"
                      update-alternatives --remove my.cnf "$my_cnf_path"
                      ;;
                      esac
                      ```





                      share|improve this answer








                      New contributor




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

























                        0














                        I solved this problem by removing mariadb's deb sources and purging mysql-common and then reinstalling it.



                        do:
                        sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main



                        comment it out by putting a # in front of it.
                        then run



                        sudo apt update
                        sudo apt purge mysql-common
                        sudo apt install mysql-common


                        after that you can installed mysql-server properly via sudo apt install mysql-server



                        if it ever dissapears from the repo the script was:



                        #!/bin/sh
                        set -e

                        case "$1" in
                        install)
                        variant="$2"
                        my_cnf_path="$3"
                        update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200
                        ;;
                        remove)
                        variant="$2"
                        my_cnf_path="$3"
                        update-alternatives --remove my.cnf "$my_cnf_path"
                        ;;
                        esac
                        ```





                        share|improve this answer








                        New contributor




                        bigibas123 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







                          I solved this problem by removing mariadb's deb sources and purging mysql-common and then reinstalling it.



                          do:
                          sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main



                          comment it out by putting a # in front of it.
                          then run



                          sudo apt update
                          sudo apt purge mysql-common
                          sudo apt install mysql-common


                          after that you can installed mysql-server properly via sudo apt install mysql-server



                          if it ever dissapears from the repo the script was:



                          #!/bin/sh
                          set -e

                          case "$1" in
                          install)
                          variant="$2"
                          my_cnf_path="$3"
                          update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200
                          ;;
                          remove)
                          variant="$2"
                          my_cnf_path="$3"
                          update-alternatives --remove my.cnf "$my_cnf_path"
                          ;;
                          esac
                          ```





                          share|improve this answer








                          New contributor




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










                          I solved this problem by removing mariadb's deb sources and purging mysql-common and then reinstalling it.



                          do:
                          sudo apt edit-sources and look for anything containing mariadb like: deb [arch=amd64,arm64,ppc64el] http://ftp.nluug.nl/db/mariadb/repo/10.3/ubuntu bionic main



                          comment it out by putting a # in front of it.
                          then run



                          sudo apt update
                          sudo apt purge mysql-common
                          sudo apt install mysql-common


                          after that you can installed mysql-server properly via sudo apt install mysql-server



                          if it ever dissapears from the repo the script was:



                          #!/bin/sh
                          set -e

                          case "$1" in
                          install)
                          variant="$2"
                          my_cnf_path="$3"
                          update-alternatives --install /etc/mysql/my.cnf my.cnf "$my_cnf_path" 200
                          ;;
                          remove)
                          variant="$2"
                          my_cnf_path="$3"
                          update-alternatives --remove my.cnf "$my_cnf_path"
                          ;;
                          esac
                          ```






                          share|improve this answer








                          New contributor




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









                          share|improve this answer



                          share|improve this answer






                          New contributor




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









                          answered 9 hours ago









                          bigibas123bigibas123

                          1




                          1




                          New contributor




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





                          New contributor





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






                          bigibas123 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%2f980314%2fcannot-install-mysql-server-in-ubuntu16-0-4%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轟炸機