2015年11月25日 星期三

Docker install on Ubuntu


OS: Ubuntu 14.04(LTS)

Add GPG Key

sudo apt-key adv — keyserver hkp://p80.pool.sks-keyservers.net:80 — recv-keys 58118E89F3A912897C070ADBF76221572C52609D

Create Docker Repo

echo “deb https://apt.dockerproject.org/repo ubuntu-trusty main” > /etc/apt/sources.list.d/docker.list

Update the apt package index

apt-get update

Purge the old repo if it exists

apt-get purge lxc-docker
Actuaully, you can skip this step, if your system is new installed, lxc-docker this package isn’t exist.

Verify that apt is pulling from the right repository

apt-cache policy docker-engine

Install Docker

apt-get install docker-engine && sudo shutdown -r now
Now you can play docker now…enjoy it~!!

Reference

2015年1月5日 星期一

pear could not extract the package.xml


sudo pear -d preferred_state=alpha install Net_Gearman-0.2.3
downloading Net_Gearman-0.2.3.tgz ...
Starting to download Net_Gearman-0.2.3.tgz (17,572 bytes)
......done: 17,572 bytes
could not extract the package.xml file from "/build/buildd/php5-5.3.10/pear-build-download/Net_Gearman-0.2.3.tgz"
Download of "pear/Net_Gearman" succeeded, but it is not a valid package archive
Error: cannot download "pear/Net_Gearman"
Download failed
install failed
這裝不起來是因為目前的php-pear的版本跟php本身的版本不同,所以才會導致裝不起來
php-pear的版本
dpkg --list | grep php-pear
ii  php-pear                         5.3.10-1ubuntu3.15                    PEAR - PHP Extension and Application Repository
php的版本
php -v
PHP 5.5.20-1+deb.sury.org~precise+1 (cli) (built: Dec 21 2014 19:54:33)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies  
這問題其實我本來也一直找不到為什麼,後來突發起想,想說來upgrade一下,可能搞不好就好了,結果被我誤打誤撞弄出來,其實細心一點看error訊息,就很容易找到問題了。
could not extract the package.xml file from "/build/buildd/php5-5.3.10/pear-build-download/Net_Gearman-0.2.3.tgz"
解法:
apt-get update
apt-get upgrade
sudo pear -d preferred_state=alpha install Net_Gearman-0.2.3