Skip to content

Instantly share code, notes, and snippets.

@prbinu
Created October 12, 2018 21:59
Show Gist options
  • Save prbinu/2ec8fd91071f20eadfc5c87d20340c50 to your computer and use it in GitHub Desktop.
Save prbinu/2ec8fd91071f20eadfc5c87d20340c50 to your computer and use it in GitHub Desktop.
How to build (and install) OpenSSH 7.4 deb packages on Ubuntu-16.04
# on a fresh Ubuntu 16.04 host
sudo apt-get update
# copy the packages from https://launchpad.net/debian/+source/openssh/1:7.4p1-10+deb9u3
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1-10.dsc
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1-10.debian.tar.xz
tar -zxvf openssh_7.4p1.orig.tar.gz
tar -xvf openssh_7.4p1-10.debian.tar.xz
# install build dep packages
sudo apt-get install -t xenial-backports devscripts autotools-dev debhelper dh-autoreconf dh-exec dh-systemd libaudit-dev libedit-dev libgtk-3-dev libkrb5-dev libpam-dev libselinux1-dev libssl-dev libwrap0-dev zlib1g-dev libsystemd-dev -y
sudo apt-get install build-essential fakeroot dpkg-dev
dpkg-source -x openssh_7.4p1-10.dsc
cd openssh-7.4p1/
dpkg-buildpackage -rfakeroot -b
# now package would have been succesfully built on root directory (cd ../)
cd ..
ls -ltr *.deb
# lets install new openssh deb package
#stop ssh
sudo systemctl stop ssh
#install
sudo dpkg -i --force-confold openssh-client_7.4p1-10_amd64.deb openssh-server_7.4p1-10_amd64.deb openssh-sftp-server_7.4p1-10_amd64.deb
# check the version now
ssh -V
@prbinu
Copy link
Author

prbinu commented Oct 18, 2018

@BrixSat
Copy link

BrixSat commented Mar 8, 2023

On a fresh 14.04 ubuntu

Copy packages

wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1-10.dsc
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1.orig.tar.gz
wget https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/openssh/1:7.4p1-10/openssh_7.4p1-10.debian.tar.xz

Decompress the code

tar -zxvf openssh_7.4p1.orig.tar.gz
tar -xvf openssh_7.4p1-10.debian.tar.xz

Install build dep packages

sudo apt install -y build-essential libssl-dev zlib1g-dev libc6 libc6-dev fakeroot dpkg-dev devscripts autotools-dev debhelper dh-autoreconf dh-exec dh-systemd libaudit-dev libkrb5-dev libpam-dev libselinux1-dev libssl-dev libwrap0-dev zlib1g-dev  libedit-dev libsystemd-daemon-dev  libx11-dev
sudo apt-get install build-essential fakeroot dpkg-dev

Prepare the deb file

dpkg-source -x openssh_7.4p1-10.dsc
cd openssh-7.4p1/

Take a coffee and relax a little

dpkg-buildpackage -rfakeroot -b

now package would have been succesfully built on root directory (cd ../)

cd ..
ls -ltr *.deb

lets install new openssh deb package by stopping it first

sudo systemctl stop ssh

Install it

sudo dpkg -i --force-confold openssh-client_7.4p1-10_amd64.deb openssh-server_7.4p1-10_amd64.deb openssh-sftp-server_7.4p1-10_amd64.deb

check the version now

ssh -V

Ask your boss for a raise :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment