Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian/Ubuntu packages #718

Closed
dbarnett opened this Issue Dec 2, 2014 · 76 comments

Comments

Projects
None yet
@dbarnett
Copy link

dbarnett commented Dec 2, 2014

Would it be possible to provide deb packages to easily install hub on Ubuntu and Debian?

@petro-rudenko

This comment has been minimized.

Copy link

petro-rudenko commented Dec 5, 2014

+1

1 similar comment
@slang800

This comment has been minimized.

Copy link

slang800 commented Dec 15, 2014

+1

@davidshepherd7

This comment has been minimized.

Copy link

davidshepherd7 commented Dec 18, 2014

This would be great

@mislav

This comment has been minimized.

Copy link
Member

mislav commented Dec 23, 2014

It's always possible to provide packages for anything. The question is, will we be willing to do it? I never made a Debian package, so I don't know how it's done. I'm sure it's technically easy, but where do they get submitted and how do they get accepted?

If someone does research for this, we could integrate it in our release process.

@dbarnett

This comment has been minimized.

Copy link
Author

dbarnett commented Dec 23, 2014

You can build a deb package and upload it to github and/or to a PPA without needing anyone to accept anything. Submitting it to be included with Debian/Ubuntu is a nice-to-have, but it would take a while before it's available through the distros.

@dbarnett

This comment has been minimized.

Copy link
Author

dbarnett commented Dec 23, 2014

Here's a StackOverflow question about how to build deb packages for go projects: http://stackoverflow.com/questions/15104089/packaging-golang-application-for-debian. Sounds like there's no fancy tool, you'd just use dpkg-buildpackage and possibly copy deb package configuration from existing go projects.

@mislav

This comment has been minimized.

Copy link
Member

mislav commented Dec 23, 2014

That SO answer warps my little brain a little bit. I don't even know what
half of those terms are referring to. We literally want to distribute just
one precompiled binary, plus 2 optional shell completion scripts (if such a
thing can be distributed with deb packages at all).

@jingweno

This comment has been minimized.

Copy link
Collaborator

jingweno commented Dec 23, 2014

I bookmarked this tool a while ago. Maybe it'd help.

@gsuess

This comment has been minimized.

Copy link

gsuess commented Mar 1, 2015

@mislav ubuntu and debian support more than one architecture, so one pre-compiled binary will not be enough unless for some reason you want to only support x86 or x64. However cross-compiling go shouldn't be that hard.

The SO answer mentioned here tells you how to generate a .deb package. This is a package file that contains the pre-compiled binaries and a list of dependencies.

Once you have a .deb for each architecture and ubuntu/debian version that you wish to support you can immediately distribute it through a PPA as has been mentioned by dbarnett. I guess this answer may be helpful: http://askubuntu.com/a/71516/49920

You can then request it to be posted to the debian repositories:
https://wiki.debian.org/DebianMentorsFaq#How_do_I_make_my_first_package.3F.

@lazyfrosch

This comment has been minimized.

Copy link

lazyfrosch commented Mar 2, 2015

There is an ITP for a similar tool on Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763345

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Mar 3, 2015

+1

@thedrow

This comment has been minimized.

Copy link

thedrow commented Mar 25, 2015

+1

1 similar comment
@mpolakis

This comment has been minimized.

Copy link

mpolakis commented Apr 19, 2015

+1

@rroblak

This comment has been minimized.

Copy link

rroblak commented May 3, 2015

@sometimesfood created a .deb PPA for hub a while back. I wonder if he'd be willing to update the package version (it's old at 1.10.1) or allow someone else to do so?

@sometimesfood

This comment has been minimized.

Copy link

sometimesfood commented May 4, 2015

@rroblak My packaging script uses Debian's Ruby-specific packaging tool chain, so it will probably not be too useful.

Still, if there is enough interest, I can look into creating a new Debian package and updating the PPA.

Creating packages is not too difficult but it can be quite intimidating for a beginner (lots of tools, lots of policies). Also, to make matters worse, the Debian packaging tools and docs for golang seem to be rather new.

@sometimesfood

This comment has been minimized.

Copy link

sometimesfood commented May 5, 2015

Btw, just for reference: Michael Stapelberg has compiled some nice examples on how to package a simple Go application for Debian:
http://anonscm.debian.org/cgit/collab-maint/dh-golang.git/tree/example

Also, the debian/rules and debian/control files of this package seem to be a nice reference:
https://packages.debian.org/sid/codesearch

@alfredocdmiranda

