云计算平台OpenStack安装相关问题
apt常用命令:
# apt-get 系列=========================================
apt-get update # 更新安装列表
apt-get upgrade # 升级软件
apt-get install software_name # 安装软件
apt-get --purge remove software_name # 卸载软件及其配置
apt-get autoremove software_name # 卸载软件及其依赖的安装包
apt-get install software-properties-common #安装常用软件包
apt-get update && apt-get dist-upgrade #主机上升级包
apt-get install python-openstackclient # 安装 OpenStack 客户端
apt-get install mariadb-server python-pymysql # 安装sql软件包
sudo apt-get remove --purge mysql-server mysql-client mysql-common # 卸载软件
sudo apt-get autoremove #自动删除
sudo apt-get autoclean #自动清理
sudo apt-get install mariadb-server #重装软件
# dpkg系列=============================================
dpkg --list # 展示已安装软件
dpkg -i package.deb #安装/更新一个 deb 包
dpkg -r package_name #从系统删除一个 deb 包
dpkg -l #显示系统中所有已经安装的 deb 包
dpkg -l | grep httpd #显示所有名称中包含 "httpd" 字样的deb包
dpkg -s package_name #获得已经安装在系统中一个特殊包的信息
dpkg -L package_name #显示系统中已经安装的一个deb包所提供的文件列表
dpkg --contents package.deb #显示尚未安装的一个包所提供的文件列表
dpkg -S /bin/ping #确认所给的文件由哪个deb包提供
# sudo系列=============================================
sudo su # 切换到管理员身份
sudo dpkg -i /tmp/mozilla_feng0/apt_1.6.12ubuntu0.2_amd64.deb #管理员身份安装该软件包
# 其它=======================================
cd /etc/apt
#备份一下 cp sources.list sources.list_bak
# rm sources.list # 删除指定路径文件,切忌使用rm -f
1、ping不通百度
错误描述:无法ping通百度
错误原因:本地主机未连接网络
解决办法:将本地主机连接网络。
2,没有安装权限
问题描述:
E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?
原因:上锁了,没有权限
解决办法:
删除这两个文件
sudo rm /var/lib/dpkg/lock-frontend
sudo rm /var/lib/dpkg/lock
3、Unable to locate package chorny
问题描述:Unable to locate package chorny
问题原因:未在install之前进行软件源更新。
解决办法:在sudo apt-get install 之前更新软件源,即执行sudo apt-get update
4、controller虚拟机无法与compute虚拟机进行通信,ping不同。
问题描述:虚拟机相互之间无法ping通。
问题原因:IP错误,未在同一局域网内。
解决办法:重新设置IP为同一局域网。
5、Unable to locate package software-propert
问题描述:Unable to locate package software-propert
问题原因:要对apt-get、及奥普特进行更新
解决办法:
apt-get update
apt-get install python-software-properties
apt-get install apt-file
apt-file update
apt-get install software-properties-common
apt-get install vim
6、cloud-archive for Mitaka only supported on trusty
问题描述:cloud-archive for Mitaka only supported on trusty
问题原因:不支持???
解决办法:
1、执行命令 apt-get update && apt-get dist-upgrade,执行完成后重启系统
2、执行命令 apt-get install python-openstackclient
7、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?
错误描述: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?
错误原因:有进程占用
解决办法:
1、杀死所有进程并重新启动该服务。
2、直接通过命令删除该锁文件
sudo rm /var/lib/dpkg/lock
8、Ubantu下载过慢!
问题描述:Ubantu下载过慢!!!
问题原因:Ubantu镜像源是默认的镜像源,国外服务器访问下载速度太慢
解决办法:
1、备份原有
cp /etc/apt/sources.list /etc/apt/sources.list.old
2、修改配置文件 路径:/etc/apt/sources.list
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
9、Unable to locate package mariadb-server
E: Unable to locate package python-pymysql
问题描述:
运行命令 apt-get install mariadb-server python-pymysql 出现以下错误:
Unable to locate package mariadb-server
E: Unable to locate package python-pymysql
问题原因:没有下载安装包,通过以下命令进行软件安装包升级再进行安装
apt-get update && apt-get dist-upgrade
10、Unable to correct problems, you have held broken packages.
问题描述:运行命令 apt-get install mariadb-server python-pymysql 出现以下错误:
Unable to correct problems, you have held broken packages.
问题原因:下载的包有丢失或损坏
解决办法:需要重新强制下载,要找到该包,再下载。
11、apt-get command not found
问题描述:apt-get command not found,无法使用apt-get进行下载安装
问题原因:apt-get被误删了,所以找不到apt-get命令
解决办法:由于也没有安装yum及其他安装软件,因此只能手动到镜像源去下载apt压缩包,解压后使用apt安装apt-get.
解决步骤:
-
首先去ubuntu官方下载apt包 https://packages.ubuntu.com/search?suite=bionic&searchon=names&keywords=apt 下载时注意你自己的CPU的架构以及是32位还是64位。
阿里云Ubantu镜像apt软件包地址:http://mirrors.aliyun.com/ubuntu/pool/main/a/apt/ 。
-
解压相关文件,安装,然后用apt 来装apt-get(这步有其他相关文档可以收索,就不写了)
-
修改sources.list 去阿里官方镜像https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.3e221b11yNkYYG,需要注意的你是ubuntu的多少版本,这个时候你的apt-get update就有飞一样的速度咯
-
apt-get update更新软件源 完事后你就可以apt-get install了
12、Unmet dependencies. Try ‘apt --fix-broken install’ with no packages (or specify a solution).
错误描述:安装软件出现以下错误提示。
@feng# sudo apt-get install aptitude
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
apt : Depends: libapt-pkg5.0 (>= 1.6.12ubuntu0.2) but 1.6.8 is to be installed
aptitude : Depends: aptitude-common (= 0.8.10-6ubuntu1) but 0.7.4-2ubuntu2 is to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
错误原因:有破损的包存在,无法进行安装。
解决办法:运行 apt --fix-broken install 进行补全安装。
sql软件包及之前内容环境搭建完毕
13、Failed to start MariaDB 10.1.47 database lines 1-17/17 (END)
错误描述:
mariadb.service: Main process exited, co
Dec 21 05:28:59 controller systemd[1]: mariadb.service: Failed with result 'exi
Dec 21 05:28:59 controller systemd[1]: Failed to start MariaDB 10.1.47 database
lines 1-17/17 (END)
错误原因:安装错误!
解决办法:重新安装!!
14、Ubantu安装MariaDB时出现依赖性错误,无法安装。
错误描述:
dpkg: error processing package mariadb-server-10.1 (--configure):
installed mariadb-server-10.1 package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1); however:
Package mariadb-server-10.1 is not configured yet.
dpkg: error processing package mariadb-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for ureadahead (0.100.0-21) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for systemd (237-3ubuntu10.43) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Errors were encountered while processing:
mariadb-server-10.1
mariadb-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
错误原因:暂不明确
解决办法:
尝试的方法:
#卸载清楚之后重新安装
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get install mariadb-server
sudo apt-get --yes autoremove --purge mysql-server
sudo apt-get --yes autoremove --purge mysql-client
sudo apt-get --yes autoremove --purge mysql-common
sudo rm -rf /var/lib/mysql /etc/mysql ~/.mysql
sudo dpkg --configure -a
最终解决方案:
sudo rm /var/lib/mysql/ -R
sudo rm /etc/mysql/ -R
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor #这一步选Yes
sudo apt-get install mysql-server mysql-common #重新输入密码
15、Ubantu启动mysql报错
错误描述:Ubantu启动mysql报错,
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")
错误原因:未启动mysql服务.
解决办法:通过下面命令行启动服务
service mysql start
16、error processing package mariadb-server-10.1 (–configure):
错误描述:
error processing package mariadb-server-10.1 (--configure):
installed mariadb-server-10.1 package post-installation script subprocess returned error exit status 2
dpkg: dependency problems prevent configuration of mariadb-server:
mariadb-server depends on mariadb-server-10.1 (>= 1:10.1.47-0ubuntu0.18.04.1); however:
Package mariadb-server-10.1 is not configured yet.
dpkg: error processing package mariadb-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Processing triggers for libc-bin (2.27-3ubuntu1.4)
错误原因:
不明原因,可能安装错误或其它错误原因!!(具体尚不明确!)
解决办法:
sudo rm /var/lib/mysql/ -R
sudo rm /etc/mysql/ -R
sudo apt-get autoremove mysql* --purge
sudo apt-get remove apparmor #这一步选Yes
sudo apt-get install mysql-server mysql-common #重新输入密码
17、数据库连不上,通过mysql无法连接数据
错误描述:数据库连接不上,无法通过mysql命令行进行访问数据
错误原因:直接访问没有数据库登录权限,root权限用户密码不知道。(搞忘了)
解决办法:通过以下方式进行解决。
service mysql stop //停止mysql服务
mysqld_safe --skip-grant-tables & //过滤权限
mysql //进入mysql命令行模式
mysql> use mysql;//切换database
mysql> UPDATE user SET password=password("test123") WHERE user='root'; //更改root用户密码
mysql> exit; //退出mysql命令行模式
上面是可能遇到的错误,或许有些错误并未出现,后续会持续更新错误。