Changes between Initial Version and Version 1 of MakeLocalUbuntuRepo


Ignore:
Timestamp:
09/03/14 12:12:35 (10 years ago)
Author:
rrhain@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MakeLocalUbuntuRepo

    v1 v1  
     1
     2{{{
     31.Install dpkg-dev
     42.Put the packages in a directory
     53.Create a script that will scan the packages and create a file apt-get update can read
     64. Add a line to your sources.list pointing at your repository
     7
     8Install dpkg-dev
     9
     10Type in a terminal
     11
     12sudo apt-get install dpkg-dev
     13
     14The Directory
     15
     16Create a directory where you will keep your packages. For this example, we'll use /usr/local/mydebs.
     17
     18sudo mkdir -p /usr/local/mydebs
     19
     20Now move your packages into the directory you've just created.
     21
     22Previously downloaded Packages are generally stored on your system in the /var/cache/apt/archives directory. If you have installed apt-cacher you will have additional packages stored in its /packages directory.
     23
     24The Script update-mydebs
     25
     26It's a simple three liner:
     27
     28#! /bin/bash
     29 cd /usr/local/mydebs
     30 dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
     31
     32Cut and paste the above into gedit, and save it as update-mydebs in ~/bin. (the tilde '~' means your home directory. If ~/bin does not exist, create it: Ubuntu will put that directory in your PATH. It's a good place to put personal scripts). Next, make the script executable:
     33
     34chmod u+x ~/bin/update-mydebs
     35
     36How the script works:
     37
     38dpkg-scanpackages looks at all the packages in mydebs, and the output is compressed and written to a file (Packages.gz) that apt-get update can read (see below for a reference that explains this in excruciating detail). /dev/null is an empty file; it is a substitute for an override file which holds some additional information about the packages, which in this case is not really needed. See deb-override(5) if you want to know about it.
     39
     40Sources.list
     41
     42add the line
     43
     44deb file:/usr/local/mydebs ./
     45
     46to your /etc/apt/sources.list, and you're done.
     47
     48CD Option
     49
     50You can burn the directory containing the debs to a CD and use that as a repository as well (good for sharing between computers). To use the CD as a repository, simply run
     51
     52sudo apt-cdrom add
     53
     54Using the Repository
     55
     56Whenever you put a new deb in the mydebs directory, run
     57
     58sudo update-mydebs
     59sudo apt-get update
     60
     61Now your local packages can be manipulated with Synaptic, aptitude and the apt commands: apt-get, apt-cache, etc. When you attempt to apt-get install, any dependencies will be resolved for you, as long as they can be met.
     62
     63Badly made packages will probably fail, but you won't have endured dpkg hell.
     64
     65}}}