Creating a local deb folder repo for apt usage

Forum Forums General Software Creating a local deb folder repo for apt usage

  • This topic has 4 replies, 3 voices, and was last updated Mar 23-9:05 am by Anonymous.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #56256
    Anonymous

      1. It’s recommended to be up to date so first run

      sudo apt-get update

      and

      sudo apt-get upgrade

      2. You will need the dpkg-dev package installed to use dpkg-scanpackages command.

      sudo apt-get install dpkg-dev

      3. Create a folder for downloaded deb packages. This can be in your home folder or a
      samba share as well.

      sudo mkdir -p /usr/local/debs

      then place any downloaded packages in it. /usr/local directory will need sudo or root
      permissions to copy them into it.

      4. cd into that folder and create the file update-debs.sh to contain these lines.

      #! /bin/bash
      cd /usr/local/debs
      dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
      

      5. make the script executable.

      sudo chmod u+x ./update-debs.sh

      6. move the script to /usr/bin. Can run from the folder each time if it is in your home folder.

      sudo mv ./update-debs.sh /usr/bin/update-debs.sh

      7. Open /etc/apt/sources.list in an editor as root and add this to it.

      deb [ trusted=yes ] file:/usr/local/debs ./

      8. run update-debs.sh

      sudo update-debs.sh

      for globally or

      sudo ./update-debs.sh

      if it’s in your home folder.

      9. run apt

      sudo apt-get update

      then

      sudo apt-get install {package name}

      say yes to installing an unverified package.

      10. when you add deb packages to the folder must run

      sudo apt-get update-debs

      and

      sudo apt-get update

      each time for apt to see the new packages. After updating the debs they will
      also show up in synaptic.

      #56281
      Member
      andyprough
        Helpful
        Up
        0
        ::

        Thank you, this is really awesome! The amount of detail you’ve given is absolutely perfect.

        Can you tell us the value of this beyond just installing one package at a time, which I do with ‘sudo apt install ./package-name.deb’? I could see maybe using this to install a larger number of locally downloaded packages at one time. Or setting up a script to automatically download github/gitlab updates of my favorite programs for installation, and then using this method as part of my system-wide updating.

        #56282
        Anonymous
          Helpful
          Up
          0
          ::

          @andyprough

          if you have several packages in the folder the update will make them show up in synaptic.
          This is a lot simpler and not as thorough as Xecures yad-bash project. As this doesn’t use X-windows.
          not sure if a

          sudo apt-get install /usr/local/*.deb

          would work will have to try it here on a test setup soon.

          @moderator should this thread have been under tips and tricks instead of software?

          #56298
          Member
          Xecure
            Helpful
            Up
            0
            ::

            Just be sure that the source.list contains
            deb [ trusted=yes ] file:/usr/local/debs ./
            Or you will have trouble with apt, as it cannot find any signed gpg/pgp file to verify the local repo, you need to tell it to trust this source.

            You can use the gui program I created for local repo management that includes most of those instructions automatically if someone prefers it.
            https://www.antixforum.com/forums/topic/apt-based-offline-repo-small-yad-bash-project/

            • This reply was modified 2 years, 1 month ago by Xecure.

            antiX Live system enthusiast.
            General Live Boot Parameters for antiX.

            #56300
            Anonymous
              Helpful
              Up
              0
              ::

              Thanks @Xecure,

              That’s why I had apt-get instead of just apt is it only gives a warning
              not an error for signed gpg/pgp. I added that to the original post.
              I still have to read your whole thread on yad-bash project.

            Viewing 5 posts - 1 through 5 (of 5 total)
            • You must be logged in to reply to this topic.