This comment has been minimized.

Copy link

alfredocdmiranda commented May 7, 2015

Hey guys, I just created two .deb packages (amd64 and i386). I've tested amd64 and it is working fine. It's missing the completion scripts because I didn't know where to put them.

So, I just don't know where I can upload them.

@sometimesfood

This comment has been minimized.

Copy link

sometimesfood commented May 7, 2015

@alfredocdmiranda If you do not want to host your own repository, you can either upload the sources to Launchpad and let it build packages for a PPA, or you can try http://packagecloud.io or a similar service.

@alfredocdmiranda

This comment has been minimized.

Copy link

alfredocdmiranda commented May 7, 2015

@sometimesfood thanks, I liked this packagecloud.io

So, I've uploaded the files. https://packagecloud.io/alfredocdmiranda/misc

@cpick

This comment has been minimized.

Copy link

cpick commented May 9, 2015

I built a "proper" dpkg for Ubuntu and created a ppa.

You should be able to install it with the following:

sudo add-apt-repository ppa:cpick/hub
sudo apt-get update
sudo apt-get install hub

If there's any interest, I'd be willing to try to get these changes into the various upstreams.
In the meantime, please report issues and/or send pull requests to https://github.com/cpick/hub (changes are on the 'debian' branch).

@nirum

This comment has been minimized.

Copy link

nirum commented May 12, 2015

👍

@edorgeville

This comment has been minimized.

Copy link

edorgeville commented May 14, 2015

@cpick I get this :

W: Failed to fetch http://ppa.launchpad.net/cpick/hub/ubuntu/dists/vivid/main/binary-amd64/Packages  404  Not Found

W: Failed to fetch http://ppa.launchpad.net/cpick/hub/ubuntu/dists/vivid/main/binary-i386/Packages  404  Not Found
@cpick

This comment has been minimized.

Copy link

cpick commented May 14, 2015

Ah, I only built packages for trusty. I'll produce some for utopic and
vivid tomorrow. Thanks for the report!

On Thu, May 14, 2015, 17:32 th3m4ri0 notifications@github.com wrote:

@cpick https://github.com/cpick I get this :

W: Failed to fetch http://ppa.launchpad.net/cpick/hub/ubuntu/dists/vivid/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/cpick/hub/ubuntu/dists/vivid/main/binary-i386/Packages 404 Not Found


Reply to this email directly or view it on GitHub
#718 (comment).

@cpick

This comment has been minimized.

Copy link

cpick commented May 15, 2015

@th3m4ri0 I've added packages for utopic, vivid, and wily to the ppa and tested it on a vivid VM.
Please try again, it should work. Thanks for trying out my packages!

@edorgeville

This comment has been minimized.

Copy link

edorgeville commented May 16, 2015

Working 👍

@tlongren

This comment has been minimized.

Copy link

tlongren commented May 17, 2015

👍

@iemejia

This comment has been minimized.

Copy link

iemejia commented Jun 11, 2015

Awesome, I really hope they start publishing this in a 'official' upstream ppa. Thanks for your work @cpick.

@graingert

This comment has been minimized.

Copy link

graingert commented Oct 28, 2016

here's the ITP for github-hub: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807866

@kujiy

This comment has been minimized.

Copy link

kujiy commented Mar 10, 2017

This worked on debian.

RUN echo "deb http://ftp.us.debian.org/debian testing main contrib non-free" >> /etc/apt/sources.list \
     &&      apt-get update              \
     &&      apt-get install -y git      \
     &&      apt-get clean all

http://stackoverflow.com/questions/15104089/packaging-go-application-for-debian

@thomasshanks

This comment has been minimized.

Copy link

thomasshanks commented Apr 5, 2017

I'd love if the CI kept this PPA up to date. In the mean time, might you be able to push a new version? Thank you.

@cpick

This comment has been minimized.

Copy link

cpick commented Apr 6, 2017

I've updated hub to version 2.2.9 in my ppa:cpick/hub. A sudo apt update && sudo apt upgrade should retrieve it.

For my future reference this is the series of commands I run perform the update:

