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
  • 408
  • 1
  • 6
  • 16

1 Answers1

4

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
  • 103,263