Debian Repository: Difference between revisions

From CSCWiki
Jump to navigation Jump to search
m (Protected "Debian repository": Prevent PGP key vandalism [edit=sysop:move=sysop])
mNo edit summary
 
(30 intermediate revisions by 5 users not shown)
Line 1: Line 1:
There is a CSC debian repository on natural-flavours.
There is a CSClub Debian repository on [[Machine_List#potassium-benzoate|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:
To add a newly built package type the following after building:


dupload packages.changes
GNUPGHOME=/srv/debian/gpg reprepro -Vb /srv/debian include path/to/changes


=== Step 5: Update the Repository ===
or


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.
To add a newly built deb package type the following after building:


=== Step 6: Install the package ===
GNUPGHOME=/srv/debian/gpg reprepro -Vb /srv/debian includedeb path/to/changes

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:
The /etc/apt/sources.list entry is:


deb http://natural-flavours.csclub.uwaterloo.ca/debian [version] [branch]
deb http://debian.csclub.uwaterloo.ca/ [distribution] main
deb-src http://natural-flavours.csclub.uwaterloo.ca/debian [version] [branch]
deb-src http://debian.csclub.uwaterloo.ca/ [distribution] main

[[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
The public key is:


to do the initial download of packages. This script will be run periodically throughout the day (currently every 4 hours).
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.6 (GNU/Linux)


== Adding/updating a distribution ==
mI0ERleW/QEEALaKYSQjNCptyl7s689hN2GFiuBTdrtVYhchbBfU1BNwNxgkPPR8
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.
Gbw9BcmqPS+GJv4ND56NhcGHPhULuTgww9kwL8msSl5PecbMvOFwBOu0xnO1Ko7y
KWhci4TRj+YkcNLdol/rZDTY/0DKahqze4wJWJZZ/sgf5W9ux1W7aUwrABEBAAG0
NkNTQyBBcmNoaXZlIFNpZ25pbmcgS2V5IDxzeXNhZG1pbkBjc2NsdWIudXdhdGVy
bG9vLmNhPoi2BBMBAgAgBQJGV5b9AhsDBgsJCAcDAgQVAggDBBYCAwECHgECF4AA
CgkQQ+Hcd7Ut3yHIaQP/ei7LgoLjX8WlhATBLFh7X1exgrCSnW4qdswmcIVJQNmG
Ai63wtPqYFYWT+adfYh7bYa9DX6d6wn1Ou0BHBSqJrQZyMP2UEjN2GZ18SMNceGB
ZvrjC7JmJCEQEXZC7u99VJk6r1PCuvYwvTv5dPFQy0UKpljoQRYKSFAnaEht1XyZ
AaIEQr+MQxEEALR8hWU/CTj12GasSwRAwO8sp8puZGkm1zGHbTq6hXFuolKfzDda
OAuLXEcQpI0ePWfWjg+/1o1QmlULZDPXddgC5YtYoAQrsOvHf0hc8HphSeDN2sHz
cUMMTeYfruGNfmjlV/R1k7P3ln0reWLLZXajVrXC8FuO2X0uC4V98LFLAKCseYGZ
kDM2h1y912ycc7VCtbrSKQP9Fkl3k/PxuarrZ6QJBeOtaZ/VoDEZTY0v6qe/b3xl
tFFMwmltjNCyjd3v8b5cQb5IiTaynFOY/pJ9Ha+7f57crShDx/jrNn15vVONudYi
AZV0d/rJgofYUFIOhd9O6RqunYEZwY3rX0rAFVZvFPwyegTd/A30WCHsvq7yFbmN
kzkD/Ak31xakrwfFwwWq2LcaYdljlSCK7c7z8fB9ywwtfyuguweStvb/8NVS4bU1
A5VS57SX60byW8JV7S/QF4ZVNZ0s7iP9gG81RXKfnf4TJ8itsre3L970/vEB3RyG
VSod1p7/Oi7J4WCTIP4Ip3bqDyQ/W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Nt6hAvNqo/AJwNAMdOnGZEhvAQwek/Ph/4wSn6cwCgnVTN
2lHSeTMf4Cf8MtUDTU4/g1m5Ag0ERn85WhAIAKMJ3PrBK3AXr4OCu6ZHy0Hy+noG
1ZGKP+zLbju+rPAEo6v1IklaOODz2j1ZnY90Czvc5cE9qk7+20mTphZZRm+2uDss
Exr+41EEjF5apBGV3Anqwrjog6rh80WloLyUKyDeyu9z7vllvKwNMCwHjT/thFby
JOy201xDoABV49Y9vEAm1Jc6BTitk6mBRuxgvJmSp0/qx+lp9pTzgGBJ7UrCIDfi
tjiecYl8oHsovBrx7uoVXUImT40tRTNHsG7MIHD98Y9xb3VfvtOb+1N1lwtZ+TyJ
vSdJL14kH3fnizOoC7vz3PaMoKWcuaVE8HsmTgz0NitvjoNfUfyprpToe+cAAwUH
/2o3dYkOnEoDN03TYegiLP1t5VB9QY565HdCQuKNjIsUNu4OKWgF5JML2GnMJkTn
QM1hKl/2LIdgundZHxNM4gvSTQ2eRkNzkyaKdmgTl87LZ/K2s6jGI46HLoMyN9rL
fJe6f1n7sH2WlZoymlJrzafaXuCDbqeQU9ko+NflG0fyoouzhXhvjSGb3ryh35Ds
UTxhO4Rc/8h6uA9wOBLKIm5krG0PsS2+3V+T/8j8aw1Hpdo1eGavmX9O8o/iRJuq
ahLcZVQYSMTddNjXvOJ8wBCT03Gs0gGQyZvXJiYx+RMMGIW9kgLMoMF+QnB4i84S
5RWe/JK9p3LVKI4k2DjEgGGISQQYEQIACQUCRn85WgIbDAAKCRCetJNt6hAvNuvT
AJ9uoWUYNivtFIFv6Y7cYNwgjf8i1gCgwGEi0rWKqfpYONwTUu4IgHJEsz4=
=UOWp
-----END PGP PUBLIC KEY BLOCK-----

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.