3

I am using Ubuntu Server, hence I want to know if a package is GFX or CLI before installing. Wrongly installing GFX apps will cause a lot of dependencies to be fetched, and they will not work anyway (due to the lack of an X server).

Livy
  • 348
  • 1
  • 4
  • 16
  • 1
    see https://askubuntu.com/questions/128524/how-to-list-dependent-packages-reverse-dependencies for a method to check dependencies. – Rinzwind Apr 19 '19 at 07:36
  • You could read the man page, starting at https://manpages.ubuntu.com/manpages/ – waltinator Apr 19 '19 at 12:47

1 Answers1

3

For installed application your can follow my other answer.


In any case the locations of files (executables, man-pages and other stuff) should conform Filesystem Hierarchy Standard as a rule.

For not installed application we can adapt aforementioned method but we will use apt-file command instead of dpkg.

So we will do the following:

  1. Install apt-file:

    sudo apt-get install apt-file
    
  2. Update apt-file cache:

    sudo apt-file update
    
  3. List all package files with apt-file list (see man apt-file for details) and find files in /bin, /sbin, /usr/bin, /usr/sbin, /usr/games directories. So we can use the following command:

    $ sudo apt-file list httpcode | grep -E "/bin/|/sbin/|/usr/games/"
    httpcode: /usr/bin/hc
    

    So we can see that in this example /usr/bin/hc belongs to the package.

  4. List all man-pages:

    $ sudo apt-file list httpcode | grep "/man/"
    httpcode: /usr/share/man/man1/hc.1.gz
    

    So we can see that we can use man hc.

  5. For applications with GUI I run search for *.desktop files:

    $ sudo apt-file list httpcode | grep ".desktop"
    $
    

    In this particular case it will not return anything.

    But in case of real GUI application such as GNOME Terminal we will try to find its *.desktop file

    $ sudo apt-file list gnome-terminal | grep ".desktop$"
    gnome-terminal: /usr/share/applications/gnome-terminal.desktop
    

    And we see that it is found, so it is a GUI application.

  6. Also we can check first level of reverse dependencies with command like

    $ apt-cache rdepends gnome-terminal | grep desktop
    ubuntu-gnome-desktop
    ubuntu-desktop
    ubuntukylin-desktop
    ubuntu-gnome-desktop
    cinnamon-desktop-environment
    ubuntu-desktop
    

    - so GNOME Terminal needs DE which is usually ran on Xorg.

Also for not installed package one can visit https://packages.ubuntu.com and use Search package directories here (for all releases or for selected release), then click on list of files link in the right column of the table:

list of files link

and one will get the file list:

list of files for httpcode package

This list may interpreted manually or by using searchbar in the browser.

N0rbert
  • 99,918
  • Some CLI applications such as htop still create a .desktop file, which is a shortcut to run it as console app. I am not really sure about the reverse dependencies method, tried with apt-cache rdepends blender and it shows no desktop dependency -- maybe one of its dependencies requires a desktop environment. – Livy Apr 21 '19 at 03:50