# Having initially setup my ppa at: https://launchpad.net/~cpick/+archive/ubuntu/hub
export DEBEMAIL=chris@foobar.com
export DEBFULLNAME=Chris Pick
git clone cpick/hub
cd hub
git checkout debian
HUB_VERS="2.2.9"
git merge "v${HUB_VERS}"
dch -v "${HUB_VERS}-0ubuntu0ppa1" -u low
# Copy release notes over from https://github.com/github/hub/releases/tag/v${HUB_VERS}
dch -r "$(lsb_release -sc)"
git commit -am "Update debian changelog for ${HUB_VERS}"
git push origin debian
cat >|Vagrantfile <<EOF
Vagrant.configure(2) do |config|
  config.vm.box = "ubuntu/xenial64"
  config.vm.synced_folder ".", "/home/ubuntu/src"
end
EOF
vagrant up
vagrant ssh
sudo apt-get update
sudo apt-get install -y packaging-dev equivs
cd src
mk-build-deps -irs sudo
dpkg-buildpackage -us -uc
dpkg-genchanges -S >"$(echo ../hub_*.dsc | sed -e 's/\.[^.]*$/_source.changes/')"
mkdir bin
mv ../hub_* bin/
exit
cd bin
debsign hub_*_source.changes
dput ppa:cpick/hub hub_*_source.changes
git checkout Vagrantfile
@abesto

This comment has been minimized.

Copy link

abesto commented Apr 25, 2017

Thank you for the PPA! There doesn't seem to be a build in it for Yakkety, but installing the package built for Xenial seems to work on my system.

@cpick

This comment has been minimized.

Copy link

cpick commented Apr 25, 2017

@abesto I just copied the latest packages into yakkety and zesty repos (they contain the same binaries as the ones you installed from xenial, so I don't know that there's any reason to take any further action in your case).

@arichiardi

This comment has been minimized.

Copy link

arichiardi commented Jun 13, 2017

Thanks for the PPA! Should it be advertised in the README?

@mslinn

This comment has been minimized.

Copy link

mslinn commented Jul 4, 2017

@cpick I made a PR that updates README.md with instructions to install from the PPA. Tested under Ubuntu and Windows Subsystem for Linux.
#1502

BTW, the PPA needs to be refreshed with the latest version again.

@thedrow

This comment has been minimized.

Copy link

thedrow commented Jul 5, 2017

If maintaining a PPA is a burden we can publish the deb file to bintry or packagecloud.

@mslinn

This comment has been minimized.

Copy link

mslinn commented Jul 5, 2017

Maybe Alin Andrei (andrew@webupd8.org), who runs webupd8, would be more co-operative. His repo is widely used, and is thoughtfully put together. See his Launchpad page.

@cpick

This comment has been minimized.

Copy link

cpick commented Jul 6, 2017

@mslinn thanks for the effort and the pull request!

I usually only update my PPA when there's a full (non-pre) release.
I don't usually find it a burden, but certainly would love if something was upstreamed/hosted officially by the hub team.

@javier-lopez

This comment has been minimized.

Copy link

javier-lopez commented Oct 7, 2017

Hello all,

I would suggest to use PPA continual build service to automate the creation of deb packages. I already do something similar for other projects, eg, tmate, if you're ok, I could help to setup everything for this project, what I would need from hub's authors would be:

How it works?

  • LP sync continually target projects, on this case could be stable + debian branches
  • When LP detect changes it rebuilds packages and host them at the specified PPA

Example:

https://code.launchpad.net/~tmate.io/+recipe/tmate-stable

PD: Happy Hacktoberfest, 🎉 🍻 😄

@Mte90

This comment has been minimized.

Copy link

Mte90 commented Mar 17, 2018

Any updates for this?

@vanniktech

This comment has been minimized.

Copy link

vanniktech commented Mar 30, 2018

Adding sudo add-apt-repository ppa:cpick/hub on my Ubuntu 17.10 followed by sudo apt-get update yields:

Hit:1 http://security.ubuntu.com/ubuntu artful-security InRelease
Hit:2 http://archive.canonical.com/ubuntu artful InRelease                                                                                                                 
Ign:3 http://ppa.launchpad.net/cpick/hub/ubuntu artful InRelease                                                                                                           
Hit:4 http://us.archive.ubuntu.com/ubuntu artful InRelease                                                                                            
Hit:5 http://us.archive.ubuntu.com/ubuntu artful-updates InRelease                                                               
Hit:6 http://ppa.launchpad.net/cwchien/gradle/ubuntu artful InRelease                                       
Err:7 http://ppa.launchpad.net/cpick/hub/ubuntu artful Release                                              
  404  Not Found
Hit:8 https://download.sublimetext.com apt/stable/ InRelease                          
Reading package lists... Done                      
E: The repository 'http://ppa.launchpad.net/cpick/hub/ubuntu artful Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

