hpn-ssh icon indicating copy to clipboard operation
hpn-ssh copied to clipboard

apt repo sources configuration?

Open mpounsett opened this issue 9 months ago • 4 comments

There doesn't seem to be any install-from-packages documentation here that I can find. Looking at old tickets can lead someone to https://sourceforge.net/projects/hpnssh/files/Debian%20Packages/ (for Debian/dpkg) ... and that leads to https://download.opensuse.org/repositories/home:/rapier1 . That almost looks like an apt repository, but not quite.. I'm wondering if it's possible to construct a working sources.list entry for that repo, or if we're expected to manually download packages from there to install? I'm not an apt expert, and have not been able to figure out a sources entry that works.

And would it be possible to add pointers to the README here, of that's appropriate?

Thanks!

mpounsett avatar Mar 13 '25 18:03 mpounsett

I can certainly give it a try but I have to be honest that I've no experience with debian packages. Launchpad does it all for me as far as I can tell. Do you have any pointers or can you lend a hand in some way?

I'm pretty much unable to work on this today and working on it this weekend might not be possible. This is on my list and I will start working on it no later than Tuesday.

rapier1 avatar Mar 14 '25 15:03 rapier1

If Launchpad is doing the setup for you, presumably they also provide you with info on how to make use of the repo? I'd start there. Sorry, I'm probably no help. If I could have figured out a sources entry for the repository that's there, I'd have done that (and provided it here).

No rush from me. I'm still manually downloading and installing updates. Consider this a nice-to-have from my perspective.

mpounsett avatar Mar 14 '25 16:03 mpounsett

Hi @mpounsett,

Through Launchpad, we have a "PPA" configured, which is a miniature apt repository, yes. We currently use that to provide binaries for all three active Ubuntu LTS releases: 20.04, 22.04, and 24.04. You can find more details here: https://launchpad.net/~rapier1/+archive/ubuntu/hpnssh

On that page, you can find this command to add our PPA repository to your system, which is generally preferred over directly modifying your sources.list by hand:

sudo add-apt-repository ppa:rapier1/hpnssh

However, if you prefer, you can also press "Technical details about this PPA" to show the specific lines you can manually add to sources.list to enable our repository. Each version of Ubuntu gets a custom-tailored build, so you need to specify a specific version (by its codename) to get enable the correct repository. You should choose one of these; don't add all three:

# For Ubuntu 24.04 (codename Noble Numbat):
deb https://ppa.launchpadcontent.net/rapier1/hpnssh/ubuntu noble main 
deb-src https://ppa.launchpadcontent.net/rapier1/hpnssh/ubuntu noble main

# For Ubuntu 22.04 (codename Jammy Jellyfish):
deb https://ppa.launchpadcontent.net/rapier1/hpnssh/ubuntu jammy main 
deb-src https://ppa.launchpadcontent.net/rapier1/hpnssh/ubuntu jammy main

# For Ubuntu 20.04 (codename Focal Fossa):
deb https://ppa.launchpadcontent.net/rapier1/hpnssh/ubuntu focal main 
deb-src https://ppa.launchpadcontent.net/rapier1/hpnssh/ubuntu focal main

Once you add the repository (using add-apt-repository or by editing sources.list), you'll need to tell apt to update its database of available packages that you can install:

sudo apt update

After that, you should be able to install HPN-SSH like any another software package. We choose our package names to mirror the ones openssh uses. I recommend using the hpnssh metapackage, which provides a standard installation with both the client and server components.

sudo apt install hpnssh

