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












4














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





























    4














    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



























      4












      4








      4







      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 Ellouze Anis

      164126




      164126






















          3 Answers
          3






          active

          oldest

          votes


















          1














          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





























            0














            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





























              0














              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





















                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%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









                1














                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


























                  1














                  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
























                    1












                    1








                    1






                    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









                    belacquabelacqua

                    15.7k1472103




                    15.7k1472103

























                        0














                        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


























                          0














                          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
























                            0












                            0








                            0






                            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 '18 at 8:02









                            SergeySergey

                            416




                            416























                                0














                                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


























                                  0














                                  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
























                                    0












                                    0








                                    0






                                    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












                                    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












                                    share|improve this answer



                                    share|improve this answer










                                    answered Dec 7 '18 at 14:43









                                    user2395126user2395126

                                    1011




                                    1011






























                                        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%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

                                        Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

                                        ComboBox Display Member on multiple fields

                                        Is it possible to collect Nectar points via Trainline?