问题
I need to install python3 in my EMR cluster (AMI 3.1.1) as a part of bootstraping step. So I added the following command:
sudo yum install -y python3
But everytime I got an error saying the following:
Existing lock /var/run/yum.pid: another copy is running as pid 1829.
Another app is currently holding the yum lock; waiting for it to exit...
The other application is: yum
How can I avoid this error? Or is there a way to install Python 3 without going through this route?
回答1:
The issue is that the Amazon Linux AMI is performing a yum update as part of boot. A bootstrap action can collide with it as seen here. Just add a sleep for a couple minutes before the yum install.
回答2:
I ended up installing from the source code:
wget --no-check-certificate -O Python-3.4.2.tgz "https://www.python.org/ftp/python/3.4.2/Python-3.4.2.tgz"
tar xvfz Python-3.4.2.tgz
cd Python-3.4.2
./configure
make
sudo make altinstall
回答3:
Try with
sudo apt-get install -y python3
来源:https://stackoverflow.com/questions/27738179/getting-existing-lock-var-run-yum-pid-another-copy-is-running-as-pid-dur