>This guide simply mashes up two other guides, with just the parts needed to create simple packages and them to your own repository, all on the local network (no PPAs).
First you need to make packages (a more complete guide below ). My packages are very simple as I am using them just to distribute files around the local network. Let’s pretend you want to include a simple bash backup script in a package.
Make a package
- Make a folder mycompany-backup
- Make two new folders in it: DEBIAN and opt
NOTE: pretend mycompany-backup is the / directory of whatever system you install it on, so everything in opt would go to /opt when installed, etc.
- Make a new text file under DEBIAN called control
- Add Some text to the file:
Architecture: i386 or amd64 or all (however all sadly doesn’t work with the next part of this guide)
Maintainer: My Name
- Add your content (in my case a backup script) to opt/backup.sh. Mine just backs up Documents to a place on our server. (NOTE: This isn’t a complete backup solution as there is no automation)
gvfs-mount mount smb://$SAMIAM@server/$SAMIAM #User must have saved password for share
rsync -rv /home/$SAMIAM/Documents “/home/$SAMIAM/.gvfs/$SAMIAM on server/BACKUP” –log-file=”/home/$SAMIAM/.gvfs/$SAMIAM on server/BACKUP/latest”
- Go one directory above where mycompany-backup is.
- Run the command dpkg -b mycompany-backup/ mycompany.deb and you should have a new .deb file.
I got most of this from:
 An IBM developerworks page that no longer exists.
Distribute the Package in your own company repository
- You need to already be running a simple web server (or not, you could just install apache)
- Make a new directory on the server called apt (likely /var/www/apt)
- Make two new folders in it: conf and incoming
- Make a new file in conf called distributions – like this
Origin: Your Name
Label: Something here as well
Architectures: amd64 source (all would be ideal here but it doesn’t work)
Description: Your description
- Oh right, install reprepro
- Add your deb to incoming
- Then while in the apt directory, run sudo reprepro includedeb karmic incoming/mycompany.deb
Then just add the line to your other computers:
deb http://mycompanysServerOrIPAddress/apt karmic mycompany
Update apt, and then install the mycompany package like any normal package.
Again this website provided a great starting point for me, and has many more details.
Mostly did this for my own documentation, hope it was helpful for you as well.
If anyone wants to figure out why the “all” architecture doesn’t work with reprepro it could be very helpful in making actually correct packages. The one in this example really should be all and not amd64.