There's a .deb software that doesn't have a .desktop file, I created that file. I want to create another package for that software, when the user installs it, I want the .desktop file to be generated automatically and placed in /usr/share/applications/How to do so?
How to automatically generate .desktop file?
debian;ubuntu;package management;dpkg;packaging
Sounds like all you want to do is extract your .deb archive, add your .desktop file and the rebuild the package. This is a fairly simple process. To extract:dpkg-deb -R package.deb extract_dirNote -R is a raw extract to get the control files as well. Next create /usr/share/applications/ if it doesn't already exist:mkdir -p extract_dir/usr/share/applications/Then just add your .desktop file (be careful the name isn't going to conflict with anything else you are likely to install) and rebuild:cp desktop_file.desktop extract_dir/usr/share/applications/dpkg-deb -b extract_dir package_new.debNote you can also use dpkg-deb -b extract_dir . to create the package with its canonical name, but you will probably have to move your original out of the way first or else it will be clobbered.Sources:www.debian.org/doc/debian-policy/ap-pkg-binarypkg.htmlman dpkg-deb