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 · 78 comments
Closed

Debian/Ubuntu packages #718

dbarnett opened this issue Dec 2, 2014 · 78 comments
Labels

Comments

@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
Copy link

+1

1 similar comment
@notslang
Copy link

+1

@davidshepherd7
Copy link

This would be great

@mislav
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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).

@owenthereal
Copy link
Contributor

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

@gsuess
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
Copy link

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

@Mte90
Copy link

Mte90 commented Mar 3, 2015

+1

@thedrow
Copy link

thedrow commented Mar 25, 2015

+1

1 similar comment
@mpolakis
Copy link

+1

@rroblak
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
Copy link

@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
Copy link

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
Copy link

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
Copy link

@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
Copy link

@sometimesfood thanks, I liked this packagecloud.io

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

@cpick
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
Copy link

nirum commented May 12, 2015

👍

@edorgeville
Copy link

@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
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
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
Copy link

Working 👍

@tlongren
Copy link

👍

@iemejia
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.

@thomasshanks
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
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
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
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
Copy link

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

@mslinn
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
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
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
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
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
Copy link

Mte90 commented Mar 17, 2018

Any updates for this?

@vanniktech
Copy link

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
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
Copy link

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

@Alessandro-Barbieri
Copy link

What about the Debian ITP?

@jonstuebe
Copy link

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

cpick#1

@cpick
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
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
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
Copy link

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

@pcraciunoiu
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
Copy link

@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
Copy link

graingert commented Aug 12, 2018 via email

@cirosantilli
Copy link

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
Copy link

Mte90 commented Jan 27, 2019

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

@sethidden
Copy link

Apparently the preferred way of installing hub on Ubuntu is snap install hub as seen in this repo's README.md, but snap is not available on the stable version of Windows Subsystem for Linux (by design). Perhaps it would be better to provide an ubuntu package? I read what Mte90 wrote above but couldn't download using sudo apt install and used cpick's ppa instead

@mislav
Copy link
Owner

mislav commented Feb 23, 2020

@3nuc Follow this issue for Ubuntu #2434

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests