Tuesday, May 14, 2024
22
rated 0 times [  22] [ 0]  / answers: 1 / hits: 1289  / 2 Years ago, tue, july 12, 2022, 9:52:02

I would like to know what some specific package installs, for example, when installing ncurses, I have found that TAB key expands:



sudo apt-get install ncurses-


to show:



ncurses-base      ncurses-doc       ncurses-hexedit
ncurses-bin ncurses-examples ncurses-term


How could I know what, say, ncurses-term installs? I am interested mainly in programs, but libraries and any other filetypes could be useful too.



Command-line method, if possible, would be preferred (any others accepted too).


More From » command-line

 Answers
0

Here are a few options, these will list all the files installed by a package:



A. Listing all files included in a package




  1. For installed packages



    dpkg -L ncurses-term

  2. For all packages, installed or not



    apt-file -F list ncurses-term


    The -F turns of pattern matching so that only packages whose exact name matches are returned. You may need to install apt-file with sudo apt-get install apt-file and then update its database with sudo apt-file update.




B. Listing only executable files included in a package




  1. For installed packages



    Just install dlocate (sudo apt-get dlocate) and run:



    dlocate -lsbin ncurses-term 


    As explained in man dlocate:




    -lsbin List full path/filenames of executable files (if any) in package




    If you don't want to install additional packages, you can do this manually. Just collect the list of files and find any among them that have the executable bit set:



    apt-file -F list ncurses-term | cut -d ' ' -f 2 | 
    while read file; do [[ -x $file && -f $file ]] && echo "$file"; done


    The little scriptlet above will print the path only (cut -d ' ' -f 2) and then pass it through a while loop that checks if the file is executable (-x $file) and if it is a regular file, no directories or symlinks (-f $file) and prints its name only if passes both tests.


  2. For all packages, installed or not



    There is no way I know of to list only executables included in an uninstalled package. However, since most executables are installed to bin directories, you can get most of them by parsing the output:



     apt-file -F list ncurses-term | grep -Ew "bin|sbin"


    The -w option matches entire words, so you don't get things installed in, for example, trashbin or whatever.







NOTE: None of the above commands will produce any output for ncurses-term but that is because this package installs no executable files. The commands work nevertheless, try with a different package.


[#26479] Wednesday, July 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lotceptin

Total Points: 374
Total Questions: 106
Total Answers: 118

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
;