offline document for go/golang - linux

Is there any Ubuntu go offline document package that I can install so that I can read the package docs for Go offline?
I thought it would be golang-doc but it is actually not -- there aren't any Go package docs in it.
Then I research further and tried
godoc -http=:6060
but visiting http://127.0.0.1:6060/pkg/ gives me
lstat /usr/lib/go/doc: no such file or directory
How to read the Go package docs offline?
PS. My Ubuntu and golang-go package:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 15.04
Release: 15.04
Codename: vivid
$ apt-cache policy golang-go
golang-go:
Installed: 2:1.4.2
Candidate: 2:1.4.2
Version table:
*** 2:1.4.2 0
500 http://ppa.launchpad.net/evarlast/golang1.4/ubuntu/ vivid/main amd64

I am not sure the answer marked as correct is actually the correct answer - I could not access the golang documentation offline using that at least.
This works for me on a Mac. I have not tested it on Ubuntu.
If you have godoc installed, run the following command:
godoc -http=:6060
Then open a browser with the following URL:
http://127.0.0.1:6060/pkg/
Or http://127.0.0.1:6060/ to see the first page of the golang web site.
All of the doco from the gloang web site will then be available to you.

According to Installing Go from source:
The source code for several Go tools (including godoc) is kept in the go.tools repository. To install all of them, run the go get command:
$ go install golang.org/x/tools/cmd/...#latest
Or if you just want to install a specific command (godoc in this case):
$ go install golang.org/x/tools/cmd/godoc#latest
To install these tools, the go get command requires that Git be installed locally.
You must also have a workspace (GOPATH) set up; see How to Write Go Code for the details.
Note: The go command will install the godoc binary to $GOROOT/bin (or $GOBIN) and the cover and vet binaries to $GOROOT/pkg/tool/$GOOS_$GOARCH. You can access the latter commands with "go tool cover" and "go tool vet".
Based on that information, have you tried:
Installing godoc using $ go install golang.org/x/tools/cmd/godoc#latest
Verifying Git is installed using $ git --version
Verifying the GOPATH using $ echo $GOPATH

Related

Is there a way to update visual-studio-code-bin which is installed from the arch wiki

visual-studio-code-bin is installed from the arch wiki. The only way I know how to actually update the software is reinstalling it again from the arch wiki which is tedious and inconvenient.
Any help is appreciated
Old post with a lot of split information so for anyone who finds this later, you have 2 choices:
Install the open source version of visual studio code from the official repos.
Install the official Microsoft binary version via the AUR that contains some proprietary code from Microsoft that is not available in the fully open version (e.g. some debugging some languages).
Info on how to do this can be found in the wiki.
It depends on how you installed vscode. If you did sudo pacman -S code, then the solution is to run it again. But if you did yay -S visual-studio-code-bin, then you should run THIS command again.
The best way to use VS Code on Arch is to use the open source version on the community repos. Which you can install by doing
sudo pacman -S code
visual-studio-code-bin is the proprietary binary which can be installed from the Arch User Repository.
If for some reason you want to go for the latter approach, you can either use an AUR helper or manage everything manually.
You can see the Arch Wiki's page on AUR helpers which shows the different options you have: https://wiki.archlinux.org/index.php/AUR_helpers
You can use these helpers to help manage your updates just like you would on pacman.
Here's how you would do things manually: https://wiki.archlinux.org/index.php/Arch_User_Repository#Installing_and_upgrading_packages
Just as a warning, AUR helpers are not supported by Arch Linux and the manual approach, though less user friendly is the recommended way by the Arch Wiki to manage your AUR Packages.
First a short version:
Simply run
sudo pacman -Sy
sudo pacman -S visual-studio-code-bin
The longer explanation:
Getting the right version of vscode
First of all, "code" and "visual-studio-code-bin" are two different packages. "code" is an open-source release and "visual-studio-code-bin" is an Microsoft-branded release. One of the major differences is that "code" doesn't support any Microsoft Extensions like C/C++, to my knowledge. This information can be found in the arch wiki: https://wiki.archlinux.org/title/Visual_Studio_Code#Installation. For more detailed information about the differences I'll refer you to the vscode repository: https://github.com/microsoft/vscode/wiki/Differences-between-the-repository-and-Visual-Studio-Code
By running "sudo pacman -S code" you (unintentionally) uninstall "visual-studio-code-bin" and install "code" because of wired some decency conflict.
So if you want to update/install "visual-studio-code-bin" run:
sudo pacman -S visual-studio-code-bin
This should fix any Problems with no functioning Microsoft-Extensions
Of course if you want to sick to the open-source version you can use
sudo pacman -S code
Fixing your Problem with not updating to the right version
I have to admit this took me ages. I had two machines, one with an freshly installed version of geruda Linux (an arch based distro) and an six moth old version of geruda Linux. Both had vscode installed. At the time of writing this the current version of vscode is 1.59.0-1. Interestingly the my old machine, witch had vscode version 1.58.0-1 installed didn't know that there was an newer version. The newer machine was aware of the the newer version. An simply running pacman -S visual-studio-code-bin didn't change anything. This hinted my to the problem of an not synchronized package database. And forcefully synchronizing the database with
sudo pacman -Sy
did the trick for me. For a more detialed information I would redirect you to the man pages: https://archlinux.org/pacman/pacman.8.html or this thread https://bbs.archlinux.org/viewtopic.php?id=117765. After running this command you only need to install vscode with "sudo pacman -S visual-studio-code-bin" or "sudo pacman -S code" to get the newest version of vscode
As rightly said by #AlexanderHD27 code is open source and vscode is microsoft official version but it is not open source. though code is more like an experimental version of of vscode; however, you can install code directly in archlinux using sudo pacman -S code but for the the vscode you have to clone the repository from github and install in the following way:
git clone visual-studio-code-bin
then cd visual-studio-code-bin and makepkg -si
remember if you don't have git installed you can do that using sudo pacman -S git. As for the update; code is updated during system full update but vscode is not updated. So, you have to cd into the directory again and do git pull the makepkg -si again.
As KamilCuk and Aviad mentioned there is no visual-studio-bin package, since it is a aur package you can use yay (AUR helper) to get a updateable version. For more information about yay see: https://github.com/Jguer/yay.
Install yay
sudo pacman -S --needed base-devel git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ..
rm -rf yay
Install visual-studio-code-bin with yay
# install
yay -S visual-studio-code-bin
If you installed vscode via pamac manager in manjaro, try this:
pamac update
To update with the cloned AUR directory.
First update pacman database:
pacman-Sy
Then in the AUR directory you can update the AUR to the latest version with:
git pull
Then update dependencies with:
makepkg -s
Finally you install it:
makepkg -i
==> WARNING: A package has already been built, installing existing package...
==> Installing package visual-studio-code-bin with pacman -U...
loading packages...
resolving dependencies...
looking for conflicting packages...
Packages (1) visual-studio-code-bin-1.73.1-1
Total Installed Size: 324.26 MiB
Net Upgrade Size: 29.66 MiB
:: Proceed with installation? [Y/n]

