Debian Repository: Difference between revisions

From CSCWiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
There is a CSClub Debian repository on [[Machine_List#sodium_benzoate|sodium-benzoate]].
There is a CSClub Debian repository on [[Machine_List#potassium-benzoate|potassium-benzoate]].

== Adding/updating a package ==


=== Step 0: Create a GPG key ===
=== Step 0: Create a GPG key ===


Use "gpg --gen-key" or something like that.
Use "gpg --gen-key" or something like that. Skip this if you already have one.


=== Step 1: Add to Uploaders ===
=== Step 1: Add to Uploaders ===


The /srv/debian/conf/uploaders file on mirror contains the list of people who can upload. Add your GPG key id to this file. Use "gpg --list-secret-keys" to find out the key ID.
The /srv/debian/conf/uploaders file on mirror contains the list of people who can upload. Add your GPG key id to this file. Use "gpg --list-secret-keys" to find out the key ID. You also need to import your key into the mirror's gpg homedir as follows:

gpg --export $KEYID | sudo env GNUPGHOME=/srv/debian/gpg gpg --import

You only need to do this step once.


=== Step 2: Get the source code ===
=== Step 2: Get the source code ===
Line 25: Line 31:
=== Step 3: Build the package ===
=== Step 3: Build the package ===


Just type "debuild -k04067B0B" in the debian directory. Replace the hex number with your key ID.
Just type "debuild -k04067B0B" in the debian directory. Replace the hex number with your key ID. If there are dependencies missing, you may be able to install them using "apt-get build-dep packagename". If not, then install them some other way.


=== Step 4: Upload the package ===
=== Step 4: Upload the package ===
Line 51: Line 57:


[[Category:Software]]
[[Category:Software]]

== Adding a repository ==

Instead of adding new repositories for software packages on each of our machines, add it to our Debian repository (which is already configured on all CSC machines). This saves us from hassles such as "where did this package come from?", "I need to install this key on each machine", installing the same package repository on all machines, etc. It also makes these packages available to machines hosted on the private subnets (ex. cloud) that cannot access the internet.

=== Step 0: Get Repository Information ===

Things you need:

* URL for the repository
* GPG key used by the repository

=== Step 1: Add the GPG Key ===

On potassium-benzoate:

curl [GPG Key URL] | sudo env GNUPGHOME=/srv/debian/gpg gpg --import

=== Step 2: Add the repository ===

Update the contents of /srv/debian/conf/updates. Based on example, given a URL of ''http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main'':

Name: openstack
Method: http://ubuntu-cloud.archive.canonical.com/ubuntu
Suite: xenial-updates/newton
Components: main
Architectures: amd64
VerifyRelease: EC4926EA

The key for 'VerifyRelease' can be retrieved by running ''sudo env GNUPGHOME=/srv/debian/gpg gpg --import''.

Update the contents of /srv/debian/conf/distributions and add it to the ''Update:'' line for the desired distribution. The name is from the ''Name'' field entered in the updates file.

=== Step 3: Update the repository ===

Run:

sudo /srv/debian/bin/rrr-update

to do the initial download of packages. This script will be run periodically throughout the day (currently every 4 hours).

== Adding/updating a distribution ==
If there is a new Debian release (e.g. "bullseye"), make sure to edit both conf/distributions and conf/incoming (use the other sections as examples). You should then be able to dupload normally.

Latest revision as of 19:22, 2 November 2021

There is a CSClub Debian repository on potassium-benzoate.

Adding/updating a package

Step 0: Create a GPG key

Use "gpg --gen-key" or something like that. Skip this if you already have one.

Step 1: Add to Uploaders

The /srv/debian/conf/uploaders file on mirror contains the list of people who can upload. Add your GPG key id to this file. Use "gpg --list-secret-keys" to find out the key ID. You also need to import your key into the mirror's gpg homedir as follows:

gpg --export $KEYID | sudo env GNUPGHOME=/srv/debian/gpg gpg --import

You only need to do this step once.

Step 2: Get the source code

To get the source code of a debian package you can use "apt-get source packagename". You can also download the requisite files from the web; the easy way is to run the dget command on the path to the .dsc file. For example:

dget http://ppa.launchpad.net/daltenty/boxes/ubuntu/pool/main/b/bullet/bullet_2.77+svn2218-1.dsc

Step 2.5: Make changes

If necessary, you can haxor the source code now. If you make changes run something like

EMAIL=you@csclub.uwaterloo.ca NAME="Your Name" dch -i

And optionally write some notes about the changes. This step is needed to increment the version number; if the version number is not greater than the one available from ubuntu the packages will NOT be installed. Furthermore you cannot upload the same version number twice.

Step 3: Build the package

Just type "debuild -k04067B0B" in the debian directory. Replace the hex number with your key ID. If there are dependencies missing, you may be able to install them using "apt-get build-dep packagename". If not, then install them some other way.

Step 4: Upload the package

Building will create a .changes file in the parent directory. If the file failed to properly sign (e.g. you typed your password wrong 3 times) you cam reattempt signing by running "debsign -k04067B0B foo.changes" (and changing the hex number to your key ID). Once signed, you can upload.

To add a newly built package type the following after building:

dupload packages.changes

Step 5: Update the Repository

Log into mirror and type "sudo rrr-incoming". This is supposed to happen once every few minutes however it is always faster to run it manually.

Step 6: Install the package

Just install the package with apt-get as normal. Don't forget to run "apt-get update" first.

Configuring Machines

The /etc/apt/sources.list entry is:

deb http://debian.csclub.uwaterloo.ca/ [distribution] main
deb-src http://debian.csclub.uwaterloo.ca/ [distribution] main

Adding a repository

Instead of adding new repositories for software packages on each of our machines, add it to our Debian repository (which is already configured on all CSC machines). This saves us from hassles such as "where did this package come from?", "I need to install this key on each machine", installing the same package repository on all machines, etc. It also makes these packages available to machines hosted on the private subnets (ex. cloud) that cannot access the internet.

Step 0: Get Repository Information

Things you need:

  • URL for the repository
  • GPG key used by the repository

Step 1: Add the GPG Key

On potassium-benzoate:

 curl [GPG Key URL] | sudo env GNUPGHOME=/srv/debian/gpg gpg --import

Step 2: Add the repository

Update the contents of /srv/debian/conf/updates. Based on example, given a URL of http://ubuntu-cloud.archive.canonical.com/ubuntu xenial-updates/newton main:

 Name: openstack
 Method: http://ubuntu-cloud.archive.canonical.com/ubuntu
 Suite: xenial-updates/newton
 Components: main
 Architectures: amd64
 VerifyRelease: EC4926EA

The key for 'VerifyRelease' can be retrieved by running sudo env GNUPGHOME=/srv/debian/gpg gpg --import.

Update the contents of /srv/debian/conf/distributions and add it to the Update: line for the desired distribution. The name is from the Name field entered in the updates file.

Step 3: Update the repository

Run:

 sudo /srv/debian/bin/rrr-update

to do the initial download of packages. This script will be run periodically throughout the day (currently every 4 hours).

Adding/updating a distribution

If there is a new Debian release (e.g. "bullseye"), make sure to edit both conf/distributions and conf/incoming (use the other sections as examples). You should then be able to dupload normally.