0

I'm creating a Linux version of a Windows program and among other tasks, I need to create a package to allow users to install the software easily.

In Windows, the program has some files in the following folders:

  • Program files: c:\Program Files\company_name\my_app
  • Program data: c:\ProgramData\company_name\my_app
  • User content: c:\Users\TheUserName\Documents\company_name\my_app

In Linux, I know that User-related content should be placed in "/home/TheUserName/Documents/company_name/my_app" But I don't know exactly where to place "Program files" and "Program data": /usr/share, /usr/bin, /var, /etc/...?

What is the most appropriate location to place the files? Should I copy the binary files to the specific folder or should I create a folder for the program?

There are also some shared SO libraries, so should I copy them to /usr/lib? /usr/share? To any other location?

Finally, I would mainly work with Debian or Ubuntu distributions, so what do you recommend, a DEB, a flatpack package or something else?

I hope anyone can help with this. Any clue, document, guide, etc will be much appreciated.

asked Jun 12, 2024 at 12:39
8
  • 1
    You seem to be confused about how things work in the Linux file system. If you install into the user's home directory then all the components should be installed in the user's home directory; but if you are looking for a system-wide install (such as a .deb package) all of the files should go into system locations. The Debian packaging documentation has all the details (maybe start at wiki.debian.org/Packaging) but in brief, the binary would go in /usr/bin/my_app, binary library files in /usr/lib, and the data in /usr/share/lib/my-app or some such. Commented Jun 12, 2024 at 12:53
  • ... But use debhelper etc and you don't even have to know very much about this. Commented Jun 12, 2024 at 12:53
  • I frankly cannot see any advantage with alternate package formats if your target is Debian / Ubuntu. Commented Jun 12, 2024 at 12:55
  • 1
    No, the binary should be directly in /usr/bin in order to be available on the PATH for all users. Some nontrivial packages might install their files somewhere else and then just install symlinks to the executables in /usr/bin Commented Jun 14, 2024 at 17:28
  • 1
    Anyway, the package manager will take care of these things for you, as long as you follow the packaging instructions. Commented Jun 14, 2024 at 17:35

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.