cloudflared installed on Compute Engine (Debian GNU/Linux) but cloudflared command is not found via Cloud Shell

I have to install Argo Tunnel on my server, VM on Compute Engine (Image Debian, Debian GNU/Linux, 10 (buster), amd64 built on 20200902, supports Shielded VM features), but cannot pass the cloudflared installation step.
I followed the instructions on the developers portal:https://developers.cloudflare.com/argo-tunnel/downloads
And downloaded amd64 / x86-64 package for Linux,
I also used this code and installed cloudflared on my VM
git clone
https://github.com/cloudflare/cloudflared.git
cd cloudflared/
go clean
go get
github.com/cloudflare/cloudflared/cmd/cloudflared
make cloudflared
I see the directory, but I cannot check the version to verify if I install everything properly (documentation).
changerz_critical#cloudshell:~/cloudflared (global-
road-289110)$ cloudflared --version
-bash: cloudflared: command not found
I honestly read through all available docs and could not find anything that could help to solve this issue.
Would be very thankful for any help.
To install cloudflared on your VM instance please follow steps below:
Create VM instance:
$ gcloud beta compute instances create instance-1 --zone=europe-west3-a --machine-type=e2-medium --image=debian-10-buster-v20200910 --image-project=debian-cloud
Connect to VM instance via SSH:
$ gcloud compute ssh instance-1
Download and install cloudflared by using .deb package:
instance-1:~$ wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb
instance-1:~$ sudo dpkg --install cloudflared-stable-linux-amd64.deb
Check the version:
instance-1:~$ cloudflared --version
cloudflared version 2020.9.0 (built 2020-09-14-2204 UTC)
Follow the instructions:
instance-1:~$ Please open the following URL and log in with your Cloudflare account:
https://dash.cloudflare.com/argotunnel?callback=https%3A%2F%2Flogin.argotunnel.com%2Fkob9m8T0PaRAFrkYjXjAI4vH1X4sqQ6IRtd8-D_THmYMaAM%3D
Leave cloudflared running to download the cert automatically.
Unfortunately, I don't have a domain to check the full setup. For further instructions I'd recommend you to post a new question at Cloudflare community.
Solved with
git clone https://github.com/cloudflare/cloudflared.git cd cloudflared/ go clean go get github.com/cloudflare/cloudflared/cmd/cloudflared make cloudflared

How to install smlnj in arch linux?

