Some minor problems with installing the lamp environment under Ubuntu

Source: Internet
Author: User

0x00

I got a little bit of the lamp on the server today.

The installation process encountered a lot of small problems

Record the solution.

The server is installing Ubuntu 16.04.1

0x01

The first thing you'll encounter when installing something with the Apt-get install

E:could not get Lock/var/lib/dpkg/lock-open (11:resource temporarily unavailable)
E:unable to lock the Administration directory (/var/lib/dpkg/), is another process using it?

It should be because apt is running

When I looked at it with Pgrep, there was a process.

The process can be killed directly through the PID---

You can also delete locked files (two methods)

1. You can rm /var/lib/dpkg/lock

and then reconfigure dpkg --configure -a

2. rm /var/lib/apt/lists/lock

  rm /var/cache/apt/archives/lock

Then update the Apt-get update

The above situation encountered two times two ways to delete files have been tried

(The above error can also be resolved with the same method after the update is interrupted)

0x02

Have encountered an error

Dpkg is interrupted, you must manually run ' dpkg--configure-a ' to correct the problem.

Try running the dpkg--configure-a

Then update the Apt-get update

Apt-get Upgrade

Then there will still be an error asking to run

Apt-get-f Install

Run as required to resolve the issue

0x03

This error has occurred during the update.

error:parsing file '/var/lib/dpkg/updates/0008 ' near line 0:

Baidu a bit

rm/var/lib/dpkg/updates/*

Re-update

Apt-get Update

Apt-get Upgrade

It's going to solve the problem.

0x04

And finally, it was a very grave mistake.

When installing the PHP5

运行apt-get install php5 libapache2-mod-php5

Cause an error

e: Package ' php5 ' has no E:package ' LIBAPACHE2-MOD-PHP5 ' has no installation candidate

 

Baidu found out because Ubuntu 16.04 comes with PHP7 so there's no PHP5 package

https://stackoverflow.com/ questions/36788873/package-php5-have-no-installation-candidate-ubuntu-16-04

workaround

 

add-apt- Ppa:ondrej/ php

apt-get update

apt-get install php5.6

There is also an error in the building environment after the update

Finally post a few good lamp build tutorial

https://zhuanlan.zhihu.com/p/25461483

https://zhuanlan.zhihu.com/p/24945130

Http://www.linuxidc.com/Linux/2016-01/127180.htm

Some minor problems with installing the lamp environment under Ubuntu

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.