Skip to content

Instantly share code, notes, and snippets.

@dbiesecke
Last active August 20, 2022 07:23
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dbiesecke/5ecd3d5d2de50bcd30aa to your computer and use it in GitHub Desktop.
Save dbiesecke/5ecd3d5d2de50bcd30aa to your computer and use it in GitHub Desktop.
Simple gist to show the aptly magic :)

Aptly Real-Live example

Install Repo

$ echo 'deb http://repo.aptly.info/ squeeze main' > /etc/apt/sources.list.d/aptly.list && wget -qO - https://www.aptly.info/pubkey.txt | sudo apt-key add -

$ apt-get update && apt-get install -y -f aptly

Example to build a grml-repo with extras.

Install Repo

$ wget -qO- http://deb.foilo.de/repo-key.asc | sudo apt-key add --

$ echo 'deb http://deb.foilo.de/ ubuntu main ' > /etc/apt/sources.list.d/foilo.lis

$ apt-get update

For Publishing

  • first install gpg & create new key with gpg --gen-key

  • Edit all your needed arch's to ~/.aptly.conf. Example:

          {
            "rootDir": "/var/www/aptly",
            "downloadConcurrency": 4,
            "architectures": ["amd64","armhf"],
            "dependencyFollowSuggests": false,
            "dependencyFollowRecommends": false,
            "dependencyFollowAllVariants": true,
            "dependencyFollowSource": false,
            "gpgDisableSign": false,
            "gpgDisableVerify": false,
            "downloadSourcePackages": false,
            "ppaDistributorID": "ubuntu",
            "ppaCodename": ""
          }
    
  • Now make http config or use aptly serve to listen on port 8080 & serve your repo's

  • Example lighttp config:

          $HTTP["url"] =~ "^/apt($|/)" {
                  server.dir-listing = "enable"
                  server.document-root = "/var/www/aptly/public/"
          }
    

Add local files

Create a a new repo with aptly repo create <testing> or use a mirror

        aptly repo add testing pac-4.5.4-all.deb

Add files from other repo

       aptly -dep-follow-all-variants=true  mirror create grml-testing http://deb.grml.org/ grml-testing 
       aptly mirror update grml-testing
  • Now we copy grml-autoconfig from grml-testing to our repo

         aptly -dep-follow-all-variants=true repo import grml-testing testing grml-autoconfig
    
  • Add package from ppa

          aptly -architectures="amd64"  mirror create scribes http://ppa.launchpad.net/mystilleef/scribes-daily/ubuntu quantal main        
    
  • Create snapshot from mirror

          aptly snapshot create grml-snap from mirror grml-test 
    

Made your own deb-repo

Start - Dont forgett this!

Your should have gnugpg keys!!! You will need it for sign & publish

  • Create grml-test mirror as debian base aptly -architectures="amd64" mirror create grml-test http://deb.grml.org/ grml-testing

Add own ppa to your Repo

Your should beginn with

  • Add a upstream ppa to oure list aptly mirror create jdownloader-latest http://ppa.launchpad.net/jd-team/jdownloader/ubuntu trusty aptly mirror update jdownloader-latest

  • Now we add jdownloader-latest to our repo testing and main aptly repo import jdownloader-latest testing main aptly publish update testing

  • Create local repo, for your own shit ( local debs ) aptly repo create local-repo aptly repo add testing node_0.10.29-1_amd64.deb

  • Publish aptly publish update ubuntu

  • Lighttpd.conf ( Bsp: /etc/lighttpd/conf-enabled/20-main.conf )

      $HTTP["host"] =~ "^(?i:deb\.foilo\.de(?::\d+)?)$" {
              server.dir-listing = "enable"
           server.document-root = "/var/www/aptly/public/"
      }
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment