How to determine the package name from a file

Tecno World

New Member
Joined
Feb 4, 2020
Messages
4
Reaction score
0
Credits
0
Hello,
it could be very simple and stupid, but I´m not able to determine the correct packagename from a filename.
I will explain:
ldd progname
gives me the dependencies of my program, what I have compiled. To build the package (.deb) I must write in the "control" file of the package folder the dependencies, but not in the given form from ldd. I must write as the package names.
Example:
ldd says: libpcap.so.0.8
control must be: libpcap0.8 (=>0.9.8)

From some packages I know the names, but how can I determide the correct name an version?

I.e. libc.so.6, If I start the program on an other machine, I get the message that I need GLIBC2.28 at least. But how must I write the dependencie of libc/glibc that I can get the correct package during the install? I tried "apt search glibc", but there comes 100 items, but no one points (for me) to a valid package name.

Any hints?

PS: The next question ist, how to determine, in which version the correct lib is available. If a client try to install, and a higher version of a lib is requested, so I will inform the user, to which version he must/should upgrade. In stretch i.e. I must change/add to "stable", so that I have access to the libc6 2.28. In stretch is only 2.24 available.
 
Last edited:


1) In simple terms what are you trying to do? What is the end result you want.
2) Stretch is not the current Stable. The current Stable is Buster and it has libc6 28-10
 
1) In simple terms what are you trying to do? What is the end result you want.
2) Stretch is not the current Stable. The current Stable is Buster and it has libc6 28-10
2: This I know. But if I have stretch and need newer libs I can change the sources.list and add stable / testing to get access to newer versions :) Normaly all libs ar downward compatible.

1: I wrote this before...
Build packages to distribute them.
If I have developed a program I must make the package. In this package its a debian control file. In this file its a section for the dependenties.


In this section you must write the package names in the form
package (=>Version), ie. libpcap0.8 (=>0.9.8)
If you check the compiled program against ldd you get a list with the lib file names.
But now I must know, whats the name of the package, what provides the given lib file to make the correct entry in the package control file.

In example, my program is very big and linked against a lot of libs.
That the package manager knows, which libs are missing and apt can collect them, you need to write the section depts in the control file. If you install the package with dpkg -i you can call apt-get -f later to get all the missing packages.
But if you don´t fill out correctly the dep-section in the control file you get no warnings during the install of the package and later, if you try to run the program, you get error messages of the missing libs.

So - the simple question, how can I get the packe name i.e. of this libs:
 

Attachments

  • abh.txt
    5.3 KB · Views: 382
Ok. After a lot of reading I found the solution.
apt-file ist searching the packages databases for a single files and points to the package, they contains this files.
Very simple - so you can get with a scipt all package names from the files.
 

Members online


Top