How do I create my own custom PPA to share with the Ubuntu community? I am trying to create my own custom package set and I would really like to share it with the community.
How do I create my own custom PPA to share with the Ubuntu community? I am trying to create my own custom package set and I would really like to share it with the community.
Using a Personal Package Archive (PPA), you can distribute software and updates directly to Ubuntu users. Create your source package, upload it and Launchpad will build binaries and then host them in your own apt repository.
Here is a detailed explanation.
How to create a .deb file
This is a tutorial on creating a basic .deb file from a given sample script. In this tutorial first we create a sample program in bash that just show 'HELLO FROM PROGRAM'. Then we create a control file for the program in order to make a debian installer. Finally they are packaged into a
.deb
file.Steps:
create a sample program in bash
paste the following code into it
Make the program executable
Create control file for the debian package
Make a file named
control
inside folderDEBIAN
and paste following details
You can edit the contents if you like. Read more about the format of this file here and here.
Create
postinst
script, that is executed immediately after installation of the packagethen paste
and make it executable
Create
prerm
script, that is executed before removal of the packageand make it executable
Make package structure and copy programs, data, etc..
Create a structure of your installed programs and its data. In this example we put the file at
/bin
.Build the .deb file.
The
.
will auto name the.deb
file with version, arch etc. Or your custom nameOr if you build the .deb file with
then you can upload it to Ubuntu Launchpad with
like described here (source: create a .deb Package from scripts or binaries)
Install the newly created
.deb
package. You can open it withsoftware-center
but it may not allow you to install. So I recommend to usegdebi
package manager.Now you can install it. During installation you should see a gtk dialogue
After installing open a terminal and type
zenity_hello
. If the program correctly installed and everything OK you should see a gtk dialogueRemoving package
Publish your repository in 2 minutes
As the OP wants a simple way to publish his packages I'm giving an easy hack.
requirement: dropbox (or anyother service, for ex. github) account with a public folder.
Create a folder inside your Public-Dropbox-Folder where you put your *.deb Files:
or create that folder somwhere else and put a symlink in your Public folder:
Go into that folder and create a script that, when executed, creates the Packages.gz, containing all the needed informationen about your deb-packages. create:
put this in it:
make it executable:
Copy some *.deb Files into the Folder. Could be your own or some that aren't available through other repositories. Then go into the Folder and execute the script we put there:
That should create the so called Packages.gz File, which apt looks for to know which Packages are located at this repository.
That's it
Now, wait for Dropbox to synchronize the Folder and grab the Public-URL from the
Packages.gz
. It should look something like this:Get rid of the end of that link, put some more words to it and you can now use and populate the following line for the sources.list:
That's it you got your own deb repository running. Always synchronized locally, but available to anyone, anytime, anywhere.
NOTE:
dpkg-scanpackages
is available fromdpkg-dev
reference
You will need a Launchpad.net account to create a PPA. Just click on your user on Launchpad (click on your name on the upper left) and create a PPA. You may have to first sign the Code of Conduct and have a GPG key registered with your account.