Golang the wrong way to install a third-party library in a Linux environment

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

1. Error description

Error when installing Beego using the following method

get github.com/astaxie/beego

Error message:

Go install unicode/utf8:open/opt/go/pkg/linux_amd64/unicode/utf8.a:permission denied
Go install unicode:open/opt/go/pkg/linux_amd64/unicode.a:permission denied
Go install math:open/opt/go/pkg/linux_amd64/math.a:permission denied
Go install sort:open/opt/go/pkg/linux_amd64/sort.a:permission denied
Go install hash:open/opt/go/pkg/linux_amd64/hash.a:permission denied
Go install unicode/utf16:open/opt/go/pkg/linux_amd64/unicode/utf16.a:permission denied
Go install crypto/subtle:open/opt/go/pkg/linux_amd64/crypto/subtle.a:permission denied
Go install container/list:open/opt/go/pkg/linux_amd64/container/list.a:permission denied
Go install internal/syscall:open/opt/go/pkg/linux_amd64/internal/syscall.a:permission denied
Go install time:open/opt/go/pkg/linux_amd64/time.a:permission denied

Then I put a sudo in front of the command and then prompted

Go:cannot Find Goroot directory:/usr/local/go

2. Workaround

Go install unicode/utf8:open/opt/go/pkg/linux_amd64/unicode/utf8.a:permission denied

The cause of this error is that I was directly golang compressed into the/OPT directory, all the source code is not compiled, should first switch to/OPT/GO/SRC directory, execute sudo. Make.bash script compilation, after the completion of using the following command to install Beego will not be wrong:

get github.com/astaxie/beego

In this case, you will be prompted to install the Bee tool with insufficient permissions when you execute the following command:

get github.com/beego/bee

Go install github.com/beego/bee:open/opt/go/bin/bee:permission denied

My solution to this is to first switch to the/OPT directory, execute the following command, modify the Go folder permissions:

sudo777 go/

This will install the Bee tool properly.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.