Earlier I was in Ubuntu & it was easy to install smlnj using
apt-get install smlnj
but now I shifted to Arch & I'm finding it difficult to install smlnj.
I tried to find smlnj package through yaourt but I didn't found any.
Then I tried to install it by steps given in official site by downloading tar file. I followed given steps and extracted tar file in /usr/local/sml & then compiled by running command
config/install.sh.
After doing all this I tried to run sml but was not successful. I tried setting environment variable but again was not successful.
Please tell me whether I'm missing any steps or doing it wrong way. What is correct way to install smlnj in Arch Linux?
Update: As Alexander (xyproto) points out, pacman -S smlnj should work again now that SML/NJ is in the [multilib] repository. The solution below would still work, but credit for making installation more convenient should go to him. :-)
Before: It seems that the package became unavailable for x86_64 in Feb 2017, but it doesn't look like it should have happened. I've asked Alexander who maintains the package in [community].
The AUR doesn't contain an smlnj package because it's against AUR policy to overlap with official packages, unless the AUR package is compiled with some tweak that is clearly visible in the package name.
You can still build an Arch package and install that by finding the PKGBUILD and accompanying files at: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/smlnj (or by cloning the git repo below with those four files in it):
~ $ git clone https://github.com/sshine/smlnj-arch.git
~ $ cd smlnj-arch
~/smlnj-arch $ makepkg
~/smlnj-arch $ sudo pacman -U smlnj-110.80-3-x86_64.pkg.tar.xz

Target not found: mingw-w64-x86_64-flickcurl

I'm using MSYS2, and I was expecting to be able to install flickcurl.
I tried installing as follows, but it seems that it can't find the file.
$ pacman -S mingw-w64-x86_64-flickcurl
error: target not found: mingw-w64-x86_64-flickcurl
Am I missing something here?
Probably your MSYS2 is outdated (think of it like Linux package manager which you update before installing stuff), you should run following commands and if you are asked to close terminal do it:
update-core - this one will fail if your MSYS2 is not very old, this is a good sign
pacman -Syu - you might have to repeat it until you see there is nothing to do; it updates your installed packages
pacman -S mingw-w64-x86_64-flickcurl
Those packages should be available after those steps:
$ pacman -Ss flickcurl
mingw32/mingw-w64-i686-flickcurl 1.26-1
Flickcurl is a C library for the Flickr API (mingw-w64)
mingw64/mingw-w64-x86_64-flickcurl 1.26-1
Flickcurl is a C library for the Flickr API (mingw-w64)
Commands explained:
update-core - used in the past to upgrade core packages, now removed since pacman does it
better
pacman -S <package_name> - checks local database for package
and installs it if it's found (will fail if there is no database or
it's outdated)
pacman -Su - compares installed packages to the
database searching for updates (will also fail if there is no
database or it's outdated)
pacman -Sy - downloads database with
available packages
pacman -Syu - downloads database and searches
for update, recommend way of upgrading
Final note:
MSYS2 doesn't support partial upgrades for the same reasons as Like Arch Linux. That means you should run pacman -Syu before installing package.

Installing additional packages for Cygwin

To install additional packages for Cygwin, do I just need to run the setup.exe again and choose from the packages list?
Also, doing this won't harm my computer in terms of 2 Cygwin instances being installed or problems of that kind (I'm kind of a noobie with these things).
Last, there is no package manager in Cygwin which you can run in the command line? Something similar to Pip in Python.
No, adding additional packages doesn’t modify the current settings. There is a
package manager called apt-cyg which installes additional packages from
command-line. To install apt-cyg follow the below steps:
wget rawgit.com/transcode-open/apt-cyg/master/apt-cyg
install apt-cyg /bin
Note: wget should be installed for downloading the apt-cyg. To Use apt-cyg for
installing additional package (after following the above steps):
apt-cyg install ncurses
No, it doesn't hurt the current setup. The install program knows what's installed already.
Having said that, I long ago got into the habit of installing all of Cygwin since, despite its size, it's still minuscule compared to the size of modern hard disks. That way, you won't ever have to worry about whether a package is installed or not.
Re-run the setup executable like "cygwin_setup-x86_64.exe" should do it.
"Install from Internet"
Accept your existing root directory (from your existing installation)
Use your existing "Local Package Directory"
On the screen, view "Full"
Search for the new package you want to add
Go through the installation
Additional option, may be helpful for someone:
To install additional packages in windows from windows command line you can use your cygwin installer.
I suppose, you've already downloaded it to install cygwin from here https://cygwin.com/install.html.
$ setup-x86_64.exe -q -P graphviz
see this guide for details:
http://preshing.com/20141108/how-to-install-the-latest-gcc-on-windows/
There is no package management in Cygwin outside of the setup program. The setup only applies updates to your current installation, it does not overwrite packages than what you already have.
So if you want new packages just rerun the setup program to install packages.
You can just look for the package binaries and decompress them in the C:\cygwin\bin folder.
I did that for dos2unix ( https://cygwin.com/packages/summary/dos2unix.html ) and trying it out now.

Resources