The information about our PPA (and our other binary releases) is included on our wiki (https://github.com/rapier1/hpn-ssh/wiki) and on our home page (https://hpnssh.org), but I agree that perhaps this information should be more prominent.

Finally, it also occurs to me that you may be running Debian instead of Ubuntu. As you found, our official Debian builds are served from openSUSE's build system. Debian and Ubuntu use the same packaging system, so our launchpad repository might work, but I haven't personally tested it, and I do not recommend it. People encounter a lot of headaches when installing Ubuntu packages on Debian systems. If you want to give it a try anyway, here's what I found on how versions of Debian correspond to versions of Ubuntu:

Debian 13,   trixie/sid --> Ubuntu 24.04, Noble Numbat
Debian 12, bookworm/sid --> Ubuntu 22.04, Jammy Jellyfish
Debian 11, bullseye/sid --> Ubuntu 20.04, Focal Fossa

So you would add lines to sources.list that correspond to the version of Ubuntu that is based on the your version of Debian. Again, try that at your own risk -- we are not likely to be able to help you if you encounter problems along the way.

I also found some instructions for configuring an openSUSE-hosted repository on a Debian system, but I haven't personally tested any of this, either, so again, proceed at your own risk. I think it should work, in theory, though. The problem may come down the line when the keys expire for these manually-reconfigured repositories.

First, you need to register our signing key on your system. Grab a copy of it by downloading it manually or using a command like this:

wget https://download.opensuse.org/repositories/home:/rapier1/Debian_12/Release.key -O hpnssh_opensuse.key

(The name Release.key is very likely to be the same as other signing keys, so I suggest renaming it to something like hpnssh_opensuse.key) Now convert the key to they type needed by Debian, and copy it to an appropriate location It can go anywhere, but it should be a secure location which is not writable by unprivileged users.

gpg --no-default-keyring --keyring ./temp-hpnssh-keyring.gpg --import hpnssh_opensuse.key
gpg --no-default-keyring --keyring ./temp-hpnssh-keyring.gpg --export --output hpnssh_opensuse.gpg
rm -f temp-hpnssh-keyring.gpg
sudo mkdir -p /etc/apt/keyrings
sudo cp -i hpnssh_opensuse.gpg /etc/apt/keyrings/hpnssh_opensuse.gpg

You can now add the repository, either by a command or by manually editing your sources.list. Depending on your version of Debian, you should be able to add the repository using one of these two commands (choose the one that matches your version). Note that either command is a single line; GitHub may wrap the line for readability, but you should enter it all on one line, from sudo to the end of the quoted part (./'):

# For Debian 12, bookworm:
sudo apt-add-repository 'deb [signed-by=/etc/apt/keyrings/hpnssh_opensuse.gpg]
 https://download.opensuse.org/repositories/home:/rapier1/Debian_12/ ./'

# For Debian 11, bullseye:
sudo apt-add-repository 'deb [signed-by=/etc/apt/keyrings/hpnssh_opensuse.gpg]
 https://download.opensuse.org/repositories/home:/rapier1/Debian_11/ ./'

... OR, you can manually add the repository using one of these two entries, and again, either one should be entered as a single line, from deb to the final /:

# For Debian 12, bookworm:
deb [signed-by=/etc/apt/keyrings/hpnssh_opensuse.gpg] https://download.opensuse.org/repositories/home:/rapier1/Debian_12/ ./

# For Debian 11, bullseye:
deb [signed-by=/etc/apt/keyrings/hpnssh_opensuse.gpg] https://download.opensuse.org/repositories/home:/rapier1/Debian_11/ ./

Now that the repository is enabled, the rest is the same as the instructions for Ubuntu, above (i.e., sudo apt update, sudo apt install hpnssh)

I'm not an expert on Debian and Ubuntu platforms, and although there are more steps involved and it may stop working when keys expire, I do think the Debian packages are more likely to work better on a Debian system.

Please let me know if you decide to try any of these approaches, and if so, how they turn out. Other people may find this thread in the future, hoping to do a similar thing.

dorrellmw avatar Mar 14 '25 22:03 dorrellmw

https://github.com/rapier1/hpn-ssh/discussions/65#discussioncomment-8359796

I made detailed instructions for Debian users while trying my best to follow the best practice, hope it will help.


Here are the tips for the Debian users:

1. Manually add the package source

. /etc/os-release
suites="Debian_${VERSION_ID}"

sudo mkdir -p --mode=0755 /usr/share/keyrings
out=$(mktemp -u)
if curl -fsSL "https://download.opensuse.org/repositories/home:/rapier1/${suites}/Release.key" \
    | gpg --dearmor | sudo tee "$out" > /dev/null; then
    sudo \mv -f "$out" /usr/share/keyrings/rapier1-hpnssh.gpg
fi

cat << EOF | sudo tee /etc/apt/sources.list.d/hpnssh.sources
Types: deb
URIs: https://download.opensuse.org/repositories/home:/rapier1/${suites}/
Suites: /
Signed-By: /usr/share/keyrings/rapier1-hpnssh.gpg
EOF

2. Install the hpnssh-server package

sudo chmod 644 /usr/share/keyrings/rapier1-hpnssh.gpg /etc/apt/sources.list.d/hpnssh.sources \
    && sudo apt-get update -qq \
    && sudo apt-get install -y hpnssh-client hpnssh-server hpnssh-sftp-server

sudo systemctl enable --now hpnssh.service
systemctl is-enabled hpnssh.service

IceCodeNew avatar Apr 09 '25 09:04 IceCodeNew

Thank you! I'll add this to our instruction set!

rapier1 avatar Apr 10 '25 14:04 rapier1

These instructions will be available on hpnssh.org in the next week. Thanks again.

rapier1 avatar Oct 02 '25 20:10 rapier1

That's fantastic. Thanks very much!

mpounsett avatar Oct 05 '25 08:10 mpounsett