prompt: 
  We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [feature] Add support for Pop!_OS to package_manager
  ### What is your suggestion?
  
  [Pop!_OS](https://pop.system76.com/) is an Ubuntu-based Linux distribution. It would be great if it could be added to the list of distributions that support `apt-get`. Its `distro.id()` is `pop`.
  
  ### Have you read the CONTRIBUTING guide?
  
  - [X] I've read the CONTRIBUTING guide
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  
  --- BEGIN FILE ---
  ```
  ### conan/tools/system/package_manager.py
  import platform
  
  from conan.tools.build import cross_building
  from conans.client.graph.graph import CONTEXT_BUILD
  from conan.errors import ConanException
  
  
  class _SystemPackageManagerTool(object):
      mode_check = "check"  # Check if installed, fail if not
      mode_install = "install"
      mode_report = "report"  # Only report what would be installed, no check (can run in any system)
      mode_report_installed = "report-installed"  # report installed and missing packages
      tool_name = None
      install_command = ""
      update_command = ""
      check_command = ""
      accepted_install_codes = [0]
      accepted_update_codes = [0]
      accepted_check_codes = [0, 1]
  
      def __init__(self, conanfile):
          """
          :param conanfile: The current recipe object. Always use ``self``.
          """
          self._conanfile = conanfile
          self._active_tool = self._conanfile.conf.get("tools.system.package_manager:tool", default=self.get_default_tool())
          self._sudo = self._conanfile.conf.get("tools.system.package_manager:sudo", default=False, check_type=bool)
          self._sudo_askpass = self._conanfile.conf.get("tools.system.package_manager:sudo_askpass", default=False, check_type=bool)
          self._mode = self._conanfile.conf.get("tools.system.package_manager:mode", default=self.mode_check)
          self._arch = self._conanfile.settings_build.get_safe('arch') \
              if self._conanfile.context == CONTEXT_BUILD else self._conanfile.settings.get_safe('arch')
          self._arch_names = {}
          self._arch_separator = ""
  
      def get_default_tool(self):
          os_name = platform.system()
          if os_name in ["Linux", "FreeBSD"]:
              import distro
              os_name = distro.id() or os_name
          elif os_name == "Windows" and self._conanfile.conf.get("tools.microsoft.bash:subsystem") == "msys2":
              os_name = "msys2"
          manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint", 'astra', 'elbrus', 'altlinux'],
                             "apk": ["alpine"],
                             "yum": ["pidora", "scientific", "xenserver", "amazon", "oracle", "amzn",
                                     "almalinux", "rocky"],
                             "dnf": ["fedora", "rhel", "centos", "mageia", "nobara"],
                             "brew": ["Darwin"],
                             "pacman": ["arch", "manjaro", "msys2", "endeavouros"],
                             "choco": ["Windows"],
                             "zypper": ["opensuse", "sles"],
                             "pkg": ["freebsd"],
                             "pkgutil": ["Solaris"]}
          # first check exact match of name
          for tool, distros in manager_mapping.items():
              if os_name in distros:
                  return tool
          # in case we did not detect any exact match, check
          # if the name is contained inside the returned distro name
          # like for opensuse, that can have opensuse-version names
          for tool, distros in manager_mapping.items():
              for d in distros:
                  if d in os_name:
                      return tool
                  
          # No default package manager was found for the system,
          # so notify the user
          self._conanfile.output.info("A default system package manager couldn't be found for {}, "
                                      "system packages will not be installed.".format(os_name))
  
      def get_package_name(self, package, host_package=True):
          # Only if the package is for building, for example a library,
          # we should add the host arch when cross building.
          # If the package is a tool that should be installed on the current build
          # machine we should not add the arch.
          if self._arch in self._arch_names and cross_building(self._conanfile) and host_package:
              return "{}{}{}".format(package, self._arch_separator,
                                     self._arch_names.get(self._arch))
          return package
  
      @property
      def sudo_str(self):
          sudo = "sudo " if self._sudo else ""
          askpass = "-A " if self._sudo and self._sudo_askpass else ""
          return "{}{}".format(sudo, askpass)
  
      def run(self, method, *args, **kwargs):
          if self._active_tool == self.__class__.tool_name:
              return method(*args, **kwargs)
  
      def _conanfile_run(self, command, accepted_returns):
          # When checking multiple packages, this is too noisy
          ret = self._conanfile.run(command, ignore_errors=True, quiet=True)
          if ret not in accepted_returns:
              raise ConanException("Command '%s' failed" % command)
          return ret
  
      def install_substitutes(self, *args, **kwargs):
          """
          Will try to call the install() method with  several lists of packages passed as a
          variable number of parameters. This is useful if, for example, the names of the
          packages are different from one distro or distro version to another. For example,
          ``libxcb`` for ``Apt`` is named ``libxcb-util-dev`` in Ubuntu >= 15.0 and ``libxcb-util0-dev``
          for other versions. You can call to:
  
             .. code-block:: python
  
              # will install the first list of packages that succeeds in the installation
              Apt.install_substitutes(["libxcb-util-dev"], ["libxcb-util0-dev"])
  
          :param packages_alternatives: try to install the list of packages passed as a parameter.
          :param update: try to update the package manager database before checking and installing.
          :param check: check if the packages are already installed before installing them.
          :return: the return code of the executed package manager command.
          """
          return self.run(self._install_substitutes, *args, **kwargs)
  
      def install(self, *args, **kwargs):
          """
          Will try to install the list of packages passed as a parameter. Its
          behaviour is affected by the value of ``tools.system.package_manager:mode``
          :ref:`configuration<conan_tools_system_package_manager_config>`.
  
          :param packages: try to install the list of packages passed as a parameter.
          :param update: try to update the package manager database before checking and installing.
          :param check: check if the packages are already installed before installing them.
          :return: the return code of the executed package manager command.
          """
          return self.run(self._install, *args, **kwargs)
  
      def update(self, *args, **kwargs):
          """
          Update the system package manager database. Its behaviour is affected by
          the value of ``tools.system.package_manager:mode``
          :ref:`configuration<conan_tools_system_package_manager_config>`.
  
          :return: the return code of the executed package manager update command.
          """
          return self.run(self._update, *args, **kwargs)
  
      def check(self, *args, **kwargs):
          """
          Check if the list of packages passed as parameter are already installed.
  
          :param packages: list of packages to check.
          :return: list of packages from the packages argument that are not installed in the system.
          """
          return self.run(self._check, *args, **kwargs)
  
      def _install_substitutes(self, *packages_substitutes, update=False, check=True, **kwargs):
          errors = []
          for packages in packages_substitutes:
              try:
                  return self.install(packages, update, check, **kwargs)
              except ConanException as e:
                  errors.append(e)
  
          for error in errors:
              self._conanfile.output.warning(str(error))
          raise ConanException("None of the installs for the package substitutes succeeded.")
  
      def _install(self, packages, update=False, check=True, host_package=True, **kwargs):
          pkgs = self._conanfile.system_requires.setdefault(self._active_tool, {})
          install_pkgs = pkgs.setdefault("install", [])
          install_pkgs.extend(p for p in packages if p not in install_pkgs)
          if self._mode == self.mode_report:
              return
  
          if check or self._mode in (self.mode_check, self.mode_report_installed):
              packages = self.check(packages, host_package=host_package)
              missing_pkgs = pkgs.setdefault("missing", [])
              missing_pkgs.extend(p for p in packages if p not in missing_pkgs)
  
          if self._mode == self.mode_report_installed:
              return
  
          if self._mode == self.mode_check and packages:
              raise ConanException("System requirements: '{0}' are missing but can't install "
                                   "because tools.system.package_manager:mode is '{1}'."
                                   "Please update packages manually or set "
                                   "'tools.system.package_manager:mode' "
                                   "to '{2}' in the [conf] section of the profile, "
                                   "or in the command line using "
                                   "'-c tools.system.package_manager:mode={2}'".format(", ".join(packages),
                                                                                       self.mode_check,
                                                                                       self.mode_install))
          elif packages:
              if update:
                  self.update()
  
              packages_arch = [self.get_package_name(package, host_package=host_package) for package in packages]
              if packages_arch:
                  command = self.install_command.format(sudo=self.sudo_str,
                                                        tool=self.tool_name,
                                                        packages=" ".join(packages_arch),
                                                        **kwargs)
                  return self._conanfile_run(command, self.accepted_install_codes)
          else:
              self._conanfile.output.info("System requirements: {} already "
                                          "installed".format(" ".join(packages)))
  
      def _update(self):
          # we just update the package manager database in case we are in 'install mode'
          # in case we are in check mode just ignore
          if self._mode == self.mode_install:
              command = self.update_command.format(sudo=self.sudo_str, tool=self.tool_name)
              return self._conanfile_run(command, self.accepted_update_codes)
  
      def _check(self, packages, host_package=True):
          missing = [pkg for pkg in packages if self.check_package(self.get_package_name(pkg, host_package=host_package)) != 0]
          return missing
  
      def check_package(self, package):
          command = self.check_command.format(tool=self.tool_name,
                                              package=package)
          return self._conanfile_run(command, self.accepted_check_codes)
  
  
  class Apt(_SystemPackageManagerTool):
      # TODO: apt? apt-get?
      tool_name = "apt-get"
      install_command = "{sudo}{tool} install -y {recommends}{packages}"
      update_command = "{sudo}{tool} update"
      check_command = "dpkg-query -W -f='${{Status}}' {package} | grep -q \"ok installed\""
  
      def __init__(self, conanfile, arch_names=None):
          """
          :param conanfile: The current recipe object. Always use ``self``.
          :param arch_names: This argument maps the Conan architecture setting with the package manager
                             tool architecture names. It is ``None`` by default, which means that it will use a
                             default mapping for the most common architectures. For example, if you are using
                             ``x86_64`` Conan architecture setting, it will map this value to ``amd64`` for *Apt* and
                             try to install the ``<package_name>:amd64`` package.
          """
          super(Apt, self).__init__(conanfile)
          self._arch_names = {"x86_64": "amd64",
                              "x86": "i386",
                              "ppc32": "powerpc",
                              "ppc64le": "ppc64el",
                              "armv7": "arm",
                              "armv7hf": "armhf",
                              "armv8": "arm64",
                              "s390x": "s390x"} if arch_names is None else arch_names
  
          self._arch_separator = ":"
  
      def install(self, packages, update=False, check=True, recommends=False, host_package=True):
          """
          Will try to install the list of packages passed as a parameter. Its
          behaviour is affected by the value of ``tools.system.package_manager:mode``
          :ref:`configuration<conan_tools_system_package_manager_config>`.
  
          :param packages: try to install the list of packages passed as a parameter.
          :param update: try to update the package manager database before checking and installing.
          :param check: check if the packages are already installed before installing them.
          :param host_package: install the packages for the host machine architecture (the machine
                 that will run the software), it has an effect when cross building.
          :param recommends: if the parameter ``recommends`` is ``False`` it will add the
                 ``'--no-install-recommends'`` argument to the *apt-get* command call.
          :return: the return code of the executed apt command.
          """
          recommends_str = '' if recommends else '--no-install-recommends '
          return super(Apt, self).install(packages, update=update, check=check,
                                          host_package=host_package, recommends=recommends_str)
  
  
  class Yum(_SystemPackageManagerTool):
      tool_name = "yum"
      install_command = "{sudo}{tool} install -y {packages}"
      update_command = "{sudo}{tool} check-update -y"
      check_command = "rpm -q {package}"
      accepted_update_codes = [0, 100]
  
      def __init__(self, conanfile, arch_names=None):
          """
          :param conanfile: the current recipe object. Always use ``self``.
          :param arch_names: this argument maps the Conan architecture setting with the package manager
                             tool architecture names. It is ``None`` by default, which means that it will use a
                             default mapping for the most common architectures. For example, if you are using
                             ``x86`` Conan architecture setting, it will map this value to ``i?86`` for *Yum* and
                             try to install the ``<package_name>.i?86`` package.
          """
          super(Yum, self).__init__(conanfile)
          self._arch_names = {"x86_64": "x86_64",
                              "x86": "i?86",
                              "ppc32": "powerpc",
                              "ppc64le": "ppc64le",
                              "armv7": "armv7",
                              "armv7hf": "armv7hl",
                              "armv8": "aarch64",
                              "s390x": "s390x"} if arch_names is None else arch_names
          self._arch_separator = "."
  
  
  class Dnf(Yum):
      tool_name = "dnf"
  
  
  class Brew(_SystemPackageManagerTool):
      tool_name = "brew"
      install_command = "{sudo}{tool} install {packages}"
      update_command = "{sudo}{tool} update"
      check_command = 'test -n "$({tool} ls --versions {package})"'
  
  
  class Pkg(_SystemPackageManagerTool):
      tool_name = "pkg"
      install_command = "{sudo}{tool} install -y {packages}"
      update_command = "{sudo}{tool} update"
      check_command = "{tool} info {package}"
  
  
  class PkgUtil(_SystemPackageManagerTool):
      tool_name = "pkgutil"
      install_command = "{sudo}{tool} --install --yes {packages}"
      update_command = "{sudo}{tool} --catalog"
      check_command = 'test -n "`{tool} --list {package}`"'
  
  
  class Chocolatey(_SystemPackageManagerTool):
      tool_name = "choco"
      install_command = "{tool} install --yes {packages}"
      update_command = "{tool} outdated"
      check_command = '{tool} search --local-only --exact {package} | ' \
                      'findstr /c:"1 packages installed."'
  
  
  class PacMan(_SystemPackageManagerTool):
      tool_name = "pacman"
      install_command = "{sudo}{tool} -S --noconfirm {packages}"
      update_command = "{sudo}{tool} -Syyu --noconfirm"
      check_command = "{tool} -Qi {package}"
  
      def __init__(self, conanfile, arch_names=None):
          """
          :param conanfile: the current recipe object. Always use ``self``.
          :param arch_names: this argument maps the Conan architecture setting with the package manager
                             tool architecture names. It is ``None`` by default, which means that it will use a
                             default mapping for the most common architectures. If you are using
                             ``x86`` Conan architecture setting, it will map this value to ``lib32`` for *PacMan* and
                             try to install the ``<package_name>-lib32`` package.
          """
          super(PacMan, self).__init__(conanfile)
          self._arch_names = {"x86": "lib32"} if arch_names is None else arch_names
          self._arch_separator = "-"
  
  
  class Apk(_SystemPackageManagerTool):
      tool_name = "apk"
      install_command = "{sudo}{tool} add --no-cache {packages}"
      update_command = "{sudo}{tool} update"
      check_command = "{tool} info -e {package}"
  
      def __init__(self, conanfile, _arch_names=None):
          """
          Constructor method.
          Note that *Apk* does not support architecture names since Alpine Linux does not support
          multiarch. Therefore, the ``arch_names`` argument is ignored.
  
          :param conanfile: the current recipe object. Always use ``self``.
          """
          super(Apk, self).__init__(conanfile)
          self._arch_names = {}
          self._arch_separator = ""
  
  
  class Zypper(_SystemPackageManagerTool):
      tool_name = "zypper"
      install_command = "{sudo}{tool} --non-interactive in {packages}"
      update_command = "{sudo}{tool} --non-interactive ref"
      check_command = "rpm -q {package}"
  
  ```
  --- END FILE ---
  
  Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.
  
  Every *SEARCH/REPLACE* edit must use this format:
  1. The file path
  2. The start of search block: <<<<<<< SEARCH
  3. A contiguous chunk of lines to search for in the existing source code
  4. The dividing line: =======
  5. The lines to replace into the source code
  6. The end of the replace block: >>>>>>> REPLACE
  
  Here is an example:
  
  ```python
  ### mathweb/flask/app.py
  <<<<<<< SEARCH
  from flask import Flask
  =======
  import math
  from flask import Flask
  >>>>>>> REPLACE
  ```
  
  Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
  Wrap the *SEARCH/REPLACE* edit in blocks ```python...```.
  
instance: {"FAIL_TO_PASS": ["conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[pop-apt-get]"], "PASS_TO_PASS": ["conans/test/integration/tools/system/package_manager_test.py::test_apt_install_recommends[True-]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Dnf-rpm", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[opensuse-tumbleweed-zypper]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[PkgUtil-x86_64-pkgutil", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[elbrus-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Pkg-pkg", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_platform[Solaris-pkgutil]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[arch-pacman]", "conans/test/integration/tools/system/package_manager_test.py::test_dnf_yum_return_code_100[Yum-yum", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Dnf-x86-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[fedora-dnf]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Zypper-rpm", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Yum-yum", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[pidora-yum]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Dnf-x86_64-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Yum-x86_64-yum", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[altlinux-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Zypper-x86-zypper", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Yum-rpm", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[PacMan-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Chocolatey-choco", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[PkgUtil-x86-pkgutil", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[astra-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Apk-apk", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Chocolatey-x86-choco", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_platform[Linux-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Chocolatey-choco", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Brew-x86_64-brew", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[freebsd-pkg]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Pkg]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Brew-x86-brew", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Apt-x86_64-apt-get", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Apk]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Pkg-x86_64-pkg", "conans/test/integration/tools/system/package_manager_test.py::test_sudo_str[False-True-]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Dnf-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Zypper-zypper", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[PacMan-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_platform[Darwin-brew]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_platform[Windows-choco]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Apk-apk", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_archless[Yum-yum", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Yum-x86-yum", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Zypper-x86-zypper", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_archless[Apt-apt-get", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Apk-x86_64-apk", "conans/test/integration/tools/system/package_manager_test.py::test_sudo_str[False-False-]", "conans/test/integration/tools/system/package_manager_test.py::test_apt_install_recommends[False---no-install-recommends", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Brew-x86-brew", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Chocolatey-x86_64-choco", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[PkgUtil]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[PacMan]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Brew-x86_64-brew", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[sles-zypper]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[ubuntu-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[PkgUtil-pkgutil", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Yum-x86-yum", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Yum-x86_64-yum", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[PacMan-x86-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Yum]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[nobara-dnf]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[opensuse-leap-zypper]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Apt-x86-apt-get", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Zypper-x86_64-zypper", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Brew-brew", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Zypper]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Pkg-x86-pkg", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Chocolatey-x86_64-choco", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Brew-test", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[PkgUtil-x86_64-pkgutil", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Zypper-x86_64-zypper", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[PacMan-x86-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Apk-x86_64-apk", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Brew]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[opensuse-next_version-zypper]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Pkg-pkg", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Chocolatey]", "conans/test/integration/tools/system/package_manager_test.py::test_sudo_str[True-False-sudo", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[opensuse-zypper1]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_update_mode_install[Apt-apt-get", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Pkg-x86_64-pkg", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[debian-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Pkg-x86-pkg", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[Apt-dpkg-query", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Dnf-x86-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[linuxmint-apt-get]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Apt]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Chocolatey-x86-choco", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[PacMan-x86_64-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Apt-x86-apt-get", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_archless[PacMan-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_to_build_machine_arch[Dnf-x86_64-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[PkgUtil-x86-pkgutil", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_archless[Dnf-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[PacMan-x86_64-pacman", "conans/test/integration/tools/system/package_manager_test.py::test_dnf_yum_return_code_100[Dnf-dnf", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_check[Dnf]", "conans/test/integration/tools/system/package_manager_test.py::test_tools_install_mode_install_different_archs[Apt-x86_64-apt-get", "conans/test/integration/tools/system/package_manager_test.py::test_sudo_str[True-True-sudo", "conans/test/integration/tools/system/package_manager_test.py::test_tools_check[PkgUtil-test", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[rocky-yum]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[opensuse-zypper0]", "conans/test/integration/tools/system/package_manager_test.py::test_package_manager_distro[alpine-apk]"], "base_commit": "937bfcc6385ab88384d13fd7aca325386ad31b97", "created_at": "2024-03-22T16:40:29Z", "hints_text": "Sure, thanks for the suggestion @jwillikers \r\n\r\nThat should be an easy one, do you want to submit the contribution yourself?\nI can do that.", "instance_id": "conan-io__conan-15931", "patch": "diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py\n--- a/conan/tools/system/package_manager.py\n+++ b/conan/tools/system/package_manager.py\n@@ -39,7 +39,7 @@ def get_default_tool(self):\n             os_name = distro.id() or os_name\n         elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n             os_name = \"msys2\"\n-        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],\n+        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux', 'pop'],\n                            \"apk\": [\"alpine\"],\n                            \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                    \"almalinux\", \"rocky\"],\n@@ -61,7 +61,7 @@ def get_default_tool(self):\n             for d in distros:\n                 if d in os_name:\n                     return tool\n-                \n+\n         # No default package manager was found for the system,\n         # so notify the user\n         self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \"\n", "problem_statement": "[feature] Add support for Pop!_OS to package_manager\n### What is your suggestion?\r\n\r\n[Pop!_OS](https://pop.system76.com/) is an Ubuntu-based Linux distribution. It would be great if it could be added to the list of distributions that support `apt-get`. Its `distro.id()` is `pop`.\r\n\r\n### Have you read the CONTRIBUTING guide?\r\n\r\n- [X] I've read the CONTRIBUTING guide\n", "repo": "conan-io/conan", "test_patch": "diff --git a/conans/test/integration/tools/system/package_manager_test.py b/conans/test/integration/tools/system/package_manager_test.py\n--- a/conans/test/integration/tools/system/package_manager_test.py\n+++ b/conans/test/integration/tools/system/package_manager_test.py\n@@ -62,6 +62,7 @@ def test_msys2():\n     ('altlinux', \"apt-get\"),\n     (\"astra\", 'apt-get'),\n     ('elbrus', 'apt-get'),\n+    ('pop', \"apt-get\"),\n ])\n @pytest.mark.skipif(platform.system() != \"Linux\", reason=\"Only linux\")\n def test_package_manager_distro(distro, tool):\n", "version": "2.3"}
parsed_commit_content: {"file_diffs":[{"old_file_content":"import platform\n\nfrom conan.tools.build import cross_building\nfrom conans.client.graph.graph import CONTEXT_BUILD\nfrom conan.errors import ConanException\n\n\nclass _SystemPackageManagerTool(object):\n    mode_check = \"check\"  # Check if installed, fail if not\n    mode_install = \"install\"\n    mode_report = \"report\"  # Only report what would be installed, no check (can run in any system)\n    mode_report_installed = \"report-installed\"  # report installed and missing packages\n    tool_name = None\n    install_command = \"\"\n    update_command = \"\"\n    check_command = \"\"\n    accepted_install_codes = [0]\n    accepted_update_codes = [0]\n    accepted_check_codes = [0, 1]\n\n    def __init__(self, conanfile):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        \"\"\"\n        self._conanfile = conanfile\n        self._active_tool = self._conanfile.conf.get(\"tools.system.package_manager:tool\", default=self.get_default_tool())\n        self._sudo = self._conanfile.conf.get(\"tools.system.package_manager:sudo\", default=False, check_type=bool)\n        self._sudo_askpass = self._conanfile.conf.get(\"tools.system.package_manager:sudo_askpass\", default=False, check_type=bool)\n        self._mode = self._conanfile.conf.get(\"tools.system.package_manager:mode\", default=self.mode_check)\n        self._arch = self._conanfile.settings_build.get_safe('arch') \\\n            if self._conanfile.context == CONTEXT_BUILD else self._conanfile.settings.get_safe('arch')\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n    def get_default_tool(self):\n        os_name = platform.system()\n        if os_name in [\"Linux\", \"FreeBSD\"]:\n            import distro\n            os_name = distro.id() or os_name\n        elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n            os_name = \"msys2\"\n        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],\n                           \"apk\": [\"alpine\"],\n                           \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                   \"almalinux\", \"rocky\"],\n                           \"dnf\": [\"fedora\", \"rhel\", \"centos\", \"mageia\", \"nobara\"],\n                           \"brew\": [\"Darwin\"],\n                           \"pacman\": [\"arch\", \"manjaro\", \"msys2\", \"endeavouros\"],\n                           \"choco\": [\"Windows\"],\n                           \"zypper\": [\"opensuse\", \"sles\"],\n                           \"pkg\": [\"freebsd\"],\n                           \"pkgutil\": [\"Solaris\"]}\n        # first check exact match of name\n        for tool, distros in manager_mapping.items():\n            if os_name in distros:\n                return tool\n        # in case we did not detect any exact match, check\n        # if the name is contained inside the returned distro name\n        # like for opensuse, that can have opensuse-version names\n        for tool, distros in manager_mapping.items():\n            for d in distros:\n                if d in os_name:\n                    return tool\n                \n        # No default package manager was found for the system,\n        # so notify the user\n        self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \"\n                                    \"system packages will not be installed.\".format(os_name))\n\n    def get_package_name(self, package, host_package=True):\n        # Only if the package is for building, for example a library,\n        # we should add the host arch when cross building.\n        # If the package is a tool that should be installed on the current build\n        # machine we should not add the arch.\n        if self._arch in self._arch_names and cross_building(self._conanfile) and host_package:\n            return \"{}{}{}\".format(package, self._arch_separator,\n                                   self._arch_names.get(self._arch))\n        return package\n\n    @property\n    def sudo_str(self):\n        sudo = \"sudo \" if self._sudo else \"\"\n        askpass = \"-A \" if self._sudo and self._sudo_askpass else \"\"\n        return \"{}{}\".format(sudo, askpass)\n\n    def run(self, method, *args, **kwargs):\n        if self._active_tool == self.__class__.tool_name:\n            return method(*args, **kwargs)\n\n    def _conanfile_run(self, command, accepted_returns):\n        # When checking multiple packages, this is too noisy\n        ret = self._conanfile.run(command, ignore_errors=True, quiet=True)\n        if ret not in accepted_returns:\n            raise ConanException(\"Command '%s' failed\" % command)\n        return ret\n\n    def install_substitutes(self, *args, **kwargs):\n        \"\"\"\n        Will try to call the install() method with  several lists of packages passed as a\n        variable number of parameters. This is useful if, for example, the names of the\n        packages are different from one distro or distro version to another. For example,\n        ``libxcb`` for ``Apt`` is named ``libxcb-util-dev`` in Ubuntu >= 15.0 and ``libxcb-util0-dev``\n        for other versions. You can call to:\n\n           .. code-block:: python\n\n            # will install the first list of packages that succeeds in the installation\n            Apt.install_substitutes([\"libxcb-util-dev\"], [\"libxcb-util0-dev\"])\n\n        :param packages_alternatives: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install_substitutes, *args, **kwargs)\n\n    def install(self, *args, **kwargs):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install, *args, **kwargs)\n\n    def update(self, *args, **kwargs):\n        \"\"\"\n        Update the system package manager database. Its behaviour is affected by\n        the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :return: the return code of the executed package manager update command.\n        \"\"\"\n        return self.run(self._update, *args, **kwargs)\n\n    def check(self, *args, **kwargs):\n        \"\"\"\n        Check if the list of packages passed as parameter are already installed.\n\n        :param packages: list of packages to check.\n        :return: list of packages from the packages argument that are not installed in the system.\n        \"\"\"\n        return self.run(self._check, *args, **kwargs)\n\n    def _install_substitutes(self, *packages_substitutes, update=False, check=True, **kwargs):\n        errors = []\n        for packages in packages_substitutes:\n            try:\n                return self.install(packages, update, check, **kwargs)\n            except ConanException as e:\n                errors.append(e)\n\n        for error in errors:\n            self._conanfile.output.warning(str(error))\n        raise ConanException(\"None of the installs for the package substitutes succeeded.\")\n\n    def _install(self, packages, update=False, check=True, host_package=True, **kwargs):\n        pkgs = self._conanfile.system_requires.setdefault(self._active_tool, {})\n        install_pkgs = pkgs.setdefault(\"install\", [])\n        install_pkgs.extend(p for p in packages if p not in install_pkgs)\n        if self._mode == self.mode_report:\n            return\n\n        if check or self._mode in (self.mode_check, self.mode_report_installed):\n            packages = self.check(packages, host_package=host_package)\n            missing_pkgs = pkgs.setdefault(\"missing\", [])\n            missing_pkgs.extend(p for p in packages if p not in missing_pkgs)\n\n        if self._mode == self.mode_report_installed:\n            return\n\n        if self._mode == self.mode_check and packages:\n            raise ConanException(\"System requirements: '{0}' are missing but can't install \"\n                                 \"because tools.system.package_manager:mode is '{1}'.\"\n                                 \"Please update packages manually or set \"\n                                 \"'tools.system.package_manager:mode' \"\n                                 \"to '{2}' in the [conf] section of the profile, \"\n                                 \"or in the command line using \"\n                                 \"'-c tools.system.package_manager:mode={2}'\".format(\", \".join(packages),\n                                                                                     self.mode_check,\n                                                                                     self.mode_install))\n        elif packages:\n            if update:\n                self.update()\n\n            packages_arch = [self.get_package_name(package, host_package=host_package) for package in packages]\n            if packages_arch:\n                command = self.install_command.format(sudo=self.sudo_str,\n                                                      tool=self.tool_name,\n                                                      packages=\" \".join(packages_arch),\n                                                      **kwargs)\n                return self._conanfile_run(command, self.accepted_install_codes)\n        else:\n            self._conanfile.output.info(\"System requirements: {} already \"\n                                        \"installed\".format(\" \".join(packages)))\n\n    def _update(self):\n        # we just update the package manager database in case we are in 'install mode'\n        # in case we are in check mode just ignore\n        if self._mode == self.mode_install:\n            command = self.update_command.format(sudo=self.sudo_str, tool=self.tool_name)\n            return self._conanfile_run(command, self.accepted_update_codes)\n\n    def _check(self, packages, host_package=True):\n        missing = [pkg for pkg in packages if self.check_package(self.get_package_name(pkg, host_package=host_package)) != 0]\n        return missing\n\n    def check_package(self, package):\n        command = self.check_command.format(tool=self.tool_name,\n                                            package=package)\n        return self._conanfile_run(command, self.accepted_check_codes)\n\n\nclass Apt(_SystemPackageManagerTool):\n    # TODO: apt? apt-get?\n    tool_name = \"apt-get\"\n    install_command = \"{sudo}{tool} install -y {recommends}{packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"dpkg-query -W -f='${{Status}}' {package} | grep -q \\\"ok installed\\\"\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        :param arch_names: This argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86_64`` Conan architecture setting, it will map this value to ``amd64`` for *Apt* and\n                           try to install the ``<package_name>:amd64`` package.\n        \"\"\"\n        super(Apt, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"amd64\",\n                            \"x86\": \"i386\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64el\",\n                            \"armv7\": \"arm\",\n                            \"armv7hf\": \"armhf\",\n                            \"armv8\": \"arm64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n\n        self._arch_separator = \":\"\n\n    def install(self, packages, update=False, check=True, recommends=False, host_package=True):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :param host_package: install the packages for the host machine architecture (the machine\n               that will run the software), it has an effect when cross building.\n        :param recommends: if the parameter ``recommends`` is ``False`` it will add the\n               ``'--no-install-recommends'`` argument to the *apt-get* command call.\n        :return: the return code of the executed apt command.\n        \"\"\"\n        recommends_str = '' if recommends else '--no-install-recommends '\n        return super(Apt, self).install(packages, update=update, check=check,\n                                        host_package=host_package, recommends=recommends_str)\n\n\nclass Yum(_SystemPackageManagerTool):\n    tool_name = \"yum\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} check-update -y\"\n    check_command = \"rpm -q {package}\"\n    accepted_update_codes = [0, 100]\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``i?86`` for *Yum* and\n                           try to install the ``<package_name>.i?86`` package.\n        \"\"\"\n        super(Yum, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"x86_64\",\n                            \"x86\": \"i?86\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64le\",\n                            \"armv7\": \"armv7\",\n                            \"armv7hf\": \"armv7hl\",\n                            \"armv8\": \"aarch64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n        self._arch_separator = \".\"\n\n\nclass Dnf(Yum):\n    tool_name = \"dnf\"\n\n\nclass Brew(_SystemPackageManagerTool):\n    tool_name = \"brew\"\n    install_command = \"{sudo}{tool} install {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = 'test -n \"$({tool} ls --versions {package})\"'\n\n\nclass Pkg(_SystemPackageManagerTool):\n    tool_name = \"pkg\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info {package}\"\n\n\nclass PkgUtil(_SystemPackageManagerTool):\n    tool_name = \"pkgutil\"\n    install_command = \"{sudo}{tool} --install --yes {packages}\"\n    update_command = \"{sudo}{tool} --catalog\"\n    check_command = 'test -n \"`{tool} --list {package}`\"'\n\n\nclass Chocolatey(_SystemPackageManagerTool):\n    tool_name = \"choco\"\n    install_command = \"{tool} install --yes {packages}\"\n    update_command = \"{tool} outdated\"\n    check_command = '{tool} search --local-only --exact {package} | ' \\\n                    'findstr /c:\"1 packages installed.\"'\n\n\nclass PacMan(_SystemPackageManagerTool):\n    tool_name = \"pacman\"\n    install_command = \"{sudo}{tool} -S --noconfirm {packages}\"\n    update_command = \"{sudo}{tool} -Syyu --noconfirm\"\n    check_command = \"{tool} -Qi {package}\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. If you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``lib32`` for *PacMan* and\n                           try to install the ``<package_name>-lib32`` package.\n        \"\"\"\n        super(PacMan, self).__init__(conanfile)\n        self._arch_names = {\"x86\": \"lib32\"} if arch_names is None else arch_names\n        self._arch_separator = \"-\"\n\n\nclass Apk(_SystemPackageManagerTool):\n    tool_name = \"apk\"\n    install_command = \"{sudo}{tool} add --no-cache {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info -e {package}\"\n\n    def __init__(self, conanfile, _arch_names=None):\n        \"\"\"\n        Constructor method.\n        Note that *Apk* does not support architecture names since Alpine Linux does not support\n        multiarch. Therefore, the ``arch_names`` argument is ignored.\n\n        :param conanfile: the current recipe object. Always use ``self``.\n        \"\"\"\n        super(Apk, self).__init__(conanfile)\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n\nclass Zypper(_SystemPackageManagerTool):\n    tool_name = \"zypper\"\n    install_command = \"{sudo}{tool} --non-interactive in {packages}\"\n    update_command = \"{sudo}{tool} --non-interactive ref\"\n    check_command = \"rpm -q {package}\"\n","new_file_content":"import platform\n\nfrom conan.tools.build import cross_building\nfrom conans.client.graph.graph import CONTEXT_BUILD\nfrom conan.errors import ConanException\n\n\nclass _SystemPackageManagerTool(object):\n    mode_check = \"check\"  # Check if installed, fail if not\n    mode_install = \"install\"\n    mode_report = \"report\"  # Only report what would be installed, no check (can run in any system)\n    mode_report_installed = \"report-installed\"  # report installed and missing packages\n    tool_name = None\n    install_command = \"\"\n    update_command = \"\"\n    check_command = \"\"\n    accepted_install_codes = [0]\n    accepted_update_codes = [0]\n    accepted_check_codes = [0, 1]\n\n    def __init__(self, conanfile):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        \"\"\"\n        self._conanfile = conanfile\n        self._active_tool = self._conanfile.conf.get(\"tools.system.package_manager:tool\", default=self.get_default_tool())\n        self._sudo = self._conanfile.conf.get(\"tools.system.package_manager:sudo\", default=False, check_type=bool)\n        self._sudo_askpass = self._conanfile.conf.get(\"tools.system.package_manager:sudo_askpass\", default=False, check_type=bool)\n        self._mode = self._conanfile.conf.get(\"tools.system.package_manager:mode\", default=self.mode_check)\n        self._arch = self._conanfile.settings_build.get_safe('arch') \\\n            if self._conanfile.context == CONTEXT_BUILD else self._conanfile.settings.get_safe('arch')\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n    def get_default_tool(self):\n        os_name = platform.system()\n        if os_name in [\"Linux\", \"FreeBSD\"]:\n            import distro\n            os_name = distro.id() or os_name\n        elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n            os_name = \"msys2\"\n        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux', 'pop'],\n                           \"apk\": [\"alpine\"],\n                           \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                   \"almalinux\", \"rocky\"],\n                           \"dnf\": [\"fedora\", \"rhel\", \"centos\", \"mageia\", \"nobara\"],\n                           \"brew\": [\"Darwin\"],\n                           \"pacman\": [\"arch\", \"manjaro\", \"msys2\", \"endeavouros\"],\n                           \"choco\": [\"Windows\"],\n                           \"zypper\": [\"opensuse\", \"sles\"],\n                           \"pkg\": [\"freebsd\"],\n                           \"pkgutil\": [\"Solaris\"]}\n        # first check exact match of name\n        for tool, distros in manager_mapping.items():\n            if os_name in distros:\n                return tool\n        # in case we did not detect any exact match, check\n        # if the name is contained inside the returned distro name\n        # like for opensuse, that can have opensuse-version names\n        for tool, distros in manager_mapping.items():\n            for d in distros:\n                if d in os_name:\n                    return tool\n\n        # No default package manager was found for the system,\n        # so notify the user\n        self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \"\n                                    \"system packages will not be installed.\".format(os_name))\n\n    def get_package_name(self, package, host_package=True):\n        # Only if the package is for building, for example a library,\n        # we should add the host arch when cross building.\n        # If the package is a tool that should be installed on the current build\n        # machine we should not add the arch.\n        if self._arch in self._arch_names and cross_building(self._conanfile) and host_package:\n            return \"{}{}{}\".format(package, self._arch_separator,\n                                   self._arch_names.get(self._arch))\n        return package\n\n    @property\n    def sudo_str(self):\n        sudo = \"sudo \" if self._sudo else \"\"\n        askpass = \"-A \" if self._sudo and self._sudo_askpass else \"\"\n        return \"{}{}\".format(sudo, askpass)\n\n    def run(self, method, *args, **kwargs):\n        if self._active_tool == self.__class__.tool_name:\n            return method(*args, **kwargs)\n\n    def _conanfile_run(self, command, accepted_returns):\n        # When checking multiple packages, this is too noisy\n        ret = self._conanfile.run(command, ignore_errors=True, quiet=True)\n        if ret not in accepted_returns:\n            raise ConanException(\"Command '%s' failed\" % command)\n        return ret\n\n    def install_substitutes(self, *args, **kwargs):\n        \"\"\"\n        Will try to call the install() method with  several lists of packages passed as a\n        variable number of parameters. This is useful if, for example, the names of the\n        packages are different from one distro or distro version to another. For example,\n        ``libxcb`` for ``Apt`` is named ``libxcb-util-dev`` in Ubuntu >= 15.0 and ``libxcb-util0-dev``\n        for other versions. You can call to:\n\n           .. code-block:: python\n\n            # will install the first list of packages that succeeds in the installation\n            Apt.install_substitutes([\"libxcb-util-dev\"], [\"libxcb-util0-dev\"])\n\n        :param packages_alternatives: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install_substitutes, *args, **kwargs)\n\n    def install(self, *args, **kwargs):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install, *args, **kwargs)\n\n    def update(self, *args, **kwargs):\n        \"\"\"\n        Update the system package manager database. Its behaviour is affected by\n        the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :return: the return code of the executed package manager update command.\n        \"\"\"\n        return self.run(self._update, *args, **kwargs)\n\n    def check(self, *args, **kwargs):\n        \"\"\"\n        Check if the list of packages passed as parameter are already installed.\n\n        :param packages: list of packages to check.\n        :return: list of packages from the packages argument that are not installed in the system.\n        \"\"\"\n        return self.run(self._check, *args, **kwargs)\n\n    def _install_substitutes(self, *packages_substitutes, update=False, check=True, **kwargs):\n        errors = []\n        for packages in packages_substitutes:\n            try:\n                return self.install(packages, update, check, **kwargs)\n            except ConanException as e:\n                errors.append(e)\n\n        for error in errors:\n            self._conanfile.output.warning(str(error))\n        raise ConanException(\"None of the installs for the package substitutes succeeded.\")\n\n    def _install(self, packages, update=False, check=True, host_package=True, **kwargs):\n        pkgs = self._conanfile.system_requires.setdefault(self._active_tool, {})\n        install_pkgs = pkgs.setdefault(\"install\", [])\n        install_pkgs.extend(p for p in packages if p not in install_pkgs)\n        if self._mode == self.mode_report:\n            return\n\n        if check or self._mode in (self.mode_check, self.mode_report_installed):\n            packages = self.check(packages, host_package=host_package)\n            missing_pkgs = pkgs.setdefault(\"missing\", [])\n            missing_pkgs.extend(p for p in packages if p not in missing_pkgs)\n\n        if self._mode == self.mode_report_installed:\n            return\n\n        if self._mode == self.mode_check and packages:\n            raise ConanException(\"System requirements: '{0}' are missing but can't install \"\n                                 \"because tools.system.package_manager:mode is '{1}'.\"\n                                 \"Please update packages manually or set \"\n                                 \"'tools.system.package_manager:mode' \"\n                                 \"to '{2}' in the [conf] section of the profile, \"\n                                 \"or in the command line using \"\n                                 \"'-c tools.system.package_manager:mode={2}'\".format(\", \".join(packages),\n                                                                                     self.mode_check,\n                                                                                     self.mode_install))\n        elif packages:\n            if update:\n                self.update()\n\n            packages_arch = [self.get_package_name(package, host_package=host_package) for package in packages]\n            if packages_arch:\n                command = self.install_command.format(sudo=self.sudo_str,\n                                                      tool=self.tool_name,\n                                                      packages=\" \".join(packages_arch),\n                                                      **kwargs)\n                return self._conanfile_run(command, self.accepted_install_codes)\n        else:\n            self._conanfile.output.info(\"System requirements: {} already \"\n                                        \"installed\".format(\" \".join(packages)))\n\n    def _update(self):\n        # we just update the package manager database in case we are in 'install mode'\n        # in case we are in check mode just ignore\n        if self._mode == self.mode_install:\n            command = self.update_command.format(sudo=self.sudo_str, tool=self.tool_name)\n            return self._conanfile_run(command, self.accepted_update_codes)\n\n    def _check(self, packages, host_package=True):\n        missing = [pkg for pkg in packages if self.check_package(self.get_package_name(pkg, host_package=host_package)) != 0]\n        return missing\n\n    def check_package(self, package):\n        command = self.check_command.format(tool=self.tool_name,\n                                            package=package)\n        return self._conanfile_run(command, self.accepted_check_codes)\n\n\nclass Apt(_SystemPackageManagerTool):\n    # TODO: apt? apt-get?\n    tool_name = \"apt-get\"\n    install_command = \"{sudo}{tool} install -y {recommends}{packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"dpkg-query -W -f='${{Status}}' {package} | grep -q \\\"ok installed\\\"\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        :param arch_names: This argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86_64`` Conan architecture setting, it will map this value to ``amd64`` for *Apt* and\n                           try to install the ``<package_name>:amd64`` package.\n        \"\"\"\n        super(Apt, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"amd64\",\n                            \"x86\": \"i386\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64el\",\n                            \"armv7\": \"arm\",\n                            \"armv7hf\": \"armhf\",\n                            \"armv8\": \"arm64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n\n        self._arch_separator = \":\"\n\n    def install(self, packages, update=False, check=True, recommends=False, host_package=True):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :param host_package: install the packages for the host machine architecture (the machine\n               that will run the software), it has an effect when cross building.\n        :param recommends: if the parameter ``recommends`` is ``False`` it will add the\n               ``'--no-install-recommends'`` argument to the *apt-get* command call.\n        :return: the return code of the executed apt command.\n        \"\"\"\n        recommends_str = '' if recommends else '--no-install-recommends '\n        return super(Apt, self).install(packages, update=update, check=check,\n                                        host_package=host_package, recommends=recommends_str)\n\n\nclass Yum(_SystemPackageManagerTool):\n    tool_name = \"yum\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} check-update -y\"\n    check_command = \"rpm -q {package}\"\n    accepted_update_codes = [0, 100]\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``i?86`` for *Yum* and\n                           try to install the ``<package_name>.i?86`` package.\n        \"\"\"\n        super(Yum, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"x86_64\",\n                            \"x86\": \"i?86\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64le\",\n                            \"armv7\": \"armv7\",\n                            \"armv7hf\": \"armv7hl\",\n                            \"armv8\": \"aarch64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n        self._arch_separator = \".\"\n\n\nclass Dnf(Yum):\n    tool_name = \"dnf\"\n\n\nclass Brew(_SystemPackageManagerTool):\n    tool_name = \"brew\"\n    install_command = \"{sudo}{tool} install {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = 'test -n \"$({tool} ls --versions {package})\"'\n\n\nclass Pkg(_SystemPackageManagerTool):\n    tool_name = \"pkg\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info {package}\"\n\n\nclass PkgUtil(_SystemPackageManagerTool):\n    tool_name = \"pkgutil\"\n    install_command = \"{sudo}{tool} --install --yes {packages}\"\n    update_command = \"{sudo}{tool} --catalog\"\n    check_command = 'test -n \"`{tool} --list {package}`\"'\n\n\nclass Chocolatey(_SystemPackageManagerTool):\n    tool_name = \"choco\"\n    install_command = \"{tool} install --yes {packages}\"\n    update_command = \"{tool} outdated\"\n    check_command = '{tool} search --local-only --exact {package} | ' \\\n                    'findstr /c:\"1 packages installed.\"'\n\n\nclass PacMan(_SystemPackageManagerTool):\n    tool_name = \"pacman\"\n    install_command = \"{sudo}{tool} -S --noconfirm {packages}\"\n    update_command = \"{sudo}{tool} -Syyu --noconfirm\"\n    check_command = \"{tool} -Qi {package}\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. If you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``lib32`` for *PacMan* and\n                           try to install the ``<package_name>-lib32`` package.\n        \"\"\"\n        super(PacMan, self).__init__(conanfile)\n        self._arch_names = {\"x86\": \"lib32\"} if arch_names is None else arch_names\n        self._arch_separator = \"-\"\n\n\nclass Apk(_SystemPackageManagerTool):\n    tool_name = \"apk\"\n    install_command = \"{sudo}{tool} add --no-cache {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info -e {package}\"\n\n    def __init__(self, conanfile, _arch_names=None):\n        \"\"\"\n        Constructor method.\n        Note that *Apk* does not support architecture names since Alpine Linux does not support\n        multiarch. Therefore, the ``arch_names`` argument is ignored.\n\n        :param conanfile: the current recipe object. Always use ``self``.\n        \"\"\"\n        super(Apk, self).__init__(conanfile)\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n\nclass Zypper(_SystemPackageManagerTool):\n    tool_name = \"zypper\"\n    install_command = \"{sudo}{tool} --non-interactive in {packages}\"\n    update_command = \"{sudo}{tool} --non-interactive ref\"\n    check_command = \"rpm -q {package}\"\n","header":{"file":{"path":"conan/tools/system/package_manager.py"},"misc_line":null},"index_line":null,"is_binary_file":false,"binary_line":null,"minus_file":{"path":"a/conan/tools/system/package_manager.py"},"plus_file":{"path":"b/conan/tools/system/package_manager.py"},"hunks":[{"descriptor":{"old_range":{"start":39,"length":7},"new_range":{"start":39,"length":7},"section":"def get_default_tool(self):"},"line_group":{"all_lines":[{"content":"            os_name = distro.id() or os_name","type":"context"},{"content":"        elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":","type":"context"},{"content":"            os_name = \"msys2\"","type":"context"},{"content":"        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],","type":"deleted"},{"content":"        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux', 'pop'],","type":"added"},{"content":"                           \"apk\": [\"alpine\"],","type":"context"},{"content":"                           \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",","type":"context"},{"content":"                                   \"almalinux\", \"rocky\"],","type":"context"}]},"modified_entities":[],"added_entities":[],"deleted_entities":[]},{"descriptor":{"old_range":{"start":61,"length":7},"new_range":{"start":61,"length":7},"section":"def get_default_tool(self):"},"line_group":{"all_lines":[{"content":"            for d in distros:","type":"context"},{"content":"                if d in os_name:","type":"context"},{"content":"                    return tool","type":"context"},{"content":"                ","type":"deleted"},{"content":"","type":"added"},{"content":"        # No default package manager was found for the system,","type":"context"},{"content":"        # so notify the user","type":"context"},{"content":"        self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \"","type":"context"},{"content":"","type":"context"}]},"modified_entities":[],"added_entities":[],"deleted_entities":[]}]}],"old_commit_hash":"937bfcc6385ab88384d13fd7aca325386ad31b97","new_commit_hash":"c086cf56be8f84fd105f856c127a017eda85d421","commit_message":"Add support for Pop!_OS in package_manager","commit_date":"2024-03-22T11:47:23-05:00","metadata":{}}
problem_statement: [feature] Add support for Pop!_OS to package_manager
  ### What is your suggestion?
  
  [Pop!_OS](https://pop.system76.com/) is an Ubuntu-based Linux distribution. It would be great if it could be added to the list of distributions that support `apt-get`. Its `distro.id()` is `pop`.
  
  ### Have you read the CONTRIBUTING guide?
  
  - [X] I've read the CONTRIBUTING guide
  
patch: diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py
  --- a/conan/tools/system/package_manager.py
  +++ b/conan/tools/system/package_manager.py
  @@ -39,7 +39,7 @@ def get_default_tool(self):
               os_name = distro.id() or os_name
           elif os_name == "Windows" and self._conanfile.conf.get("tools.microsoft.bash:subsystem") == "msys2":
               os_name = "msys2"
  -        manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint", 'astra', 'elbrus', 'altlinux'],
  +        manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint", 'astra', 'elbrus', 'altlinux', 'pop'],
                              "apk": ["alpine"],
                              "yum": ["pidora", "scientific", "xenserver", "amazon", "oracle", "amzn",
                                      "almalinux", "rocky"],
  @@ -61,7 +61,7 @@ def get_default_tool(self):
               for d in distros:
                   if d in os_name:
                       return tool
  -                
  +
           # No default package manager was found for the system,
           # so notify the user
           self._conanfile.output.info("A default system package manager couldn't be found for {}, "
   
  
file_context: {"conan/tools/system/package_manager.py": "import platform\n\nfrom conan.tools.build import cross_building\nfrom conans.client.graph.graph import CONTEXT_BUILD\nfrom conan.errors import ConanException\n\n\nclass _SystemPackageManagerTool(object):\n    mode_check = \"check\"  # Check if installed, fail if not\n    mode_install = \"install\"\n    mode_report = \"report\"  # Only report what would be installed, no check (can run in any system)\n    mode_report_installed = \"report-installed\"  # report installed and missing packages\n    tool_name = None\n    install_command = \"\"\n    update_command = \"\"\n    check_command = \"\"\n    accepted_install_codes = [0]\n    accepted_update_codes = [0]\n    accepted_check_codes = [0, 1]\n\n    def __init__(self, conanfile):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        \"\"\"\n        self._conanfile = conanfile\n        self._active_tool = self._conanfile.conf.get(\"tools.system.package_manager:tool\", default=self.get_default_tool())\n        self._sudo = self._conanfile.conf.get(\"tools.system.package_manager:sudo\", default=False, check_type=bool)\n        self._sudo_askpass = self._conanfile.conf.get(\"tools.system.package_manager:sudo_askpass\", default=False, check_type=bool)\n        self._mode = self._conanfile.conf.get(\"tools.system.package_manager:mode\", default=self.mode_check)\n        self._arch = self._conanfile.settings_build.get_safe('arch') \\\n            if self._conanfile.context == CONTEXT_BUILD else self._conanfile.settings.get_safe('arch')\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n    def get_default_tool(self):\n        os_name = platform.system()\n        if os_name in [\"Linux\", \"FreeBSD\"]:\n            import distro\n            os_name = distro.id() or os_name\n        elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n            os_name = \"msys2\"\n        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],\n                           \"apk\": [\"alpine\"],\n                           \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                   \"almalinux\", \"rocky\"],\n                           \"dnf\": [\"fedora\", \"rhel\", \"centos\", \"mageia\", \"nobara\"],\n                           \"brew\": [\"Darwin\"],\n                           \"pacman\": [\"arch\", \"manjaro\", \"msys2\", \"endeavouros\"],\n                           \"choco\": [\"Windows\"],\n                           \"zypper\": [\"opensuse\", \"sles\"],\n                           \"pkg\": [\"freebsd\"],\n                           \"pkgutil\": [\"Solaris\"]}\n        # first check exact match of name\n        for tool, distros in manager_mapping.items():\n            if os_name in distros:\n                return tool\n        # in case we did not detect any exact match, check\n        # if the name is contained inside the returned distro name\n        # like for opensuse, that can have opensuse-version names\n        for tool, distros in manager_mapping.items():\n            for d in distros:\n                if d in os_name:\n                    return tool\n                \n        # No default package manager was found for the system,\n        # so notify the user\n        self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \"\n                                    \"system packages will not be installed.\".format(os_name))\n\n    def get_package_name(self, package, host_package=True):\n        # Only if the package is for building, for example a library,\n        # we should add the host arch when cross building.\n        # If the package is a tool that should be installed on the current build\n        # machine we should not add the arch.\n        if self._arch in self._arch_names and cross_building(self._conanfile) and host_package:\n            return \"{}{}{}\".format(package, self._arch_separator,\n                                   self._arch_names.get(self._arch))\n        return package\n\n    @property\n    def sudo_str(self):\n        sudo = \"sudo \" if self._sudo else \"\"\n        askpass = \"-A \" if self._sudo and self._sudo_askpass else \"\"\n        return \"{}{}\".format(sudo, askpass)\n\n    def run(self, method, *args, **kwargs):\n        if self._active_tool == self.__class__.tool_name:\n            return method(*args, **kwargs)\n\n    def _conanfile_run(self, command, accepted_returns):\n        # When checking multiple packages, this is too noisy\n        ret = self._conanfile.run(command, ignore_errors=True, quiet=True)\n        if ret not in accepted_returns:\n            raise ConanException(\"Command '%s' failed\" % command)\n        return ret\n\n    def install_substitutes(self, *args, **kwargs):\n        \"\"\"\n        Will try to call the install() method with  several lists of packages passed as a\n        variable number of parameters. This is useful if, for example, the names of the\n        packages are different from one distro or distro version to another. For example,\n        ``libxcb`` for ``Apt`` is named ``libxcb-util-dev`` in Ubuntu >= 15.0 and ``libxcb-util0-dev``\n        for other versions. You can call to:\n\n           .. code-block:: python\n\n            # will install the first list of packages that succeeds in the installation\n            Apt.install_substitutes([\"libxcb-util-dev\"], [\"libxcb-util0-dev\"])\n\n        :param packages_alternatives: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install_substitutes, *args, **kwargs)\n\n    def install(self, *args, **kwargs):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install, *args, **kwargs)\n\n    def update(self, *args, **kwargs):\n        \"\"\"\n        Update the system package manager database. Its behaviour is affected by\n        the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :return: the return code of the executed package manager update command.\n        \"\"\"\n        return self.run(self._update, *args, **kwargs)\n\n    def check(self, *args, **kwargs):\n        \"\"\"\n        Check if the list of packages passed as parameter are already installed.\n\n        :param packages: list of packages to check.\n        :return: list of packages from the packages argument that are not installed in the system.\n        \"\"\"\n        return self.run(self._check, *args, **kwargs)\n\n    def _install_substitutes(self, *packages_substitutes, update=False, check=True, **kwargs):\n        errors = []\n        for packages in packages_substitutes:\n            try:\n                return self.install(packages, update, check, **kwargs)\n            except ConanException as e:\n                errors.append(e)\n\n        for error in errors:\n            self._conanfile.output.warning(str(error))\n        raise ConanException(\"None of the installs for the package substitutes succeeded.\")\n\n    def _install(self, packages, update=False, check=True, host_package=True, **kwargs):\n        pkgs = self._conanfile.system_requires.setdefault(self._active_tool, {})\n        install_pkgs = pkgs.setdefault(\"install\", [])\n        install_pkgs.extend(p for p in packages if p not in install_pkgs)\n        if self._mode == self.mode_report:\n            return\n\n        if check or self._mode in (self.mode_check, self.mode_report_installed):\n            packages = self.check(packages, host_package=host_package)\n            missing_pkgs = pkgs.setdefault(\"missing\", [])\n            missing_pkgs.extend(p for p in packages if p not in missing_pkgs)\n\n        if self._mode == self.mode_report_installed:\n            return\n\n        if self._mode == self.mode_check and packages:\n            raise ConanException(\"System requirements: '{0}' are missing but can't install \"\n                                 \"because tools.system.package_manager:mode is '{1}'.\"\n                                 \"Please update packages manually or set \"\n                                 \"'tools.system.package_manager:mode' \"\n                                 \"to '{2}' in the [conf] section of the profile, \"\n                                 \"or in the command line using \"\n                                 \"'-c tools.system.package_manager:mode={2}'\".format(\", \".join(packages),\n                                                                                     self.mode_check,\n                                                                                     self.mode_install))\n        elif packages:\n            if update:\n                self.update()\n\n            packages_arch = [self.get_package_name(package, host_package=host_package) for package in packages]\n            if packages_arch:\n                command = self.install_command.format(sudo=self.sudo_str,\n                                                      tool=self.tool_name,\n                                                      packages=\" \".join(packages_arch),\n                                                      **kwargs)\n                return self._conanfile_run(command, self.accepted_install_codes)\n        else:\n            self._conanfile.output.info(\"System requirements: {} already \"\n                                        \"installed\".format(\" \".join(packages)))\n\n    def _update(self):\n        # we just update the package manager database in case we are in 'install mode'\n        # in case we are in check mode just ignore\n        if self._mode == self.mode_install:\n            command = self.update_command.format(sudo=self.sudo_str, tool=self.tool_name)\n            return self._conanfile_run(command, self.accepted_update_codes)\n\n    def _check(self, packages, host_package=True):\n        missing = [pkg for pkg in packages if self.check_package(self.get_package_name(pkg, host_package=host_package)) != 0]\n        return missing\n\n    def check_package(self, package):\n        command = self.check_command.format(tool=self.tool_name,\n                                            package=package)\n        return self._conanfile_run(command, self.accepted_check_codes)\n\n\nclass Apt(_SystemPackageManagerTool):\n    # TODO: apt? apt-get?\n    tool_name = \"apt-get\"\n    install_command = \"{sudo}{tool} install -y {recommends}{packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"dpkg-query -W -f='${{Status}}' {package} | grep -q \\\"ok installed\\\"\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        :param arch_names: This argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86_64`` Conan architecture setting, it will map this value to ``amd64`` for *Apt* and\n                           try to install the ``<package_name>:amd64`` package.\n        \"\"\"\n        super(Apt, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"amd64\",\n                            \"x86\": \"i386\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64el\",\n                            \"armv7\": \"arm\",\n                            \"armv7hf\": \"armhf\",\n                            \"armv8\": \"arm64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n\n        self._arch_separator = \":\"\n\n    def install(self, packages, update=False, check=True, recommends=False, host_package=True):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :param host_package: install the packages for the host machine architecture (the machine\n               that will run the software), it has an effect when cross building.\n        :param recommends: if the parameter ``recommends`` is ``False`` it will add the\n               ``'--no-install-recommends'`` argument to the *apt-get* command call.\n        :return: the return code of the executed apt command.\n        \"\"\"\n        recommends_str = '' if recommends else '--no-install-recommends '\n        return super(Apt, self).install(packages, update=update, check=check,\n                                        host_package=host_package, recommends=recommends_str)\n\n\nclass Yum(_SystemPackageManagerTool):\n    tool_name = \"yum\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} check-update -y\"\n    check_command = \"rpm -q {package}\"\n    accepted_update_codes = [0, 100]\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``i?86`` for *Yum* and\n                           try to install the ``<package_name>.i?86`` package.\n        \"\"\"\n        super(Yum, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"x86_64\",\n                            \"x86\": \"i?86\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64le\",\n                            \"armv7\": \"armv7\",\n                            \"armv7hf\": \"armv7hl\",\n                            \"armv8\": \"aarch64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n        self._arch_separator = \".\"\n\n\nclass Dnf(Yum):\n    tool_name = \"dnf\"\n\n\nclass Brew(_SystemPackageManagerTool):\n    tool_name = \"brew\"\n    install_command = \"{sudo}{tool} install {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = 'test -n \"$({tool} ls --versions {package})\"'\n\n\nclass Pkg(_SystemPackageManagerTool):\n    tool_name = \"pkg\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info {package}\"\n\n\nclass PkgUtil(_SystemPackageManagerTool):\n    tool_name = \"pkgutil\"\n    install_command = \"{sudo}{tool} --install --yes {packages}\"\n    update_command = \"{sudo}{tool} --catalog\"\n    check_command = 'test -n \"`{tool} --list {package}`\"'\n\n\nclass Chocolatey(_SystemPackageManagerTool):\n    tool_name = \"choco\"\n    install_command = \"{tool} install --yes {packages}\"\n    update_command = \"{tool} outdated\"\n    check_command = '{tool} search --local-only --exact {package} | ' \\\n                    'findstr /c:\"1 packages installed.\"'\n\n\nclass PacMan(_SystemPackageManagerTool):\n    tool_name = \"pacman\"\n    install_command = \"{sudo}{tool} -S --noconfirm {packages}\"\n    update_command = \"{sudo}{tool} -Syyu --noconfirm\"\n    check_command = \"{tool} -Qi {package}\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. If you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``lib32`` for *PacMan* and\n                           try to install the ``<package_name>-lib32`` package.\n        \"\"\"\n        super(PacMan, self).__init__(conanfile)\n        self._arch_names = {\"x86\": \"lib32\"} if arch_names is None else arch_names\n        self._arch_separator = \"-\"\n\n\nclass Apk(_SystemPackageManagerTool):\n    tool_name = \"apk\"\n    install_command = \"{sudo}{tool} add --no-cache {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info -e {package}\"\n\n    def __init__(self, conanfile, _arch_names=None):\n        \"\"\"\n        Constructor method.\n        Note that *Apk* does not support architecture names since Alpine Linux does not support\n        multiarch. Therefore, the ``arch_names`` argument is ignored.\n\n        :param conanfile: the current recipe object. Always use ``self``.\n        \"\"\"\n        super(Apk, self).__init__(conanfile)\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n\nclass Zypper(_SystemPackageManagerTool):\n    tool_name = \"zypper\"\n    install_command = \"{sudo}{tool} --non-interactive in {packages}\"\n    update_command = \"{sudo}{tool} --non-interactive ref\"\n    check_command = \"rpm -q {package}\"\n"}
filelevel_patches: {"conan/tools/system/package_manager.py": "@@ -39,7 +39,7 @@ def get_default_tool(self):\n             os_name = distro.id() or os_name\n         elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n             os_name = \"msys2\"\n-        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],\n+        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux', 'pop'],\n                            \"apk\": [\"alpine\"],\n                            \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                    \"almalinux\", \"rocky\"],\n@@ -61,7 +61,7 @@ def get_default_tool(self):\n             for d in distros:\n                 if d in os_name:\n                     return tool\n-                \n+\n         # No default package manager was found for the system,\n         # so notify the user\n         self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \""}
messages.content: 
  We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  [feature] Add support for Pop!_OS to package_manager
  ### What is your suggestion?
  
  [Pop!_OS](https://pop.system76.com/) is an Ubuntu-based Linux distribution. It would be great if it could be added to the list of distributions that support `apt-get`. Its `distro.id()` is `pop`.
  
  ### Have you read the CONTRIBUTING guide?
  
  - [X] I've read the CONTRIBUTING guide
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  
  --- BEGIN FILE ---
  ```
  ### conan/tools/system/package_manager.py
  import platform
  
  from conan.tools.build import cross_building
  from conans.client.graph.graph import CONTEXT_BUILD
  from conan.errors import ConanException
  
  
  class _SystemPackageManagerTool(object):
      mode_check = "check"  # Check if installed, fail if not
      mode_install = "install"
      mode_report = "report"  # Only report what would be installed, no check (can run in any system)
      mode_report_installed = "report-installed"  # report installed and missing packages
      tool_name = None
      install_command = ""
      update_command = ""
      check_command = ""
      accepted_install_codes = [0]
      accepted_update_codes = [0]
      accepted_check_codes = [0, 1]
  
      def __init__(self, conanfile):
          """
          :param conanfile: The current recipe object. Always use ``self``.
          """
          self._conanfile = conanfile
          self._active_tool = self._conanfile.conf.get("tools.system.package_manager:tool", default=self.get_default_tool())
          self._sudo = self._conanfile.conf.get("tools.system.package_manager:sudo", default=False, check_type=bool)
          self._sudo_askpass = self._conanfile.conf.get("tools.system.package_manager:sudo_askpass", default=False, check_type=bool)
          self._mode = self._conanfile.conf.get("tools.system.package_manager:mode", default=self.mode_check)
          self._arch = self._conanfile.settings_build.get_safe('arch') \
              if self._conanfile.context == CONTEXT_BUILD else self._conanfile.settings.get_safe('arch')
          self._arch_names = {}
          self._arch_separator = ""
  
      def get_default_tool(self):
          os_name = platform.system()
          if os_name in ["Linux", "FreeBSD"]:
              import distro
              os_name = distro.id() or os_name
          elif os_name == "Windows" and self._conanfile.conf.get("tools.microsoft.bash:subsystem") == "msys2":
              os_name = "msys2"
          manager_mapping = {"apt-get": ["Linux", "ubuntu", "debian", "raspbian", "linuxmint", 'astra', 'elbrus', 'altlinux'],
                             "apk": ["alpine"],
                             "yum": ["pidora", "scientific", "xenserver", "amazon", "oracle", "amzn",
                                     "almalinux", "rocky"],
                             "dnf": ["fedora", "rhel", "centos", "mageia", "nobara"],
                             "brew": ["Darwin"],
                             "pacman": ["arch", "manjaro", "msys2", "endeavouros"],
                             "choco": ["Windows"],
                             "zypper": ["opensuse", "sles"],
                             "pkg": ["freebsd"],
                             "pkgutil": ["Solaris"]}
          # first check exact match of name
          for tool, distros in manager_mapping.items():
              if os_name in distros:
                  return tool
          # in case we did not detect any exact match, check
          # if the name is contained inside the returned distro name
          # like for opensuse, that can have opensuse-version names
          for tool, distros in manager_mapping.items():
              for d in distros:
                  if d in os_name:
                      return tool
                  
          # No default package manager was found for the system,
          # so notify the user
          self._conanfile.output.info("A default system package manager couldn't be found for {}, "
                                      "system packages will not be installed.".format(os_name))
  
      def get_package_name(self, package, host_package=True):
          # Only if the package is for building, for example a library,
          # we should add the host arch when cross building.
          # If the package is a tool that should be installed on the current build
          # machine we should not add the arch.
          if self._arch in self._arch_names and cross_building(self._conanfile) and host_package:
              return "{}{}{}".format(package, self._arch_separator,
                                     self._arch_names.get(self._arch))
          return package
  
      @property
      def sudo_str(self):
          sudo = "sudo " if self._sudo else ""
          askpass = "-A " if self._sudo and self._sudo_askpass else ""
          return "{}{}".format(sudo, askpass)
  
      def run(self, method, *args, **kwargs):
          if self._active_tool == self.__class__.tool_name:
              return method(*args, **kwargs)
  
      def _conanfile_run(self, command, accepted_returns):
          # When checking multiple packages, this is too noisy
          ret = self._conanfile.run(command, ignore_errors=True, quiet=True)
          if ret not in accepted_returns:
              raise ConanException("Command '%s' failed" % command)
          return ret
  
      def install_substitutes(self, *args, **kwargs):
          """
          Will try to call the install() method with  several lists of packages passed as a
          variable number of parameters. This is useful if, for example, the names of the
          packages are different from one distro or distro version to another. For example,
          ``libxcb`` for ``Apt`` is named ``libxcb-util-dev`` in Ubuntu >= 15.0 and ``libxcb-util0-dev``
          for other versions. You can call to:
  
             .. code-block:: python
  
              # will install the first list of packages that succeeds in the installation
              Apt.install_substitutes(["libxcb-util-dev"], ["libxcb-util0-dev"])
  
          :param packages_alternatives: try to install the list of packages passed as a parameter.
          :param update: try to update the package manager database before checking and installing.
          :param check: check if the packages are already installed before installing them.
          :return: the return code of the executed package manager command.
          """
          return self.run(self._install_substitutes, *args, **kwargs)
  
      def install(self, *args, **kwargs):
          """
          Will try to install the list of packages passed as a parameter. Its
          behaviour is affected by the value of ``tools.system.package_manager:mode``
          :ref:`configuration<conan_tools_system_package_manager_config>`.
  
          :param packages: try to install the list of packages passed as a parameter.
          :param update: try to update the package manager database before checking and installing.
          :param check: check if the packages are already installed before installing them.
          :return: the return code of the executed package manager command.
          """
          return self.run(self._install, *args, **kwargs)
  
      def update(self, *args, **kwargs):
          """
          Update the system package manager database. Its behaviour is affected by
          the value of ``tools.system.package_manager:mode``
          :ref:`configuration<conan_tools_system_package_manager_config>`.
  
          :return: the return code of the executed package manager update command.
          """
          return self.run(self._update, *args, **kwargs)
  
      def check(self, *args, **kwargs):
          """
          Check if the list of packages passed as parameter are already installed.
  
          :param packages: list of packages to check.
          :return: list of packages from the packages argument that are not installed in the system.
          """
          return self.run(self._check, *args, **kwargs)
  
      def _install_substitutes(self, *packages_substitutes, update=False, check=True, **kwargs):
          errors = []
          for packages in packages_substitutes:
              try:
                  return self.install(packages, update, check, **kwargs)
              except ConanException as e:
                  errors.append(e)
  
          for error in errors:
              self._conanfile.output.warning(str(error))
          raise ConanException("None of the installs for the package substitutes succeeded.")
  
      def _install(self, packages, update=False, check=True, host_package=True, **kwargs):
          pkgs = self._conanfile.system_requires.setdefault(self._active_tool, {})
          install_pkgs = pkgs.setdefault("install", [])
          install_pkgs.extend(p for p in packages if p not in install_pkgs)
          if self._mode == self.mode_report:
              return
  
          if check or self._mode in (self.mode_check, self.mode_report_installed):
              packages = self.check(packages, host_package=host_package)
              missing_pkgs = pkgs.setdefault("missing", [])
              missing_pkgs.extend(p for p in packages if p not in missing_pkgs)
  
          if self._mode == self.mode_report_installed:
              return
  
          if self._mode == self.mode_check and packages:
              raise ConanException("System requirements: '{0}' are missing but can't install "
                                   "because tools.system.package_manager:mode is '{1}'."
                                   "Please update packages manually or set "
                                   "'tools.system.package_manager:mode' "
                                   "to '{2}' in the [conf] section of the profile, "
                                   "or in the command line using "
                                   "'-c tools.system.package_manager:mode={2}'".format(", ".join(packages),
                                                                                       self.mode_check,
                                                                                       self.mode_install))
          elif packages:
              if update:
                  self.update()
  
              packages_arch = [self.get_package_name(package, host_package=host_package) for package in packages]
              if packages_arch:
                  command = self.install_command.format(sudo=self.sudo_str,
                                                        tool=self.tool_name,
                                                        packages=" ".join(packages_arch),
                                                        **kwargs)
                  return self._conanfile_run(command, self.accepted_install_codes)
          else:
              self._conanfile.output.info("System requirements: {} already "
                                          "installed".format(" ".join(packages)))
  
      def _update(self):
          # we just update the package manager database in case we are in 'install mode'
          # in case we are in check mode just ignore
          if self._mode == self.mode_install:
              command = self.update_command.format(sudo=self.sudo_str, tool=self.tool_name)
              return self._conanfile_run(command, self.accepted_update_codes)
  
      def _check(self, packages, host_package=True):
          missing = [pkg for pkg in packages if self.check_package(self.get_package_name(pkg, host_package=host_package)) != 0]
          return missing
  
      def check_package(self, package):
          command = self.check_command.format(tool=self.tool_name,
                                              package=package)
          return self._conanfile_run(command, self.accepted_check_codes)
  
  
  class Apt(_SystemPackageManagerTool):
      # TODO: apt? apt-get?
      tool_name = "apt-get"
      install_command = "{sudo}{tool} install -y {recommends}{packages}"
      update_command = "{sudo}{tool} update"
      check_command = "dpkg-query -W -f='${{Status}}' {package} | grep -q \"ok installed\""
  
      def __init__(self, conanfile, arch_names=None):
          """
          :param conanfile: The current recipe object. Always use ``self``.
          :param arch_names: This argument maps the Conan architecture setting with the package manager
                             tool architecture names. It is ``None`` by default, which means that it will use a
                             default mapping for the most common architectures. For example, if you are using
                             ``x86_64`` Conan architecture setting, it will map this value to ``amd64`` for *Apt* and
                             try to install the ``<package_name>:amd64`` package.
          """
          super(Apt, self).__init__(conanfile)
          self._arch_names = {"x86_64": "amd64",
                              "x86": "i386",
                              "ppc32": "powerpc",
                              "ppc64le": "ppc64el",
                              "armv7": "arm",
                              "armv7hf": "armhf",
                              "armv8": "arm64",
                              "s390x": "s390x"} if arch_names is None else arch_names
  
          self._arch_separator = ":"
  
      def install(self, packages, update=False, check=True, recommends=False, host_package=True):
          """
          Will try to install the list of packages passed as a parameter. Its
          behaviour is affected by the value of ``tools.system.package_manager:mode``
          :ref:`configuration<conan_tools_system_package_manager_config>`.
  
          :param packages: try to install the list of packages passed as a parameter.
          :param update: try to update the package manager database before checking and installing.
          :param check: check if the packages are already installed before installing them.
          :param host_package: install the packages for the host machine architecture (the machine
                 that will run the software), it has an effect when cross building.
          :param recommends: if the parameter ``recommends`` is ``False`` it will add the
                 ``'--no-install-recommends'`` argument to the *apt-get* command call.
          :return: the return code of the executed apt command.
          """
          recommends_str = '' if recommends else '--no-install-recommends '
          return super(Apt, self).install(packages, update=update, check=check,
                                          host_package=host_package, recommends=recommends_str)
  
  
  class Yum(_SystemPackageManagerTool):
      tool_name = "yum"
      install_command = "{sudo}{tool} install -y {packages}"
      update_command = "{sudo}{tool} check-update -y"
      check_command = "rpm -q {package}"
      accepted_update_codes = [0, 100]
  
      def __init__(self, conanfile, arch_names=None):
          """
          :param conanfile: the current recipe object. Always use ``self``.
          :param arch_names: this argument maps the Conan architecture setting with the package manager
                             tool architecture names. It is ``None`` by default, which means that it will use a
                             default mapping for the most common architectures. For example, if you are using
                             ``x86`` Conan architecture setting, it will map this value to ``i?86`` for *Yum* and
                             try to install the ``<package_name>.i?86`` package.
          """
          super(Yum, self).__init__(conanfile)
          self._arch_names = {"x86_64": "x86_64",
                              "x86": "i?86",
                              "ppc32": "powerpc",
                              "ppc64le": "ppc64le",
                              "armv7": "armv7",
                              "armv7hf": "armv7hl",
                              "armv8": "aarch64",
                              "s390x": "s390x"} if arch_names is None else arch_names
          self._arch_separator = "."
  
  
  class Dnf(Yum):
      tool_name = "dnf"
  
  
  class Brew(_SystemPackageManagerTool):
      tool_name = "brew"
      install_command = "{sudo}{tool} install {packages}"
      update_command = "{sudo}{tool} update"
      check_command = 'test -n "$({tool} ls --versions {package})"'
  
  
  class Pkg(_SystemPackageManagerTool):
      tool_name = "pkg"
      install_command = "{sudo}{tool} install -y {packages}"
      update_command = "{sudo}{tool} update"
      check_command = "{tool} info {package}"
  
  
  class PkgUtil(_SystemPackageManagerTool):
      tool_name = "pkgutil"
      install_command = "{sudo}{tool} --install --yes {packages}"
      update_command = "{sudo}{tool} --catalog"
      check_command = 'test -n "`{tool} --list {package}`"'
  
  
  class Chocolatey(_SystemPackageManagerTool):
      tool_name = "choco"
      install_command = "{tool} install --yes {packages}"
      update_command = "{tool} outdated"
      check_command = '{tool} search --local-only --exact {package} | ' \
                      'findstr /c:"1 packages installed."'
  
  
  class PacMan(_SystemPackageManagerTool):
      tool_name = "pacman"
      install_command = "{sudo}{tool} -S --noconfirm {packages}"
      update_command = "{sudo}{tool} -Syyu --noconfirm"
      check_command = "{tool} -Qi {package}"
  
      def __init__(self, conanfile, arch_names=None):
          """
          :param conanfile: the current recipe object. Always use ``self``.
          :param arch_names: this argument maps the Conan architecture setting with the package manager
                             tool architecture names. It is ``None`` by default, which means that it will use a
                             default mapping for the most common architectures. If you are using
                             ``x86`` Conan architecture setting, it will map this value to ``lib32`` for *PacMan* and
                             try to install the ``<package_name>-lib32`` package.
          """
          super(PacMan, self).__init__(conanfile)
          self._arch_names = {"x86": "lib32"} if arch_names is None else arch_names
          self._arch_separator = "-"
  
  
  class Apk(_SystemPackageManagerTool):
      tool_name = "apk"
      install_command = "{sudo}{tool} add --no-cache {packages}"
      update_command = "{sudo}{tool} update"
      check_command = "{tool} info -e {package}"
  
      def __init__(self, conanfile, _arch_names=None):
          """
          Constructor method.
          Note that *Apk* does not support architecture names since Alpine Linux does not support
          multiarch. Therefore, the ``arch_names`` argument is ignored.
  
          :param conanfile: the current recipe object. Always use ``self``.
          """
          super(Apk, self).__init__(conanfile)
          self._arch_names = {}
          self._arch_separator = ""
  
  
  class Zypper(_SystemPackageManagerTool):
      tool_name = "zypper"
      install_command = "{sudo}{tool} --non-interactive in {packages}"
      update_command = "{sudo}{tool} --non-interactive ref"
      check_command = "rpm -q {package}"
  
  ```
  --- END FILE ---
  
  Please first localize the bug based on the issue statement, and then generate *SEARCH/REPLACE* edits to fix the issue.
  
  Every *SEARCH/REPLACE* edit must use this format:
  1. The file path
  2. The start of search block: <<<<<<< SEARCH
  3. A contiguous chunk of lines to search for in the existing source code
  4. The dividing line: =======
  5. The lines to replace into the source code
  6. The end of the replace block: >>>>>>> REPLACE
  
  Here is an example:
  
  ```python
  ### mathweb/flask/app.py
  <<<<<<< SEARCH
  from flask import Flask
  =======
  import math
  from flask import Flask
  >>>>>>> REPLACE
  ```
  
  Please note that the *SEARCH/REPLACE* edit REQUIRES PROPER INDENTATION. If you would like to add the line '        print(x)', you must fully write that out, with all those spaces before the code!
  Wrap the *SEARCH/REPLACE* edit in blocks ```python...```.
  
messages.role: user
verification_info: {"file_context": {"conan/tools/system/package_manager.py": "import platform\n\nfrom conan.tools.build import cross_building\nfrom conans.client.graph.graph import CONTEXT_BUILD\nfrom conan.errors import ConanException\n\n\nclass _SystemPackageManagerTool(object):\n    mode_check = \"check\"  # Check if installed, fail if not\n    mode_install = \"install\"\n    mode_report = \"report\"  # Only report what would be installed, no check (can run in any system)\n    mode_report_installed = \"report-installed\"  # report installed and missing packages\n    tool_name = None\n    install_command = \"\"\n    update_command = \"\"\n    check_command = \"\"\n    accepted_install_codes = [0]\n    accepted_update_codes = [0]\n    accepted_check_codes = [0, 1]\n\n    def __init__(self, conanfile):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        \"\"\"\n        self._conanfile = conanfile\n        self._active_tool = self._conanfile.conf.get(\"tools.system.package_manager:tool\", default=self.get_default_tool())\n        self._sudo = self._conanfile.conf.get(\"tools.system.package_manager:sudo\", default=False, check_type=bool)\n        self._sudo_askpass = self._conanfile.conf.get(\"tools.system.package_manager:sudo_askpass\", default=False, check_type=bool)\n        self._mode = self._conanfile.conf.get(\"tools.system.package_manager:mode\", default=self.mode_check)\n        self._arch = self._conanfile.settings_build.get_safe('arch') \\\n            if self._conanfile.context == CONTEXT_BUILD else self._conanfile.settings.get_safe('arch')\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n    def get_default_tool(self):\n        os_name = platform.system()\n        if os_name in [\"Linux\", \"FreeBSD\"]:\n            import distro\n            os_name = distro.id() or os_name\n        elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n            os_name = \"msys2\"\n        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],\n                           \"apk\": [\"alpine\"],\n                           \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                   \"almalinux\", \"rocky\"],\n                           \"dnf\": [\"fedora\", \"rhel\", \"centos\", \"mageia\", \"nobara\"],\n                           \"brew\": [\"Darwin\"],\n                           \"pacman\": [\"arch\", \"manjaro\", \"msys2\", \"endeavouros\"],\n                           \"choco\": [\"Windows\"],\n                           \"zypper\": [\"opensuse\", \"sles\"],\n                           \"pkg\": [\"freebsd\"],\n                           \"pkgutil\": [\"Solaris\"]}\n        # first check exact match of name\n        for tool, distros in manager_mapping.items():\n            if os_name in distros:\n                return tool\n        # in case we did not detect any exact match, check\n        # if the name is contained inside the returned distro name\n        # like for opensuse, that can have opensuse-version names\n        for tool, distros in manager_mapping.items():\n            for d in distros:\n                if d in os_name:\n                    return tool\n                \n        # No default package manager was found for the system,\n        # so notify the user\n        self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \"\n                                    \"system packages will not be installed.\".format(os_name))\n\n    def get_package_name(self, package, host_package=True):\n        # Only if the package is for building, for example a library,\n        # we should add the host arch when cross building.\n        # If the package is a tool that should be installed on the current build\n        # machine we should not add the arch.\n        if self._arch in self._arch_names and cross_building(self._conanfile) and host_package:\n            return \"{}{}{}\".format(package, self._arch_separator,\n                                   self._arch_names.get(self._arch))\n        return package\n\n    @property\n    def sudo_str(self):\n        sudo = \"sudo \" if self._sudo else \"\"\n        askpass = \"-A \" if self._sudo and self._sudo_askpass else \"\"\n        return \"{}{}\".format(sudo, askpass)\n\n    def run(self, method, *args, **kwargs):\n        if self._active_tool == self.__class__.tool_name:\n            return method(*args, **kwargs)\n\n    def _conanfile_run(self, command, accepted_returns):\n        # When checking multiple packages, this is too noisy\n        ret = self._conanfile.run(command, ignore_errors=True, quiet=True)\n        if ret not in accepted_returns:\n            raise ConanException(\"Command '%s' failed\" % command)\n        return ret\n\n    def install_substitutes(self, *args, **kwargs):\n        \"\"\"\n        Will try to call the install() method with  several lists of packages passed as a\n        variable number of parameters. This is useful if, for example, the names of the\n        packages are different from one distro or distro version to another. For example,\n        ``libxcb`` for ``Apt`` is named ``libxcb-util-dev`` in Ubuntu >= 15.0 and ``libxcb-util0-dev``\n        for other versions. You can call to:\n\n           .. code-block:: python\n\n            # will install the first list of packages that succeeds in the installation\n            Apt.install_substitutes([\"libxcb-util-dev\"], [\"libxcb-util0-dev\"])\n\n        :param packages_alternatives: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install_substitutes, *args, **kwargs)\n\n    def install(self, *args, **kwargs):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :return: the return code of the executed package manager command.\n        \"\"\"\n        return self.run(self._install, *args, **kwargs)\n\n    def update(self, *args, **kwargs):\n        \"\"\"\n        Update the system package manager database. Its behaviour is affected by\n        the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :return: the return code of the executed package manager update command.\n        \"\"\"\n        return self.run(self._update, *args, **kwargs)\n\n    def check(self, *args, **kwargs):\n        \"\"\"\n        Check if the list of packages passed as parameter are already installed.\n\n        :param packages: list of packages to check.\n        :return: list of packages from the packages argument that are not installed in the system.\n        \"\"\"\n        return self.run(self._check, *args, **kwargs)\n\n    def _install_substitutes(self, *packages_substitutes, update=False, check=True, **kwargs):\n        errors = []\n        for packages in packages_substitutes:\n            try:\n                return self.install(packages, update, check, **kwargs)\n            except ConanException as e:\n                errors.append(e)\n\n        for error in errors:\n            self._conanfile.output.warning(str(error))\n        raise ConanException(\"None of the installs for the package substitutes succeeded.\")\n\n    def _install(self, packages, update=False, check=True, host_package=True, **kwargs):\n        pkgs = self._conanfile.system_requires.setdefault(self._active_tool, {})\n        install_pkgs = pkgs.setdefault(\"install\", [])\n        install_pkgs.extend(p for p in packages if p not in install_pkgs)\n        if self._mode == self.mode_report:\n            return\n\n        if check or self._mode in (self.mode_check, self.mode_report_installed):\n            packages = self.check(packages, host_package=host_package)\n            missing_pkgs = pkgs.setdefault(\"missing\", [])\n            missing_pkgs.extend(p for p in packages if p not in missing_pkgs)\n\n        if self._mode == self.mode_report_installed:\n            return\n\n        if self._mode == self.mode_check and packages:\n            raise ConanException(\"System requirements: '{0}' are missing but can't install \"\n                                 \"because tools.system.package_manager:mode is '{1}'.\"\n                                 \"Please update packages manually or set \"\n                                 \"'tools.system.package_manager:mode' \"\n                                 \"to '{2}' in the [conf] section of the profile, \"\n                                 \"or in the command line using \"\n                                 \"'-c tools.system.package_manager:mode={2}'\".format(\", \".join(packages),\n                                                                                     self.mode_check,\n                                                                                     self.mode_install))\n        elif packages:\n            if update:\n                self.update()\n\n            packages_arch = [self.get_package_name(package, host_package=host_package) for package in packages]\n            if packages_arch:\n                command = self.install_command.format(sudo=self.sudo_str,\n                                                      tool=self.tool_name,\n                                                      packages=\" \".join(packages_arch),\n                                                      **kwargs)\n                return self._conanfile_run(command, self.accepted_install_codes)\n        else:\n            self._conanfile.output.info(\"System requirements: {} already \"\n                                        \"installed\".format(\" \".join(packages)))\n\n    def _update(self):\n        # we just update the package manager database in case we are in 'install mode'\n        # in case we are in check mode just ignore\n        if self._mode == self.mode_install:\n            command = self.update_command.format(sudo=self.sudo_str, tool=self.tool_name)\n            return self._conanfile_run(command, self.accepted_update_codes)\n\n    def _check(self, packages, host_package=True):\n        missing = [pkg for pkg in packages if self.check_package(self.get_package_name(pkg, host_package=host_package)) != 0]\n        return missing\n\n    def check_package(self, package):\n        command = self.check_command.format(tool=self.tool_name,\n                                            package=package)\n        return self._conanfile_run(command, self.accepted_check_codes)\n\n\nclass Apt(_SystemPackageManagerTool):\n    # TODO: apt? apt-get?\n    tool_name = \"apt-get\"\n    install_command = \"{sudo}{tool} install -y {recommends}{packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"dpkg-query -W -f='${{Status}}' {package} | grep -q \\\"ok installed\\\"\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: The current recipe object. Always use ``self``.\n        :param arch_names: This argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86_64`` Conan architecture setting, it will map this value to ``amd64`` for *Apt* and\n                           try to install the ``<package_name>:amd64`` package.\n        \"\"\"\n        super(Apt, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"amd64\",\n                            \"x86\": \"i386\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64el\",\n                            \"armv7\": \"arm\",\n                            \"armv7hf\": \"armhf\",\n                            \"armv8\": \"arm64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n\n        self._arch_separator = \":\"\n\n    def install(self, packages, update=False, check=True, recommends=False, host_package=True):\n        \"\"\"\n        Will try to install the list of packages passed as a parameter. Its\n        behaviour is affected by the value of ``tools.system.package_manager:mode``\n        :ref:`configuration<conan_tools_system_package_manager_config>`.\n\n        :param packages: try to install the list of packages passed as a parameter.\n        :param update: try to update the package manager database before checking and installing.\n        :param check: check if the packages are already installed before installing them.\n        :param host_package: install the packages for the host machine architecture (the machine\n               that will run the software), it has an effect when cross building.\n        :param recommends: if the parameter ``recommends`` is ``False`` it will add the\n               ``'--no-install-recommends'`` argument to the *apt-get* command call.\n        :return: the return code of the executed apt command.\n        \"\"\"\n        recommends_str = '' if recommends else '--no-install-recommends '\n        return super(Apt, self).install(packages, update=update, check=check,\n                                        host_package=host_package, recommends=recommends_str)\n\n\nclass Yum(_SystemPackageManagerTool):\n    tool_name = \"yum\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} check-update -y\"\n    check_command = \"rpm -q {package}\"\n    accepted_update_codes = [0, 100]\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. For example, if you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``i?86`` for *Yum* and\n                           try to install the ``<package_name>.i?86`` package.\n        \"\"\"\n        super(Yum, self).__init__(conanfile)\n        self._arch_names = {\"x86_64\": \"x86_64\",\n                            \"x86\": \"i?86\",\n                            \"ppc32\": \"powerpc\",\n                            \"ppc64le\": \"ppc64le\",\n                            \"armv7\": \"armv7\",\n                            \"armv7hf\": \"armv7hl\",\n                            \"armv8\": \"aarch64\",\n                            \"s390x\": \"s390x\"} if arch_names is None else arch_names\n        self._arch_separator = \".\"\n\n\nclass Dnf(Yum):\n    tool_name = \"dnf\"\n\n\nclass Brew(_SystemPackageManagerTool):\n    tool_name = \"brew\"\n    install_command = \"{sudo}{tool} install {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = 'test -n \"$({tool} ls --versions {package})\"'\n\n\nclass Pkg(_SystemPackageManagerTool):\n    tool_name = \"pkg\"\n    install_command = \"{sudo}{tool} install -y {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info {package}\"\n\n\nclass PkgUtil(_SystemPackageManagerTool):\n    tool_name = \"pkgutil\"\n    install_command = \"{sudo}{tool} --install --yes {packages}\"\n    update_command = \"{sudo}{tool} --catalog\"\n    check_command = 'test -n \"`{tool} --list {package}`\"'\n\n\nclass Chocolatey(_SystemPackageManagerTool):\n    tool_name = \"choco\"\n    install_command = \"{tool} install --yes {packages}\"\n    update_command = \"{tool} outdated\"\n    check_command = '{tool} search --local-only --exact {package} | ' \\\n                    'findstr /c:\"1 packages installed.\"'\n\n\nclass PacMan(_SystemPackageManagerTool):\n    tool_name = \"pacman\"\n    install_command = \"{sudo}{tool} -S --noconfirm {packages}\"\n    update_command = \"{sudo}{tool} -Syyu --noconfirm\"\n    check_command = \"{tool} -Qi {package}\"\n\n    def __init__(self, conanfile, arch_names=None):\n        \"\"\"\n        :param conanfile: the current recipe object. Always use ``self``.\n        :param arch_names: this argument maps the Conan architecture setting with the package manager\n                           tool architecture names. It is ``None`` by default, which means that it will use a\n                           default mapping for the most common architectures. If you are using\n                           ``x86`` Conan architecture setting, it will map this value to ``lib32`` for *PacMan* and\n                           try to install the ``<package_name>-lib32`` package.\n        \"\"\"\n        super(PacMan, self).__init__(conanfile)\n        self._arch_names = {\"x86\": \"lib32\"} if arch_names is None else arch_names\n        self._arch_separator = \"-\"\n\n\nclass Apk(_SystemPackageManagerTool):\n    tool_name = \"apk\"\n    install_command = \"{sudo}{tool} add --no-cache {packages}\"\n    update_command = \"{sudo}{tool} update\"\n    check_command = \"{tool} info -e {package}\"\n\n    def __init__(self, conanfile, _arch_names=None):\n        \"\"\"\n        Constructor method.\n        Note that *Apk* does not support architecture names since Alpine Linux does not support\n        multiarch. Therefore, the ``arch_names`` argument is ignored.\n\n        :param conanfile: the current recipe object. Always use ``self``.\n        \"\"\"\n        super(Apk, self).__init__(conanfile)\n        self._arch_names = {}\n        self._arch_separator = \"\"\n\n\nclass Zypper(_SystemPackageManagerTool):\n    tool_name = \"zypper\"\n    install_command = \"{sudo}{tool} --non-interactive in {packages}\"\n    update_command = \"{sudo}{tool} --non-interactive ref\"\n    check_command = \"rpm -q {package}\"\n"}, "filelevel_patches": {"conan/tools/system/package_manager.py": "@@ -39,7 +39,7 @@ def get_default_tool(self):\n             os_name = distro.id() or os_name\n         elif os_name == \"Windows\" and self._conanfile.conf.get(\"tools.microsoft.bash:subsystem\") == \"msys2\":\n             os_name = \"msys2\"\n-        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux'],\n+        manager_mapping = {\"apt-get\": [\"Linux\", \"ubuntu\", \"debian\", \"raspbian\", \"linuxmint\", 'astra', 'elbrus', 'altlinux', 'pop'],\n                            \"apk\": [\"alpine\"],\n                            \"yum\": [\"pidora\", \"scientific\", \"xenserver\", \"amazon\", \"oracle\", \"amzn\",\n                                    \"almalinux\", \"rocky\"],\n@@ -61,7 +61,7 @@ def get_default_tool(self):\n             for d in distros:\n                 if d in os_name:\n                     return tool\n-                \n+\n         # No default package manager was found for the system,\n         # so notify the user\n         self._conanfile.output.info(\"A default system package manager couldn't be found for {}, \""}}