默认的debian 8.6 下载nginx后无法安装,提示找不到编译器gcc
修改 vi /etc/apt/sources.list
里面的debian源全部删掉
填入163的debian源 (Use jessie version due to stable version)
Pls directly download the list file from 163 mirror.
apt-get update
然后安装gcc
apt-get install build-essential
安装nginx依赖库
apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev
2. Could not get lock /var/lib/dpkg/lock
通过终端安装程序sudo apt-get install xxx时出错:
Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
出现这个问题可能是有另外一个程序正在运行,导致资源被锁不可用。而导致资源被锁的原因可能是上次运行安装或更新时没有正常完成,进而出现此状况,解决的办法其实很简单:
在终端中敲入以下两句
sudo rm /var/cache/apt/archives/lock
sudo rm /var/lib/dpkg/lock
Enjoy it.