如何在 ubuntu 服务器上安装 phpmyadmin

Posted

技术标签:

【中文标题】如何在 ubuntu 服务器上安装 phpmyadmin【英文标题】:how to install phpmyadmin in ubuntu server 【发布时间】:2015-12-03 14:28:36 【问题描述】:

我尝试在 ubuntu 服务器 12.10 中安装 phpmyadmin,我尝试了 apt-get update 然后 apt-get install phpmyadmin 并且我有以下错误

apt-get install phpmyadmin
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package phpmyadmin

这是我的 /etc/apt/sources.list 视图

# deb cdrom:[Ubuntu-Server 12.10 _Quantal Quetzal_ - Release i386 (20121017.2)]/ quantal main restricted

#deb cdrom:[Ubuntu-Server 12.10 _Quantal Quetzal_ - Release i386 (20121017.2)]/ quantal main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://id.archive.ubuntu.com/ubuntu/ quantal main restricted
deb-src http://id.archive.ubuntu.com/ubuntu/ quantal main restricted

 ## Major bug fix updates produced after the final release of the
 ## distribution.
 deb http://id.archive.ubuntu.com/ubuntu/ quantal-updates main restricted
 deb-src http://id.archive.ubuntu.com/ubuntu/ quantal-updates main restricted

 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
 ## team. Also, please note that software in universe WILL NOT receive any
 ## review or updates from the Ubuntu security team.
 deb http://id.archive.ubuntu.com/ubuntu/ quantal universe
 deb-src http://id.archive.ubuntu.com/ubuntu/ quantal universe
 deb http://id.archive.ubuntu.com/ubuntu/ quantal-updates universe
 deb-src http://id.archive.ubuntu.com/ubuntu/ quantal-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://id.archive.ubuntu.com/ubuntu/ quantal multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ quantal multiverse
deb http://id.archive.ubuntu.com/ubuntu/ quantal-updates multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ quantal-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://id.archive.ubuntu.com/ubuntu/ quantal-backports main restricted      universe multiverse
deb-src http://id.archive.ubuntu.com/ubuntu/ quantal-backports main  restricted universe multiverse

deb http://security.ubuntu.com/ubuntu quantal-security main restricted
deb-src http://security.ubuntu.com/ubuntu quantal-security main restricted
deb http://security.ubuntu.com/ubuntu quantal-security universe
deb-src http://security.ubuntu.com/ubuntu quantal-security universe
deb http://security.ubuntu.com/ubuntu quantal-security multiverse
deb-src http://security.ubuntu.com/ubuntu quantal-security multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu quantal partner
# deb-src http://archive.canonical.com/ubuntu quantal partner

## Uncomment the following two lines to add software from Ubuntu's
## 'extras' repository.
## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
# deb http://extras.ubuntu.com/ubuntu quantal main
# deb-src http://extras.ubuntu.com/ubuntu quantal main

有什么帮助吗?

【问题讨论】:

Ubuntu 12.10 已报废:fridge.ubuntu.com/2014/05/01/… 【参考方案1】:

首先在 Linux ( Ubuntu ) 中,我们需要使用以下命令进行更新和升级

sudo apt-get update sudo apt-get upgrade

然后你可以运行以下命令来安装phpmyadmin

sudo apt-get install phpmyadmin

它会询问帐户的用户名和密码

【讨论】:

酷,很高兴听到@SatheeshKumar【参考方案2】:

试试这个;

sudo apt-get upgrade

sudo apt-get install phpmyadmin

【讨论】:

【参考方案3】:

首先:在安装任何新内容之前,确保可用软件包列表是最新的。

sudo apt-get -y update

apt-get -y install phpmyadmin

第二个:在第一个屏幕上,使用空格键选择 apache2,然后按 Enter 继续。

在第二个屏幕上,询问“使用 dbconfig-common 为 phpmyadmin 配置数据库?”,选择是,然后按 Enter 继续。

在第三个屏幕输入您的 MySQL 密码,然后按 Enter 继续。

第三:将以下内容添加到文件“/etc/apache2/apache2.conf”的底部:

# phpMyAdmin Configuration
Include /etc/phpmyadmin/apache.conf

保存并关闭 apache.conf 文件

最后:

sudo service apache2 restart

现在已经完成了。

【讨论】:

以上是关于如何在 ubuntu 服务器上安装 phpmyadmin的主要内容,如果未能解决你的问题,请参考以下文章

如何在 Ubuntu 14.04 中更新到最新的 phpMyadmin

如何在Ubuntu14.04服务器上安装NodeJS

如何在 ubuntu 服务器上安装 phpmyadmin

如何检查一个包是不是已经安装在 ubuntu 上?

如何在 Ubuntu 16.04 上安装 PHPMyAdmin

在 Ubuntu 18.04 中启动 Xampp 时遇到 MySQL 错误