I have thousands of Debian packages and I need to move all the executable files within those packages to one single directory. For a single package, I could use the ar
command to extract package and then typical Debian package has a "data.tar.xz" file which actually contains the possible executables. I could then extract "data.tar.xz" using tar
command and manually move the executables to new directory. It is a pain to do this for each package as there are thousands of packages and I was thinking to use a bash script to get the job done. My current directory structure looks like follows(only showed 3 packages here, all_executables is the directory to copy all the executables)
./git_2.28.0-1_armhf.deb
./libssm1-dbg_1.3-2.1_armhf.deb
./mariadb-client-core-10.0_10.0.28-2+b1_armhf.deb
(the list goes on)
./all_executables
Once I extract a Debian package, every package usually have the same structure as follows-:
./control.tar.xz
./data.tar.xz
./debian-binary
Upon extracting data.tar.xz file there is few directories and these directories typically contains the executables. I need to copy these executables to one folder (all_executables). Could somebody help me to do this task. I am a beginner to bash and find being lost to get even started. Thank you for your time.
.deb
files contain 'executables' that won't run unless the associated libraries and other support files, also in the deb, are installed in the correct location in the directory structure.git
package in archive.raspbian.org/raspbian/pool/main/g/git/… , you would see there isgit
andgit-shell
executable file which is under the /usr/bin directory of the extracted package(similarly there are such executables in lib directory). I just need to copy all these to one place.