{"id":12817,"date":"2019-03-28T21:58:20","date_gmt":"2019-03-28T21:58:20","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=12817"},"modified":"2019-03-28T21:58:20","modified_gmt":"2019-03-28T21:58:20","slug":"create-a-deb-package-repository-at-sourceforge-net-using-reprepro-tool-in-ubuntu","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/create-a-deb-package-repository-at-sourceforge-net-using-reprepro-tool-in-ubuntu\/","title":{"rendered":"Create A \u201c.deb Package Repository\u201d at Sourceforge.net Using \u201cReprepro\u201d Tool in Ubuntu"},"content":{"rendered":"<p><b>Reprepro<\/b>\u00a0is a small command-line tool to create and manage\u00a0<b>.deb<\/b>\u00a0repositories easily, Today we\u2019ll be showing how to create a Debian package repositories easily using reprepro and how to upload it to Sourceforge.net using\u00a0<b>rsync<\/b>\u00a0command.<\/p>\n<div id=\"attachment_7628\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/06\/Create-Debian-Package-Repository1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7628\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2014\/06\/Create-Debian-Package-Repository1.png\" alt=\"Create Deb Package Repository\" width=\"593\" height=\"386\" aria-describedby=\"caption-attachment-7628\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p id=\"caption-attachment-7628\" class=\"wp-caption-text\">Create Deb Package Repository<\/p>\n<\/div>\n<h3>Step 1: Install Reprepro and Generate Key<\/h3>\n<p>First, install all the necessary packages, using the following apt-get command.<\/p>\n<pre>$ sudo apt-get install reprepro gnupg<\/pre>\n<p>Now you need to generate a gpg key using\u00a0<b>gnupg<\/b>, to do this, apply this command.<\/p>\n<pre>$ gpg --gen-key<\/pre>\n<p>It will ask you some questions, like the kind of the key you want, how long the key should be valid, if you don\u2019t know what to answer, just click\u00a0<b>Enter<\/b>\u00a0for the default options (recommended).<\/p>\n<p>Of course, it will ask you for a username and a password, keep those in mind, because we will need them later.<\/p>\n<pre>gpg (GnuPG) 1.4.14; Copyright (C) 2013 Free Software Foundation, Inc.\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.\r\n\r\nPlease select what kind of key you want:\r\n   (1) RSA and RSA (default)\r\n   (2) DSA and Elgamal\r\n   (3) DSA (sign only)\r\n   (4) RSA (sign only)\r\nYour selection? \r\nRSA keys may be between 1024 and 4096 bits long.\r\n<b>What keysize do you want? (2048)<\/b> \r\nRequested keysize is 2048 bits\r\nPlease specify how long the key should be valid.\r\n         0 = key does not expire\r\n        = key expires in n days\r\n      w = key expires in n weeks\r\n      m = key expires in n months\r\n      y = key expires in n years\r\n<b>Key is valid for? (0)<\/b> \r\nKey does not expire at all\r\n<b>Is this correct? (y\/N) Y<\/b>\r\n\r\nYou need a user ID to identify your key; the software constructs the user ID\r\nfrom the Real Name, Comment and Email Address in this form:\r\n    \"Heinrich Heine (Der Dichter) &lt;heinrichh@duesseldorf.de&gt;\"\r\n\r\n<b>Real name: ravisaive<\/b>\r\n<b>Email address: tecmint.com@gmail.com<\/b>\r\n<b>Comment: tecmint<\/b>\r\nYou selected this USER-ID:\r\n    <b>\"Ravi Saive (tecmint) &lt;tecmint.com@gmail.com&gt;\"<\/b>\r\n\r\n<b>Change (N)ame, (C)omment, (E)mail or (O)kay\/(Q)uit? O<\/b>\r\nYou need a Passphrase to protect your secret key.\r\n\r\nWe need to generate a lot of random bytes. It is a good idea to perform\r\nsome other action (type on the keyboard, move the mouse, utilize the\r\ndisks) during the prime generation; this gives the random number\r\ngenerator a better chance to gain enough entropy.\r\n\r\n+++++\r\ngpg: key 2EB446DD marked as ultimately trusted\r\npublic and secret key created and signed.\r\n\r\ngpg: checking the trustdb\r\ngpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model\r\ngpg: depth: 0  valid:   1  signed:   0  trust: 0-, 0q, 0n, 0m, 0f, 1u\r\npub   2048R\/2EB446DD 2014-06-24\r\n      Key fingerprint = D222 B1C9 342E 5911 02B1  9147 3BD6 7918 2EB4 46DD\r\nuid                  <b>Ravi Saive (tecmint) &lt;tecmint.com@gmail.com&gt;<\/b>\r\nsub   2048R\/7EF2F750 2014-06-24<\/pre>\n<p>Now your key will be generated, to Check if so, run this command as a root privileges.<\/p>\n<pre>$ sudo gpg --list-keys<\/pre>\n<h5>Sample Output<\/h5>\n<pre>\/home\/ravisaive\/.gnupg\/pubring.gpg\r\n----------------------------------\r\npub   2048R\/2EB446DD 2014-06-24\r\nuid                  <b>ravisaive (tecmint) &lt;tecmint.com@gmail.com&gt;<\/b>\r\nsub   2048R\/7EF2F750 2014-06-24<\/pre>\n<h3>Step 2: Create a Package Repository and Export Key<\/h3>\n<p>We\u2019ll start the work now to create the repository, first you have to create some folders, our repository will be in\u00a0<b>\/var\/www\/apt<\/b>\u00a0directory, so let\u2019s create some folders.<\/p>\n<pre>$ sudo su\r\n# cd \/var\/www\r\n# mkdir apt\r\n# mkdir -p .\/apt\/incoming \r\n# mkdir -p .\/apt\/conf\r\n# mkdir -p .\/apt\/key<\/pre>\n<p>You have now to export the key you created to the repository folder, run.<\/p>\n<pre># gpg --armor --export username yourmail@mail.com &gt;&gt; \/var\/www\/apt\/key\/deb.gpg.key<\/pre>\n<p><strong>Note<\/strong>: Replace username with the username you entered in above step, and\u00a0yourmail@mail.com\u00a0with your email.<\/p>\n<p>We need to create a file called \u201c<b>distributions<\/b>\u201d inside\u00a0<b>\/var\/www\/apt\/conf<\/b>.<\/p>\n<pre># touch \/var\/www\/apt\/conf\/distributions<\/pre>\n<p>Add these following lines to the distributions file and save the file.<\/p>\n<pre>Origin: (<b>yourname<\/b>)\r\nLabel: (<b>name of repository<\/b>)\r\nSuite: (<b>stable or unstable<\/b>)\r\nCodename: (<b>the codename for the distribution you are using, like trusty<\/b>)\r\nVersion: (<b>the version for the distribution you are using, like 14.04<\/b>)\r\nArchitectures: (<b>the repository packages  architecture, like i386 or amd64<\/b>)\r\nComponents: (<b>main restricted universe multiverse<\/b>)\r\nDescription: (<b>Some information about the repository<\/b>)\r\nSignWith: <b>yes<\/b><\/pre>\n<p>Next, We\u2019ll have to create the repository tree, to do this, run those commands.<\/p>\n<pre># reprepro --ask-passphrase -Vb \/var\/www\/apt export<\/pre>\n<h5>Sample Output<\/h5>\n<pre>Created directory \"\/var\/www\/apt\/db\"\r\nExporting Trusty...\r\nCreated directory \"\/var\/www\/apt\/dists\"\r\nCreated directory \"\/var\/www\/apt\/dists\/Trusty\"\r\nCreated directory \"\/var\/www\/apt\/dists\/Trusty\/universe\"\r\nCreated directory \"\/var\/www\/apt\/dists\/Trusty\/universe\/binary-i386\"\r\nFF5097B479C8220C ravisaive (tecmint) &lt;tecmint.com@gmail.com&gt; needs a passphrase\r\nPlease enter passphrase:\r\nSuccessfully created '\/var\/www\/apt\/dists\/Trusty\/Release.gpg.new'\r\nFF5097B479C8220C ravisaive (tecmint) &lt;tecmint.com@gmail.com&gt; needs a passphrase\r\nPlease enter passphrase:\r\n<b>Successfully created '\/var\/www\/apt\/dists\/Trusty\/InRelease.new'<\/b><\/pre>\n<h3>Step 3: Add Packages to Newly Created Repository<\/h3>\n<p>Now prepare your\u00a0<b>.deb<\/b>\u00a0packages to be added to the repository. Go to the\u00a0<b>\/var\/www\/apt<\/b>\u00a0directory, you have to do this each time you want to add packages.<\/p>\n<pre># cd \/var\/www\/apt\r\n# reprepro --ask-passphrase -Vb . includedeb Trusty \/home\/ravisaive\/packages.deb<\/pre>\n<p><strong>Note<\/strong>: Replace\u00a0<b>trusty<\/b>\u00a0with the codename you entered for the repository in the distributions file, and replace\u00a0<b>\/home\/username\/package.deb<\/b>\u00a0with the path to the package, you will be asked for the passphrase to enter.<\/p>\n<h5>Sample Output<\/h5>\n<pre>\/home\/ravisaive\/packages.deb : component guessed as 'universe'\r\nCreated directory \".\/pool\"\r\nCreated directory \".\/pool\/universe\"\r\nCreated directory \".\/pool\/universe\/o\"\r\nCreated directory \".\/pool\/universe\/o\/ojuba-personal-lock\"\r\nExporting indices...\r\nFF5097B479C8220C ravisaive (tecmint) &lt;tecmint.com@gmail.com&gt; needs a passphrase\r\n<b>Please enter passphrase:<\/b>\r\nSuccessfully created '.\/dists\/Trusty\/Release.gpg.new'\r\nFF5097B479C8220C ravisaive (tecmint) &lt;tecmint.com@gmail.com&gt; needs a passphrase\r\n<b>Please enter passphrase:<\/b>\r\nSuccessfully created '.\/dists\/Trusty\/InRelease.new'<\/pre>\n<p>Your package is added to the repository, to remove it.<\/p>\n<pre># reprepro --ask-passphrase -Vb \/var\/www\/apt remove trusty  package.deb<\/pre>\n<p>And of course, you need to modify the command with your package name and the repository codename.<\/p>\n<h3>Step 4: Upload Repository to Sourceforge.net<\/h3>\n<p>To upload the repository to\u00a0<b>Sourceforge.net<\/b>, you need to have a running account there of course, and a running project, let\u2019s assume that you want to upload the repository to\u00a0<b>http:\/\/sourceforge.net\/projects\/myfoo\/testrepository<\/b>\u00a0where myfoo is your project name (UNIX name, not URL, not the Title), and testrepository is the folder where you want to upload the files into, We will do this using\u00a0<a title=\"rsync command\" href=\"https:\/\/www.tecmint.com\/rsync-local-remote-file-synchronization-commands\/\" target=\"_blank\" rel=\"noopener\">rsync command<\/a>.<\/p>\n<pre># rsync -avP -e ssh \/var\/www\/apt\/ username@frs.sourceforge.net:\/home\/frs\/project\/myfoo\/testrepository\/<\/pre>\n<p><strong>Note<\/strong>: Replace username with your username on sourceforge.net and myfoo with your project UNIX-name and testrepository with the folder you want to store the files in.<\/p>\n<p>Now thats your repository is uploaded to\u00a0<b>http:\/\/sourceforge.net\/projects\/myfoo\/testrepository<\/b>, to add it to your installed system, first you have to import the repository key, it will be in\u00a0<b>\/var\/www\/apt\/key\/deb.gpg.key<\/b>, but that\u2019s a local path and the users for your repository won\u2019t be able to add it to their systems, thats why we\u2019ll be importing the key from sourceforge.net.<\/p>\n<pre>$ sudo su\r\n# wget -O - http:\/\/sourceforge.net\/projects\/myfoo\/testrepository\/apt\/key\/deb.gpg.key | apt-key add -<\/pre>\n<p>You can add the repository easily now to your system, open\u00a0<b>\/etc\/apt\/sources.list<\/b>\u00a0and add this line.<\/p>\n<pre>deb http:\/\/sourceforge.net\/projects\/myfoo\/testrepository\/apt\/key\/deb.gpg.key trusty main<\/pre>\n<p><strong>Note<\/strong>: Replace myfoo with your project UNIX-Name, trusty with your repository codename, testrepository with the folder you uploaded the files into, and main with repository components you added to the distributions file.<\/p>\n<p>Next, run following to update the repositories list.<\/p>\n<pre>$ sudo apt-get update<\/pre>\n<p><b>Congratulations!<\/b>\u00a0Your repository is active! You can now install packages easily from it if you want.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/create-deb-pacakge-repository-in-ubuntu\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reprepro\u00a0is a small command-line tool to create and manage\u00a0.deb\u00a0repositories easily, Today we\u2019ll be showing how to create a Debian package repositories easily using reprepro and how to upload it to Sourceforge.net using\u00a0rsync\u00a0command. Create Deb Package Repository Step 1: Install Reprepro and Generate Key First, install all the necessary packages, using the following apt-get command. $ &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/28\/create-a-deb-package-repository-at-sourceforge-net-using-reprepro-tool-in-ubuntu\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Create A \u201c.deb Package Repository\u201d at Sourceforge.net Using \u201cReprepro\u201d Tool in Ubuntu&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-12817","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=12817"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12817\/revisions"}],"predecessor-version":[{"id":12819,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/12817\/revisions\/12819"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=12817"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=12817"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=12817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}