This used to work a couple weeks ago on a different Ubuntu machine that has the same set up. Also adding --allow-unauthenticated didn't help.

@cpick

This comment has been minimized.

Copy link

cpick commented Mar 30, 2018

@vanniktech I copied the latest packages to the artful and bionic repos and ran a quick installation test in an artful VM.
You should be able to install them with a sudo apt update && sudo apt install hub.

@vanniktech

This comment has been minimized.

Copy link

vanniktech commented Mar 31, 2018

That was super quick, thank you. Everything works now again 🚀

@Alessandro-Barbieri

This comment has been minimized.

Copy link

Alessandro-Barbieri commented Mar 31, 2018

What about the Debian ITP?

@jonstuebe

This comment has been minimized.

Copy link

jonstuebe commented May 29, 2018

@cpick opened a pr (hopefully I did it right) to get the debian updated to 2.3.0.

cpick#1

@cpick

This comment has been minimized.

Copy link

cpick commented May 30, 2018

@jonstuebe thanks for giving it a whack! I've updated the cpick/hub:debian branch to pull in the new v2.3.0 code, but haven't yet gotten it to build.
I'm not as familiar with debhelper's go builds as I once was so it won't be super easy for me to sort out. If anyone is able to lend a hand it would be much appreciated: cpick#2

@Taytay

This comment has been minimized.

Copy link

Taytay commented Jun 26, 2018

Based partly on @mhalano's trick to get the latest version, I wrote a script to install the latest version on Ubuntu: https://gist.github.com/Taytay/4b463d3e7ebf9915107251b3abad7073

This script can be turned into a one-liner, but it's obviously a bit harder to read:

HUB_DIST=linux-amd64 HUB_VERSION=`curl -w "%{url_effective}\n" -I -L -s -S github.com/github/hub/releases/latest -o /dev/null | awk -F'releases/tag/v' '{ print $2 }'`; curl "https://github.com/github/hub/releases/download/v$HUB_VERSION/hub-$HUB_DIST-$HUB_VERSION.tgz" -L | tar xvz && sudo ./hub-$HUB_DIST-$HUB_VERSION/install && rm -r ./hub-$HUB_DIST-$HUB_VERSION
@mhalano

This comment has been minimized.

Copy link

mhalano commented Jun 26, 2018

I think a good idea would be create a debian/ directory with all the metadata to allow to compile the application.

@graingert

This comment has been minimized.

Copy link

graingert commented Jun 26, 2018

I did sudo apt install linuxbrew-wrapper && linuxbrew install hub

@pcraciunoiu

This comment has been minimized.

Copy link

pcraciunoiu commented Jul 30, 2018

@graingert super helpful and much prefer that to the (currently outdated) PPA (on 2.2.9) since I get 2.5.0 now. I had to add an alias for bash/fish for those who use both.

For bash:

# in ~/.bashrc, ~/.profile, or ~/.bash_profile or wherever you keep aliases
alias hub="/home/linuxbrew/.linuxbrew/bin/hub"
source /home/linuxbrew/.linuxbrew/etc/bash_completion.d/hub.bash_completion.sh

For fish:

~> ln -s /home/linuxbrew/.linuxbrew/share/fish/vendor_completions.d/hub.fish ~/.config/fish/completions/
~> fish_update_completions  # this may not be needed
~> alias hub="/home/linuxbrew/.linuxbrew/bin/hub"
~> funcsave hub
@simon-tse-hs

This comment has been minimized.

Copy link

simon-tse-hs commented Aug 12, 2018

@graingert I tried your command with a Ubuntu based docker image and got the following error

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linuxbrew-wrapper

I'm not super familiar with this and I also tried to install the linuxbrew according to their website and it didn't work as well. but the response from @Taytay worked for me.

@graingert

This comment has been minimized.

Copy link

graingert commented Aug 12, 2018

@cirosantilli

This comment has been minimized.

Copy link

cirosantilli commented Sep 16, 2018

https://askubuntu.com/questions/959932/installation-instructions-for-golang-1-9-into-ubuntu-16-04/1075726#1075726

# https://github.com/moovweb/gvm/issues/302
sudo apt-get install golang-go
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
. ~/.gvm/scripts/gvm
v=go1.11
gvm install "$v"
gvm use "$v"
go get github.com/github/hub
@Mte90

This comment has been minimized.

Copy link

Mte90 commented Jan 27, 2019

seems that now is avalaible on debian https://packages.debian.org/sid/amd64/hub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.