Would it be possible to provide deb packages to easily install hub on Ubuntu and Debian?
+1
+1
This would be great
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.
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.
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.
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).
I bookmarked this tool a while ago. Maybe it'd help.
@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.
There is an ITP for a similar tool on Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=763345
+1
+1
+1
@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?
@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.
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
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.
@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.
@sometimesfood thanks, I liked this packagecloud.io
So, I've uploaded the files. https://packagecloud.io/alfredocdmiranda/misc
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).
:+1:
@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
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 [email protected] 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
https://github.com/github/hub/issues/718#issuecomment-102176571.
@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!
Working :+1:
:+1:
Awesome, I really hope they start publishing this in a 'official' upstream ppa. Thanks for your work @cpick.
@cpick Thanks for doing this.
Where do other packages keep their shell completion scripts? Does Ubuntu have some standard for this?
@cpick You're a hero.
Completions should go in /usr/share/bash-completion/completions/
to take advantage of lazy-loading.
Also, #592 blocks hub completion from loading in /etc/bash_completion.d/
if git was lazy-loaded, which should be the default everywhere.
For example, ArchLinux has distributed hub since late 2012. Here is the PKGBUILD, as you can see the hub completion is installed next to the git completion, and everything works smoothly.
thanks for this debian package
@mislav in my initial, previous version (2.2.1-0ubuntu0ppa1
) I had already put the hub
completion script into /etc/bash_completion.d/
(which is the "compatability" or "legacy" location since its scripts are not lazy-loaded). However, as @eli-schwartz points out, they still weren't working as a result of #592.
To work around the issue, I just released a new version (2.2.1-0ubuntu0ppa2
) which forces git's completion script to be loaded first (ie no longer lazy-loaded). This works around the issue at the cost of some small, additional bash-startup time. Once #592 is fixed, I ought to be able to find a way to switch both hub and git to be properly lazy-loaded (out of /usr/share/bash-completion/completions/
).
One small peculiarity is that hub's completion script affects completions for both the hub
and git
commands. This is correct if the user has followed hub's recommendation and aliased hub
to git
, but it could be confusing to suggest hub
-specific commands when completing on git
without the alias in place.
I _could_ install the alias automatically, system-wide, as part of this package. What do you guys think, would that be the appropriate and expected behavior?
Also, #592 blocks hub completion from loading in /etc/bash_completion.d/ if git was lazy-loaded, which should be the default everywhere.
For example, ArchLinux has distributed hub since late 2012. Here is the PKGBUILD, as you can see the hub completion is installed next to the git completion, and everything works smoothly.
Hmm, I thought this was true, but turns out it only works for the primary commands. subcommands don't complete until you attempt to complete hub.
The package should never install the alias. Instead, the user should be a able to opt-in to the alias by using alias git=hub
in their shell config.
I hope that future iterations of our shell completion will allow for lazy loading. Right now, I don't know why lazy loading doesn't work for our script and how can we make it work.
+1. GVM is by far the best option now for Ubuntu 14.04: https://github.com/moovweb/gvm
@cpick Thanks for the apt repo!
I get this error though
W: Failed to fetch http://ppa.launchpad.net/cpick/hub/ubuntu/dists/jessie/main/binary-amd64/Packages 404 Not Found
Is it possible to add the Debian releases as well?
@simonvanderveldt to my knowledge, launchpad won't host PPA builds for non-Ubuntu (ie Debian, etc) distros.
That being said, since hub
is a (largely) statically linked executable and the package is simple, you shouldn't have any trouble installing and using the Ubuntu packages/binaries on your Debian system. You'll just need to update the apt sources.list entry for my PPA so that it points to an Ubuntu codename, say 'trusty' (instead of 'jessie'), run an apt-get update
and you should be good to go.
@cpick
to my knowledge, launchpad won't host PPA builds for non-Ubuntu (ie Debian, etc) distros.
Seems like you're right https://bugs.launchpad.net/launchpad/+bug/188564. I hoped it would be possible, but didn't check before, sorry about that.
I'll adjust the line in my sources.list
, thanks for the quick response!
any news for the 2.2.3 release debian package?
@cpick Are your Debian packages ready to use? Should we update the installation documentation with instructions? How should we handle updates on new releases?
@cpick Any news about Xenial package?
@Mte90 I should be able to update my PPA in the next couple of days
@mislav my PPA is certainly functional (albiet a touch out of date at the moment), the instructions for installing hub
from the PPA are:
sudo add-apt-repository ppa:cpick/hub
sudo apt-get update
sudo apt-get install hub
For now the update process is just a matter of me noticing (or someone pinging me to tell me) that there's a new hub
version and then pulling those changes into the package. When I pull in 2.2.3 I'll take notes of my steps.
@mhalano I just copied the existing (2.2.1) packages on over to xenial as well (and did some rough testing), please give it a go.
@Mte90 @mhalano I was actually able to get to updating the package to 2.2.3, it's already released for xenial. If there's any interest in having it backported to any older Ubuntu versions please let me know.
@mislav I took notes on my steps for updating the package. It was somewhat involved so let me know if you'd like me to put them somewhere.
I think the biggest problem is keep repository update. May we could look for a way to find out how to get the latest version number and pack automagically.
That's should be the dumbest hack already done in the history of the universe:
$ curl https://github.com/github/hub/releases/latest | cut -d" -f2 | cut -dv -f2
This will convert the tag 'latest' to the correct version. I hope will find a better and more elegant solution.
Edit: That's a better way because use header's information:
$ curl -w "%{url_effective}n" -I -L -s -S https://github.com/github/hub/releases/latest -o /dev/null | cut -dv -f2
@mhalano I have a post-CI hook that automatically publishes pre-built binaries on tagged releases. Maybe the same process could create new packages? All I would need is some destination to upload them to.
@mislav Unfortunately I can't help you much in this point. My suggestion is look about PPA on Launchpad.net, one of the main methods to distribute Debian packages, for Ubuntu, at least. But my suggestion is publish packages in the same way you release the pre-compiled binaries. A lot of projects (like Nylas N1 - https://github.com/nylas/N1/releases) do in this way. What you think?
@cpick It seems your ppa is a few versions old. Could you update that please. :)
sudo apt-get install ruby
sudo curl https://hub.github.com/standalone -Lo /usr/bin/hub
sudo chmod 755 /usr/bin/hub
Ubuntu 16.04
@mileo That approach installs a very old version of hub. Please don't use it! New precompiled binaries are available from Releases section on this project.
here's the ITP for github-hub: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=807866
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
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.
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 [email protected]
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
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.
@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).
Thanks for the PPA! Should it be advertised in the README?
@cpick I made a PR that updates README.md with instructions to install from the PPA. Tested under Ubuntu and Windows Subsystem for Linux.
https://github.com/github/hub/pull/1502
BTW, the PPA needs to be refreshed with the latest version again.
If maintaining a PPA is a burden we can publish the deb file to bintry or packagecloud.
Maybe Alin Andrei ([email protected]), who runs webupd8, would be more co-operative. His repo is widely used, and is thoughtfully put together. See his Launchpad page.
@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.
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?
Example:
https://code.launchpad.net/~tmate.io/+recipe/tmate-stable
PD: Happy Hacktoberfest, :tada: :beers: :smile:
Any updates for this?
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.
@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
.
That was super quick, thank you. Everything works now again 🚀
What about the Debian ITP?
@cpick opened a pr (hopefully I did it right) to get the debian updated to 2.3.0.
@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: https://github.com/cpick/hub/issues/2
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
I think a good idea would be create a debian/ directory with all the metadata to allow to compile the application.
I did sudo apt install linuxbrew-wrapper && linuxbrew install hub
@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
@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.
Ubuntu in docker won't tell you what packages to install to be able to run
a command
On Sun, 12 Aug 2018, 09:09 Simon Tse, notifications@github.com wrote:
@graingert https://github.com/graingert I tried your command with a
Ubuntu based docker image and got the following errorReading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linuxbrew-wrapperI'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 https://github.com/Taytay worked for me.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/github/hub/issues/718#issuecomment-412326324, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAZQTDIwbpRry2BCCEdTT7zW5LbgqEXMks5uP-LAgaJpZM4DCt8k
.
# 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
seems that now is avalaible on debian https://packages.debian.org/sid/amd64/hub
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
@3nuc Follow this issue for Ubuntu https://github.com/github/hub/issues/2434
Most helpful comment
I built a "proper" dpkg for Ubuntu and created a ppa.
You should be able to install it with the following:
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).