Public bug reported: On Ubuntu 16.04.6 LTS, after apt purge mysql-server* then apt install mysql-server the intallation fails because the AppArmor profile is incomplete. Booting with kernel command line parameter apparmor=0 allows successful install.
Running aa-logprof shows that the pid file is not in the profile based on the following output: Profile: /usr/sbin/mysqld Path: /run/mysqld/mysql.pid Mode: rw Severity: unknown [1 - /run/mysqld/mysql.pid] [(A)llow] / (D)eny / (I)gnore / (G)lob / Glob with (E)xtension / (N)ew / Abo(r)t / (F)inish / (M)ore Adding /run/mysqld/mysql.pid rw to profile Debugging info: cat /etc/issue Ubuntu 16.04.6 LTS \n \l --- apt-cache policy mysql-server* mysql-server-5.0: Installed: (none) Candidate: (none) Version table: mysql-server-5.1: Installed: (none) Candidate: (none) Version table: mysql-server-5.5: Installed: (none) Candidate: (none) Version table: mysql-server-5.6: Installed: (none) Candidate: (none) Version table: mysql-server-5.7: Installed: 5.7.25-0ubuntu0.16.04.2 Candidate: 5.7.25-0ubuntu0.16.04.2 Version table: *** 5.7.25-0ubuntu0.16.04.2 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages 100 /var/lib/dpkg/status 5.7.11-0ubuntu6 500 500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages mysql-server: Installed: 5.7.25-0ubuntu0.16.04.2 Candidate: 5.7.25-0ubuntu0.16.04.2 Version table: *** 5.7.25-0ubuntu0.16.04.2 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages 100 /var/lib/dpkg/status 5.7.11-0ubuntu6 500 500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages 500 http://us.archive.ubuntu.com/ubuntu xenial/main i386 Packages mysql-server-core-5.1: Installed: (none) Candidate: (none) Version table: mysql-server-core-5.5: Installed: (none) Candidate: (none) Version table: mysql-server-core-5.6: Installed: (none) Candidate: (none) Version table: mysql-server-core-5.7: Installed: 5.7.25-0ubuntu0.16.04.2 Candidate: 5.7.25-0ubuntu0.16.04.2 Version table: *** 5.7.25-0ubuntu0.16.04.2 500 500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 500 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages 100 /var/lib/dpkg/status 5.7.11-0ubuntu6 500 500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages ** This system was upgraded from 14.04 using do-upgrade-release ** ** Affects: mysql-5.7 (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1825246 Title: Mysql 5.7 mysql.pid Apparmor Denial To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1825246/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs