I'm not a lawyer and I can't afford one, so I've been searching the internet for information on how to legally sell new computers that come pre-installed with a free Linux distribution. What I've found so far seems to suggest that I could charge for the service of performing the install, and for the cost of the installation media, but I couldn't make any profit from the installation disk as this would mean the distribution wasn't free when it was supposed to be. This all seems perfectly fair (assuming people in web forums are right and it's true).
There is supposedly an additional requirement imposed by the GNU General Public License, which is that you must give the end user a copy of the source code for the exact version of every GPL licensed piece of software that you put on the system. If you don't want to do that, you need to set up some means of internet distribution which your clients can log in to and download the source code at a later date. If you don't want to do either of those two things, the final option is that you could give the customer a written message with their new computer saying that they are able to request the source code for their GPL software at any time and that they will receive it free of charge. I think this is also very reasonable, but it could be a bit of a headache for some people to sort out all the packages unless they have some command line skills.
For a Debian-based system, it's actually quite easy to get the sources for every installed package, but I couldn't find it documented anywhere online and had to figure it out for myself, so as usual I made a tutorial page for my method.
Here's how to get the sources for every package on your Debian-based system:
First add an apt-src line for every repository you have listed in /etc/apt/sources.list and also any in /etc/apt/sources.list.d
Make a new folder somewhere to store the sources, then go into it:
Run this command to create a file containing all installed package names:
dpkg -l | tail -n+6 | cut -d" " -f3 | tr -s "\n" " " | sed "s/:i386//g" | sed "s/:amd64//g" > installed_packages
Next, run this command:
apt-get source --download-only `cat installed_packages`
If the previous command fails because the source of a package isn't available (maybe it's non-free or third-party), remove the package in question from your installed_packages file, then run the command again and repeat until the command succeeds.
If everything went right, you now have a directory full of the sources for the exact versions of every piece of free software on your Debian-based system. I am going to distribute this to customers by burning the contents of the folder to DVD-R and giving it to them along with their new Linux computer.
Again, I am not a lawyer and I take no responsibility for anything if the information presented on this web page is incorrect.
Was this tutorial helpful? Toss me a few bucks if you're feeling generous.