**Description of the bug**
Seen in the logs from https://bugs.launchpad.net/u…buntu/+source/ubuntu-advantage-tools/+bug/2067728:
```
May 31 18:00:17 loky kernel: audit: type=1400 audit(1717158617.647:261): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8510 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:17 loky kernel: audit: type=1400 audit(1717158617.678:262): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8511 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:17 loky kernel: audit: type=1400 audit(1717158617.680:263): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8512 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:17 loky kernel: audit: type=1400 audit(1717158617.683:264): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8513 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:18 loky kernel: audit: type=1400 audit(1717158618.556:265): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8712 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:18 loky kernel: audit: type=1400 audit(1717158618.601:266): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8714 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:18 loky kernel: audit: type=1400 audit(1717158618.603:267): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8715 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:18 loky kernel: audit: type=1400 audit(1717158618.607:268): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8720 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
May 31 18:00:18 loky kernel: audit: type=1400 audit(1717158618.622:269): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache//dpkg" name="/var/lib/dpkg/arch" pid=8725 comm="dpkg" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
```
Unsure if that's the cause of the LP bug, though, as the ua logs also show errors contacting the contract server (timeouts).
The journal logs at those times are fine:
```
May 31 18:00:17.176632 loky systemd[1]: Starting apt-news.service - Update APT News...
May 31 18:00:17.184741 loky systemd[1]: Starting esm-cache.service - Update the local ESM caches...
May 31 18:00:17.370505 loky systemd[1]: apt-news.service: Deactivated successfully.
May 31 18:00:17.370797 loky systemd[1]: Finished apt-news.service - Update APT News.
May 31 18:00:18.673192 loky systemd[1]: esm-cache.service: Deactivated successfully.
May 31 18:00:18.673539 loky systemd[1]: Finished esm-cache.service - Update the local ESM caches.
May 31 18:00:18.673778 loky systemd[1]: esm-cache.service: Consumed 1.385s CPU time.
May 31 18:05:58.552545 loky systemd[1]: Starting ua-timer.service - Ubuntu Pro Timer for running repeated jobs...
May 31 18:05:58.739150 loky systemd[1]: ua-timer.service: Deactivated successfully.
May 31 18:05:58.739422 loky systemd[1]: Finished ua-timer.service - Ubuntu Pro Timer for running repeated jobs.
```
Incidentally, looks like apport is trying to report the version of the ubuntu-advantage-tools *package*, but it should also check ubuntu-pro-client.
**Expected behavior**
No apparmor denied errors.
**Current behavior**
For some unknown operation, the pro client on that system is triggering dpkg apparmor denied errors. We haven't seen those in our testing.
in uaclient/system.py, we have get_dpkg_arch() which calls `dpkg --print-architecture`, and that works just fine with the current apparmor profile:
```
# aa-exec -p ubuntu_pro_esm_cache//dpkg dpkg --print-architecture
amd64
```
And strace confirms that that command does not touch /var/lib/dpkg:
```
# strace -f dpkg --print-architecture 2>&1|grep open
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libmd.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libselinux.so.1", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpcre2-8.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/filesystems", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/etc/dpkg/dpkg.cfg.d", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
openat(AT_FDCWD, "/etc/dpkg/dpkg.cfg", O_RDONLY) = 3
openat(AT_FDCWD, "/root/.dpkg.cfg", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/locale.alias", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/en_US.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/en_US.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/en_US/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/en.UTF-8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/en.utf8/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale-langpack/en/LC_MESSAGES/dpkg.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
```
**To Reproduce**
Unknown at the moment.
**System information:**
- Ubuntu release: jammy
- Pro Client version: 32.3
**Additional context**
Add any other context about the problem here.