How to fix AppArmor `could not open` error when installing php+mysql?











up vote
4
down vote

favorite












I want to install php5-imap php5-ldap php5-curl



sudo apt-get install php5-imap php5-ldap php5-curl


I get this error:



AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'


How can this problem be resolved?










share|improve this question




























    up vote
    4
    down vote

    favorite












    I want to install php5-imap php5-ldap php5-curl



    sudo apt-get install php5-imap php5-ldap php5-curl


    I get this error:



    AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'


    How can this problem be resolved?










    share|improve this question


























      up vote
      4
      down vote

      favorite









      up vote
      4
      down vote

      favorite











      I want to install php5-imap php5-ldap php5-curl



      sudo apt-get install php5-imap php5-ldap php5-curl


      I get this error:



      AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'


      How can this problem be resolved?










      share|improve this question















      I want to install php5-imap php5-ldap php5-curl



      sudo apt-get install php5-imap php5-ldap php5-curl


      I get this error:



      AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'


      How can this problem be resolved?







      mysql apparmor






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 7 '13 at 12:37







      user25656

















      asked Feb 7 '13 at 11:04









      Ellouze Anis

      164126




      164126






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote













          See if the Ubuntu wiki helps : https://wiki.ubuntu.com/DebuggingApparmor



          Specifically,




          When debugging, it may also be useful
          to put apparmor into 'complain' mode.
          This will allow your application to
          function normally while apparmor
          reports accesses that are not in the
          profile. To enable 'complain' mode,
          use:



          sudo aa-complain /path/to/bin


          where '/path/to/bin' is the absolute
          path to the binary, as reported in the
          'profile=...' portion of the 'audit'
          entry. Eg:



          sudo aa-complain /usr/sbin/slapd


          To re-enable enforcing mode, use
          'aa-enforce' instead:



          sudo aa-enforce /path/to/bin


          To disable a profile:



          sudo touch /etc/apparmor.d/disable/path.to.bin
          sudo apparmor_parser -R /etc/apparmor.d/path.to.bin


          To disable a profile in Ubuntu 10.10 and earlier:



          sudo touch /etc/apparmor.d/disable/path.to.bin sudo apparmor_parser -R /etc/apparmor.d/path.to.bin



          in 11.04 and later:



          sudo aa-disable /etc/apparmor.d/path.to.bin



          To disable all of AppArmor
          for testing purposes, boot with apparmor=0 on the kernel command
          line.







          share|improve this answer




























            up vote
            0
            down vote













            It is an old question, but maybe someone will find it useful.



            Sometimes pieces of application are split in separate packages. Same goes for apparmor profiles. They are split in packages apparmor-profiles and apparmor-profiles-extra. So, if you have some profiles missing, install apparmor-profiles-extra.






            share|improve this answer




























              up vote
              0
              down vote













              You are missing the file abstractions/mysql. This happened to me when I tried to completely remove MySQL before reinstalling it. I fixed this issue by replacing the file with a copy from another server. The contents of my file looks something like this:



              # ------------------------------------------------------------------
              #
              # Copyright (C) 2002-2006 Novell/SUSE
              # Copyright (C) 2013 Christian Boltz
              #
              # This program is free software; you can redistribute it and/or
              # modify it under the terms of version 2 of the GNU General Public
              # License published by the Free Software Foundation.
              #
              # ------------------------------------------------------------------

              /var/lib/mysql{,d}/mysql{,d}.sock rw,
              /{var/,}run/mysql{,d}/mysql{,d}.sock rw,
              /usr/share/{mysql,mysql-community-server,mariadb}/charsets/ r,
              /usr/share/{mysql,mysql-community-server,mariadb}/charsets/*.xml r,


              Try creating the file and adding the above contents with:



              sudo nano /etc/apparmor.d/abstractions/mysql





              share|improve this answer








              New contributor




              user2395126 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',
                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%2f252340%2fhow-to-fix-apparmor-could-not-open-error-when-installing-phpmysql%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








                up vote
                1
                down vote













                See if the Ubuntu wiki helps : https://wiki.ubuntu.com/DebuggingApparmor



                Specifically,




                When debugging, it may also be useful
                to put apparmor into 'complain' mode.
                This will allow your application to
                function normally while apparmor
                reports accesses that are not in the
                profile. To enable 'complain' mode,
                use:



                sudo aa-complain /path/to/bin


                where '/path/to/bin' is the absolute
                path to the binary, as reported in the
                'profile=...' portion of the 'audit'
                entry. Eg:



                sudo aa-complain /usr/sbin/slapd


                To re-enable enforcing mode, use
                'aa-enforce' instead:



                sudo aa-enforce /path/to/bin


                To disable a profile:



                sudo touch /etc/apparmor.d/disable/path.to.bin
                sudo apparmor_parser -R /etc/apparmor.d/path.to.bin


                To disable a profile in Ubuntu 10.10 and earlier:



                sudo touch /etc/apparmor.d/disable/path.to.bin sudo apparmor_parser -R /etc/apparmor.d/path.to.bin



                in 11.04 and later:



                sudo aa-disable /etc/apparmor.d/path.to.bin



                To disable all of AppArmor
                for testing purposes, boot with apparmor=0 on the kernel command
                line.







                share|improve this answer

























                  up vote
                  1
                  down vote













                  See if the Ubuntu wiki helps : https://wiki.ubuntu.com/DebuggingApparmor



                  Specifically,




                  When debugging, it may also be useful
                  to put apparmor into 'complain' mode.
                  This will allow your application to
                  function normally while apparmor
                  reports accesses that are not in the
                  profile. To enable 'complain' mode,
                  use:



                  sudo aa-complain /path/to/bin


                  where '/path/to/bin' is the absolute
                  path to the binary, as reported in the
                  'profile=...' portion of the 'audit'
                  entry. Eg:



                  sudo aa-complain /usr/sbin/slapd


                  To re-enable enforcing mode, use
                  'aa-enforce' instead:



                  sudo aa-enforce /path/to/bin


                  To disable a profile:



                  sudo touch /etc/apparmor.d/disable/path.to.bin
                  sudo apparmor_parser -R /etc/apparmor.d/path.to.bin


                  To disable a profile in Ubuntu 10.10 and earlier:



                  sudo touch /etc/apparmor.d/disable/path.to.bin sudo apparmor_parser -R /etc/apparmor.d/path.to.bin



                  in 11.04 and later:



                  sudo aa-disable /etc/apparmor.d/path.to.bin



                  To disable all of AppArmor
                  for testing purposes, boot with apparmor=0 on the kernel command
                  line.







                  share|improve this answer























                    up vote
                    1
                    down vote










                    up vote
                    1
                    down vote









                    See if the Ubuntu wiki helps : https://wiki.ubuntu.com/DebuggingApparmor



                    Specifically,




                    When debugging, it may also be useful
                    to put apparmor into 'complain' mode.
                    This will allow your application to
                    function normally while apparmor
                    reports accesses that are not in the
                    profile. To enable 'complain' mode,
                    use:



                    sudo aa-complain /path/to/bin


                    where '/path/to/bin' is the absolute
                    path to the binary, as reported in the
                    'profile=...' portion of the 'audit'
                    entry. Eg:



                    sudo aa-complain /usr/sbin/slapd


                    To re-enable enforcing mode, use
                    'aa-enforce' instead:



                    sudo aa-enforce /path/to/bin


                    To disable a profile:



                    sudo touch /etc/apparmor.d/disable/path.to.bin
                    sudo apparmor_parser -R /etc/apparmor.d/path.to.bin


                    To disable a profile in Ubuntu 10.10 and earlier:



                    sudo touch /etc/apparmor.d/disable/path.to.bin sudo apparmor_parser -R /etc/apparmor.d/path.to.bin



                    in 11.04 and later:



                    sudo aa-disable /etc/apparmor.d/path.to.bin



                    To disable all of AppArmor
                    for testing purposes, boot with apparmor=0 on the kernel command
                    line.







                    share|improve this answer












                    See if the Ubuntu wiki helps : https://wiki.ubuntu.com/DebuggingApparmor



                    Specifically,




                    When debugging, it may also be useful
                    to put apparmor into 'complain' mode.
                    This will allow your application to
                    function normally while apparmor
                    reports accesses that are not in the
                    profile. To enable 'complain' mode,
                    use:



                    sudo aa-complain /path/to/bin


                    where '/path/to/bin' is the absolute
                    path to the binary, as reported in the
                    'profile=...' portion of the 'audit'
                    entry. Eg:



                    sudo aa-complain /usr/sbin/slapd


                    To re-enable enforcing mode, use
                    'aa-enforce' instead:



                    sudo aa-enforce /path/to/bin


                    To disable a profile:



                    sudo touch /etc/apparmor.d/disable/path.to.bin
                    sudo apparmor_parser -R /etc/apparmor.d/path.to.bin


                    To disable a profile in Ubuntu 10.10 and earlier:



                    sudo touch /etc/apparmor.d/disable/path.to.bin sudo apparmor_parser -R /etc/apparmor.d/path.to.bin



                    in 11.04 and later:



                    sudo aa-disable /etc/apparmor.d/path.to.bin



                    To disable all of AppArmor
                    for testing purposes, boot with apparmor=0 on the kernel command
                    line.








                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Feb 7 '13 at 23:47









                    belacqua

                    15.6k1472103




                    15.6k1472103
























                        up vote
                        0
                        down vote













                        It is an old question, but maybe someone will find it useful.



                        Sometimes pieces of application are split in separate packages. Same goes for apparmor profiles. They are split in packages apparmor-profiles and apparmor-profiles-extra. So, if you have some profiles missing, install apparmor-profiles-extra.






                        share|improve this answer

























                          up vote
                          0
                          down vote













                          It is an old question, but maybe someone will find it useful.



                          Sometimes pieces of application are split in separate packages. Same goes for apparmor profiles. They are split in packages apparmor-profiles and apparmor-profiles-extra. So, if you have some profiles missing, install apparmor-profiles-extra.






                          share|improve this answer























                            up vote
                            0
                            down vote










                            up vote
                            0
                            down vote









                            It is an old question, but maybe someone will find it useful.



                            Sometimes pieces of application are split in separate packages. Same goes for apparmor profiles. They are split in packages apparmor-profiles and apparmor-profiles-extra. So, if you have some profiles missing, install apparmor-profiles-extra.






                            share|improve this answer












                            It is an old question, but maybe someone will find it useful.



                            Sometimes pieces of application are split in separate packages. Same goes for apparmor profiles. They are split in packages apparmor-profiles and apparmor-profiles-extra. So, if you have some profiles missing, install apparmor-profiles-extra.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Jun 18 at 8:02









                            Sergey

                            415




                            415






















                                up vote
                                0
                                down vote













                                You are missing the file abstractions/mysql. This happened to me when I tried to completely remove MySQL before reinstalling it. I fixed this issue by replacing the file with a copy from another server. The contents of my file looks something like this:



                                # ------------------------------------------------------------------
                                #
                                # Copyright (C) 2002-2006 Novell/SUSE
                                # Copyright (C) 2013 Christian Boltz
                                #
                                # This program is free software; you can redistribute it and/or
                                # modify it under the terms of version 2 of the GNU General Public
                                # License published by the Free Software Foundation.
                                #
                                # ------------------------------------------------------------------

                                /var/lib/mysql{,d}/mysql{,d}.sock rw,
                                /{var/,}run/mysql{,d}/mysql{,d}.sock rw,
                                /usr/share/{mysql,mysql-community-server,mariadb}/charsets/ r,
                                /usr/share/{mysql,mysql-community-server,mariadb}/charsets/*.xml r,


                                Try creating the file and adding the above contents with:



                                sudo nano /etc/apparmor.d/abstractions/mysql





                                share|improve this answer








                                New contributor




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






















                                  up vote
                                  0
                                  down vote













                                  You are missing the file abstractions/mysql. This happened to me when I tried to completely remove MySQL before reinstalling it. I fixed this issue by replacing the file with a copy from another server. The contents of my file looks something like this:



                                  # ------------------------------------------------------------------
                                  #
                                  # Copyright (C) 2002-2006 Novell/SUSE
                                  # Copyright (C) 2013 Christian Boltz
                                  #
                                  # This program is free software; you can redistribute it and/or
                                  # modify it under the terms of version 2 of the GNU General Public
                                  # License published by the Free Software Foundation.
                                  #
                                  # ------------------------------------------------------------------

                                  /var/lib/mysql{,d}/mysql{,d}.sock rw,
                                  /{var/,}run/mysql{,d}/mysql{,d}.sock rw,
                                  /usr/share/{mysql,mysql-community-server,mariadb}/charsets/ r,
                                  /usr/share/{mysql,mysql-community-server,mariadb}/charsets/*.xml r,


                                  Try creating the file and adding the above contents with:



                                  sudo nano /etc/apparmor.d/abstractions/mysql





                                  share|improve this answer








                                  New contributor




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




















                                    up vote
                                    0
                                    down vote










                                    up vote
                                    0
                                    down vote









                                    You are missing the file abstractions/mysql. This happened to me when I tried to completely remove MySQL before reinstalling it. I fixed this issue by replacing the file with a copy from another server. The contents of my file looks something like this:



                                    # ------------------------------------------------------------------
                                    #
                                    # Copyright (C) 2002-2006 Novell/SUSE
                                    # Copyright (C) 2013 Christian Boltz
                                    #
                                    # This program is free software; you can redistribute it and/or
                                    # modify it under the terms of version 2 of the GNU General Public
                                    # License published by the Free Software Foundation.
                                    #
                                    # ------------------------------------------------------------------

                                    /var/lib/mysql{,d}/mysql{,d}.sock rw,
                                    /{var/,}run/mysql{,d}/mysql{,d}.sock rw,
                                    /usr/share/{mysql,mysql-community-server,mariadb}/charsets/ r,
                                    /usr/share/{mysql,mysql-community-server,mariadb}/charsets/*.xml r,


                                    Try creating the file and adding the above contents with:



                                    sudo nano /etc/apparmor.d/abstractions/mysql





                                    share|improve this answer








                                    New contributor




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









                                    You are missing the file abstractions/mysql. This happened to me when I tried to completely remove MySQL before reinstalling it. I fixed this issue by replacing the file with a copy from another server. The contents of my file looks something like this:



                                    # ------------------------------------------------------------------
                                    #
                                    # Copyright (C) 2002-2006 Novell/SUSE
                                    # Copyright (C) 2013 Christian Boltz
                                    #
                                    # This program is free software; you can redistribute it and/or
                                    # modify it under the terms of version 2 of the GNU General Public
                                    # License published by the Free Software Foundation.
                                    #
                                    # ------------------------------------------------------------------

                                    /var/lib/mysql{,d}/mysql{,d}.sock rw,
                                    /{var/,}run/mysql{,d}/mysql{,d}.sock rw,
                                    /usr/share/{mysql,mysql-community-server,mariadb}/charsets/ r,
                                    /usr/share/{mysql,mysql-community-server,mariadb}/charsets/*.xml r,


                                    Try creating the file and adding the above contents with:



                                    sudo nano /etc/apparmor.d/abstractions/mysql






                                    share|improve this answer








                                    New contributor




                                    user2395126 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




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









                                    answered Dec 7 at 14:43









                                    user2395126

                                    1011




                                    1011




                                    New contributor




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





                                    New contributor





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






                                    user2395126 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.





                                        Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                                        Please pay close attention to the following guidance:


                                        • 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%2f252340%2fhow-to-fix-apparmor-could-not-open-error-when-installing-phpmysql%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

                                        數位音樂下載

                                        When can things happen in Etherscan, such as the picture below?

                                        格利澤436b