8273595: tools/jpackage tests do not work on apt-based Linux distros like Debian

Backport-of: f189dff5cbd4d47e1b2f3c0e5f2c866a7effccdf
diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java
index 26a1b77..9b8b577 100644
--- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java
+++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/PackageType.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019, 2020, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -119,6 +119,6 @@
     private final static class Inner {
         private final static Set<String> DISABLED_PACKAGERS = Optional.ofNullable(
                 TKit.tokenizeConfigProperty("disabledPackagers")).orElse(
-                TKit.isUbuntu() ? Set.of("rpm") : Collections.emptySet());
+                TKit.isLinuxAPT() ? Set.of("rpm") : Collections.emptySet());
     }
 }
diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java
index 19401cc..fb88d4c 100644
--- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java
+++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/TKit.java
@@ -22,10 +22,8 @@
  */
 package jdk.jpackage.test;
 
-import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileOutputStream;
-import java.io.FileReader;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.lang.reflect.InvocationTargetException;
@@ -184,25 +182,12 @@
         return ((OS.contains("nix") || OS.contains("nux")));
     }
 
-    public static boolean isUbuntu() {
+    public static boolean isLinuxAPT() {
         if (!isLinux()) {
             return false;
         }
-        File releaseFile = new File("/etc/os-release");
-        if (releaseFile.exists()) {
-            try (BufferedReader lineReader = new BufferedReader(new FileReader(releaseFile))) {
-                String lineText = null;
-                while ((lineText = lineReader.readLine()) != null) {
-                    if (lineText.indexOf("NAME=\"Ubuntu") != -1) {
-                        lineReader.close();
-                        return true;
-                    }
-                }
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-        }
-        return false;
+        File aptFile = new File("/usr/bin/apt-get");
+        return aptFile.exists();
     }
 
     private static String addTimestamp(String msg) {