Difference between revisions of "Go language"
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 15: | Line 15: | ||
There is one caveat to godeb, though: Recent versions of Ubuntu already have the golang package, and the packages that godeb creates will conflict with Ubuntu's package. Here we do a little work to fix that. | There is one caveat to godeb, though: Recent versions of Ubuntu already have the golang package, and the packages that godeb creates will conflict with Ubuntu's package. Here we do a little work to fix that. | ||
− | + | Instalasi Go Language versi terbaru | |
− | + | ==Install godeb== | |
− | + | Lakukan | |
+ | $ sudo apt-get install golang-go | ||
$ sudo apt-get install bzr | $ sudo apt-get install bzr | ||
$ cd $GOPATH | $ cd $GOPATH | ||
$ sudo go get launchpad.net/godeb | $ sudo go get launchpad.net/godeb | ||
− | + | Cek | |
$ $GOPATH/bin/godeb --help | $ $GOPATH/bin/godeb --help | ||
Line 34: | Line 35: | ||
− | + | ==Uninstall golang== | |
− | + | Sekarang uninstall golang untuk menggunakan go yang terbaru melalui godeb | |
− | $ sudo apt-get remove golang | + | $ sudo apt-get remove golang-go |
+ | $ sudo rm -Rf /usr/share/go/src/pkg | ||
+ | $ sudo rm -Rf /usr/share/go/src/pkg | ||
+ | $ sudo rm -Rf /usr/share/go/src/ | ||
+ | $ sudo rm -Rf /usr/share/go/ | ||
+ | $ sudo rm -Rf /usr/share/go | ||
$ sudo apt-get autoremove | $ sudo apt-get autoremove | ||
− | + | ==Buat Go Debian Package== | |
− | |||
− | + | Lakukan | |
$ $GOPATH/bin/godeb install | $ $GOPATH/bin/godeb install | ||
− | + | atau | |
− | + | ||
+ | /usr/lib/go/bin/godeb install | ||
− | + | Jika kita tidak melakukan autoremove akan timbul error berikut. | |
processing https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz | processing https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz | ||
Line 66: | Line 72: | ||
error: while installing go package: exit status 1 | error: while installing go package: exit status 1 | ||
− | + | Install secara paksa menggunakan perintah | |
− | |||
− | |||
− | |||
− | |||
$ sudo dpkg -i --force-overwrite go_1.2-godeb1_amd64.deb | $ sudo dpkg -i --force-overwrite go_1.2-godeb1_amd64.deb | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 06:03, 19 April 2014
Sumber: http://technosophos.com/2013/12/02/go-1-2-on-ubuntu-12-10.html
Installing Go 1.2 on Ubuntu 13.10
Newer Ubuntu distributions ship with various versions of the Go language. Ubuntu 13.10, for instance, has an available golang-1.1.2 package. But the most recent version of Go is 1.2.
The easiest way to install Go 1.2 on your system is by using the godeb tool. Here's how.
Overview
godeb is a small tool that grabs the latest version(s) of Go and dynamically constructs a debian package that can be installed on your local Ubuntu/Debian machine.
There is one caveat to godeb, though: Recent versions of Ubuntu already have the golang package, and the packages that godeb creates will conflict with Ubuntu's package. Here we do a little work to fix that.
Instalasi Go Language versi terbaru
Install godeb
Lakukan
$ sudo apt-get install golang-go $ sudo apt-get install bzr $ cd $GOPATH $ sudo go get launchpad.net/godeb
Cek
$ $GOPATH/bin/godeb --help
atau
/usr/lib/go/bin/godeb --help
Uninstall golang
Sekarang uninstall golang untuk menggunakan go yang terbaru melalui godeb
$ sudo apt-get remove golang-go $ sudo rm -Rf /usr/share/go/src/pkg $ sudo rm -Rf /usr/share/go/src/pkg $ sudo rm -Rf /usr/share/go/src/ $ sudo rm -Rf /usr/share/go/ $ sudo rm -Rf /usr/share/go $ sudo apt-get autoremove
Buat Go Debian Package
Lakukan
$ $GOPATH/bin/godeb install
atau
/usr/lib/go/bin/godeb install
Jika kita tidak melakukan autoremove akan timbul error berikut.
processing https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz package go_1.2-godeb1_amd64.deb ready Selecting previously unselected package go. dpkg: regarding go_1.2-godeb1_amd64.deb containing go: go conflicts with golang golang (version 2:1.1.2-2ubuntu1) is present and installed. dpkg: error processing go_1.2-godeb1_amd64.deb (--install): conflicting packages - not installing go Errors were encountered while processing: go_1.2-godeb1_amd64.deb error: while installing go package: exit status 1
Install secara paksa menggunakan perintah
$ sudo dpkg -i --force-overwrite go_1.2-godeb1_amd64.deb