损坏的软件包安装、清除、配置、重新安装、apt-get -f 无法工作

损坏的软件包安装、清除、配置、重新安装、apt-get -f 无法工作

所以我通过以下命令安装了一些软件包:

openstack@controller:~$ sudo apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central ceilometer-agent-notification ceilometer-alarm-evaluator ceilometer-alarm-notifier python-ceilometerclient

它正在下载,并开始进行准备、解压、选择、设置部分,但在下载过程中系统意外重新启动。

重新启动后,想要重新安装遇到此问题的数据包:

openstack@controller:~$ sudo apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central ceilometer-agent-notification ceilometer-alarm-evaluator ceilometer-alarm-notifier python-ceilometerclient
[sudo] password for openstack: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
ceilometer-agent-central is already the newest version.
ceilometer-agent-notification is already the newest version.
ceilometer-alarm-evaluator is already the newest version.
ceilometer-alarm-notifier is already the newest version.
ceilometer-api is already the newest version.
ceilometer-collector is already the newest version.
python-ceilometerclient is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
7 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up ceilometer-common (2014.2.1-0ubuntu1~cloud0) ...
2015-01-23 13:27:35.212 3663 CRITICAL ceilometer [-] OperationalError: (OperationalError) table meter already exists u'\nCREATE TABLE meter (\n\tid INTEGER NOT NULL, \n\tcounter_name VARCHAR(255), \n\tuser_id VARCHAR(255), \n\tproject_id VARCHAR(255), \n\tresource_id VARCHAR(255), \n\tresource_metadata VARCHAR(5000), \n\tcounter_type VARCHAR(255), \n\tcounter_volume INTEGER, \n\tcounter_duration INTEGER, \n\ttimestamp DATETIME, \n\tmessage_signature VARCHAR(1000), \n\tmessage_id VARCHAR(1000), \n\tPRIMARY KEY (id)\n)\n\n' ()
2015-01-23 13:27:35.212 3663 TRACE ceilometer Traceback (most recent call last):
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/bin/ceilometer-dbsync", line 10, in <module>
2015-01-23 13:27:35.212 3663 TRACE ceilometer     sys.exit(dbsync())
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/ceilometer/cmd/storage.py", line 32, in dbsync
2015-01-23 13:27:35.212 3663 TRACE ceilometer     storage.get_connection_from_config(cfg.CONF, 'metering').upgrade()
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/ceilometer/storage/impl_sqlalchemy.py", line 240, in upgrade
2015-01-23 13:27:35.212 3663 TRACE ceilometer     migration.db_sync(self._engine_facade.get_engine(), path)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/oslo/db/sqlalchemy/migration.py", line 79, in db_sync
2015-01-23 13:27:35.212 3663 TRACE ceilometer     return versioning_api.upgrade(engine, repository, version)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
2015-01-23 13:27:35.212 3663 TRACE ceilometer     return _migrate(url, repository, version, upgrade=True, err=err, **opts)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "<string>", line 2, in _migrate
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2015-01-23 13:27:35.212 3663 TRACE ceilometer     return f(*a, **kw)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
2015-01-23 13:27:35.212 3663 TRACE ceilometer     schema.runchange(ver, change, changeset.step)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 93, in runchange
2015-01-23 13:27:35.212 3663 TRACE ceilometer     change.run(self.engine, step)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 148, in run
2015-01-23 13:27:35.212 3663 TRACE ceilometer     script_func(engine)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/ceilometer/storage/sqlalchemy/migrate_repo/versions/001_add_meter_table.py", line 98, in upgrade
2015-01-23 13:27:35.212 3663 TRACE ceilometer     i.create()
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 655, in create
2015-01-23 13:27:35.212 3663 TRACE ceilometer     checkfirst=checkfirst)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1617, in _run_visitor
2015-01-23 13:27:35.212 3663 TRACE ceilometer     conn._run_visitor(visitorcallable, element, **kwargs)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1246, in _run_visitor
2015-01-23 13:27:35.212 3663 TRACE ceilometer     **kwargs).traverse_single(element)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 120, in traverse_single
2015-01-23 13:27:35.212 3663 TRACE ceilometer     return meth(obj, **kw)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 732, in visit_table
2015-01-23 13:27:35.212 3663 TRACE ceilometer     self.connection.execute(CreateTable(table))
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 729, in execute
2015-01-23 13:27:35.212 3663 TRACE ceilometer     return meth(self, multiparams, params)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 69, in _execute_on_connection
2015-01-23 13:27:35.212 3663 TRACE ceilometer     return connection._execute_ddl(self, multiparams, params)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 783, in _execute_ddl
2015-01-23 13:27:35.212 3663 TRACE ceilometer     compiled
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
2015-01-23 13:27:35.212 3663 TRACE ceilometer     context)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1156, in _handle_dbapi_exception
2015-01-23 13:27:35.212 3663 TRACE ceilometer     util.raise_from_cause(newraise, exc_info)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
2015-01-23 13:27:35.212 3663 TRACE ceilometer     reraise(type(exception), exception, tb=exc_tb)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
2015-01-23 13:27:35.212 3663 TRACE ceilometer     context)
2015-01-23 13:27:35.212 3663 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
2015-01-23 13:27:35.212 3663 TRACE ceilometer     cursor.execute(statement, parameters)
2015-01-23 13:27:35.212 3663 TRACE ceilometer OperationalError: (OperationalError) table meter already exists u'\nCREATE TABLE meter (\n\tid INTEGER NOT NULL, \n\tcounter_name VARCHAR(255), \n\tuser_id VARCHAR(255), \n\tproject_id VARCHAR(255), \n\tresource_id VARCHAR(255), \n\tresource_metadata VARCHAR(5000), \n\tcounter_type VARCHAR(255), \n\tcounter_volume INTEGER, \n\tcounter_duration INTEGER, \n\ttimestamp DATETIME, \n\tmessage_signature VARCHAR(1000), \n\tmessage_id VARCHAR(1000), \n\tPRIMARY KEY (id)\n)\n\n' ()
2015-01-23 13:27:35.212 3663 TRACE ceilometer 
dpkg: error processing package ceilometer-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of ceilometer-agent-central:
 ceilometer-agent-central depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-agent-central (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-agent-notification:
 ceilometer-agent-notification depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-agent-notification (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-alarm-evaluator:
 ceilometer-alarm-evaluator depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  No apport report written because the error message indicates its a followup error from a previous failure.
  No apport report written because the error message indicates its a followup error from a previous failure.
  No apport report written because MaxReports is reached already
                                                                No apport report written because MaxReports is reached already
                    No apport report written because MaxReports is reached already
                                                                                  No apport report written because MaxReports is reached already
                                      Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-alarm-evaluator (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-alarm-notifier:
 ceilometer-alarm-notifier depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-alarm-notifier (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-api:
 ceilometer-api depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-api (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-collector:
 ceilometer-collector depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-collector (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ceilometer-common
 ceilometer-agent-central
 ceilometer-agent-notification
 ceilometer-alarm-evaluator
 ceilometer-alarm-notifier
 ceilometer-api
 ceilometer-collector
E: Sub-process /usr/bin/dpkg returned an error code (1)
openstack@controller:~$ 

然后经过搜索尝试:

sudo apt-get -f install

没有用,并告诉我尝试

sudo dpkg --configure -a

所以:

openstack@controller:~$ sudo dpkg --configure -a
Setting up ceilometer-common (2014.2.1-0ubuntu1~cloud0) ...
2015-01-23 13:51:52.139 3865 CRITICAL ceilometer [-] OperationalError: (OperationalError) table meter already exists u'\nCREATE TABLE meter (\n\tid INTEGER NOT NULL, \n\tcounter_name VARCHAR(255), \n\tuser_id VARCHAR(255), \n\tproject_id VARCHAR(255), \n\tresource_id VARCHAR(255), \n\tresource_metadata VARCHAR(5000), \n\tcounter_type VARCHAR(255), \n\tcounter_volume INTEGER, \n\tcounter_duration INTEGER, \n\ttimestamp DATETIME, \n\tmessage_signature VARCHAR(1000), \n\tmessage_id VARCHAR(1000), \n\tPRIMARY KEY (id)\n)\n\n' ()
2015-01-23 13:51:52.139 3865 TRACE ceilometer Traceback (most recent call last):
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/bin/ceilometer-dbsync", line 10, in <module>
2015-01-23 13:51:52.139 3865 TRACE ceilometer     sys.exit(dbsync())
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/ceilometer/cmd/storage.py", line 32, in dbsync
2015-01-23 13:51:52.139 3865 TRACE ceilometer     storage.get_connection_from_config(cfg.CONF, 'metering').upgrade()
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/ceilometer/storage/impl_sqlalchemy.py", line 240, in upgrade
2015-01-23 13:51:52.139 3865 TRACE ceilometer     migration.db_sync(self._engine_facade.get_engine(), path)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/oslo/db/sqlalchemy/migration.py", line 79, in db_sync
2015-01-23 13:51:52.139 3865 TRACE ceilometer     return versioning_api.upgrade(engine, repository, version)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
2015-01-23 13:51:52.139 3865 TRACE ceilometer     return _migrate(url, repository, version, upgrade=True, err=err, **opts)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "<string>", line 2, in _migrate
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 160, in with_engine
2015-01-23 13:51:52.139 3865 TRACE ceilometer     return f(*a, **kw)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
2015-01-23 13:51:52.139 3865 TRACE ceilometer     schema.runchange(ver, change, changeset.step)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 93, in runchange
2015-01-23 13:51:52.139 3865 TRACE ceilometer     change.run(self.engine, step)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 148, in run
2015-01-23 13:51:52.139 3865 TRACE ceilometer     script_func(engine)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/ceilometer/storage/sqlalchemy/migrate_repo/versions/001_add_meter_table.py", line 98, in upgrade
2015-01-23 13:51:52.139 3865 TRACE ceilometer     i.create()
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/schema.py", line 655, in create
2015-01-23 13:51:52.139 3865 TRACE ceilometer     checkfirst=checkfirst)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1617, in _run_visitor
2015-01-23 13:51:52.139 3865 TRACE ceilometer     conn._run_visitor(visitorcallable, element, **kwargs)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1246, in _run_visitor
2015-01-23 13:51:52.139 3865 TRACE ceilometer     **kwargs).traverse_single(element)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 120, in traverse_single
2015-01-23 13:51:52.139 3865 TRACE ceilometer     return meth(obj, **kw)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 732, in visit_table
2015-01-23 13:51:52.139 3865 TRACE ceilometer     self.connection.execute(CreateTable(table))
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 729, in execute
2015-01-23 13:51:52.139 3865 TRACE ceilometer     return meth(self, multiparams, params)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/ddl.py", line 69, in _execute_on_connection
2015-01-23 13:51:52.139 3865 TRACE ceilometer     return connection._execute_ddl(self, multiparams, params)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 783, in _execute_ddl
2015-01-23 13:51:52.139 3865 TRACE ceilometer     compiled
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 958, in _execute_context
2015-01-23 13:51:52.139 3865 TRACE ceilometer     context)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1156, in _handle_dbapi_exception
2015-01-23 13:51:52.139 3865 TRACE ceilometer     util.raise_from_cause(newraise, exc_info)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/util/compat.py", line 199, in raise_from_cause
2015-01-23 13:51:52.139 3865 TRACE ceilometer     reraise(type(exception), exception, tb=exc_tb)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 951, in _execute_context
2015-01-23 13:51:52.139 3865 TRACE ceilometer     context)
2015-01-23 13:51:52.139 3865 TRACE ceilometer   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 436, in do_execute
2015-01-23 13:51:52.139 3865 TRACE ceilometer     cursor.execute(statement, parameters)
2015-01-23 13:51:52.139 3865 TRACE ceilometer OperationalError: (OperationalError) table meter already exists u'\nCREATE TABLE meter (\n\tid INTEGER NOT NULL, \n\tcounter_name VARCHAR(255), \n\tuser_id VARCHAR(255), \n\tproject_id VARCHAR(255), \n\tresource_id VARCHAR(255), \n\tresource_metadata VARCHAR(5000), \n\tcounter_type VARCHAR(255), \n\tcounter_volume INTEGER, \n\tcounter_duration INTEGER, \n\ttimestamp DATETIME, \n\tmessage_signature VARCHAR(1000), \n\tmessage_id VARCHAR(1000), \n\tPRIMARY KEY (id)\n)\n\n' ()
2015-01-23 13:51:52.139 3865 TRACE ceilometer 
dpkg: error processing package ceilometer-common (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of ceilometer-collector:
 ceilometer-collector depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-collector (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-agent-central:
 ceilometer-agent-central depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-agent-central (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-alarm-evaluator:
 ceilometer-alarm-evaluator depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-alarm-evaluator (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-agent-notification:
 ceilometer-agent-notification depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-agent-notification (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-api:
 ceilometer-api depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-api (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ceilometer-alarm-notifier:
 ceilometer-alarm-notifier depends on ceilometer-common (= 2014.2.1-0ubuntu1~cloud0); however:
  Package ceilometer-common is not configured yet.

dpkg: error processing package ceilometer-alarm-notifier (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 ceilometer-common
 ceilometer-collector
 ceilometer-agent-central
 ceilometer-alarm-evaluator
 ceilometer-agent-notification
 ceilometer-api
 ceilometer-alarm-notifier
openstack@controller:~$ 

思想清除可能会起作用:

openstack@controller:~$ sudo apt-get  purge ceilometer-common ; sudo apt-get  purge  ceilometer-agent-central;sudo apt-get  purge ceilometer-agent-notification; sudo apt-get  purge ceilometer-alarm-evaluator ;sudo apt-get  purge ceilometer-alarm-notifier; sudo apt-get  purge ceilometer-api; sudo apt-get  purge  ceilometer-collector;
[sudo] password for openstack: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
  ceilometer-agent-central* ceilometer-agent-notification*
  ceilometer-alarm-evaluator* ceilometer-alarm-notifier* ceilometer-api*
  ceilometer-collector* ceilometer-common*
0 upgraded, 0 newly installed, 7 to remove and 37 not upgraded.
7 not fully installed or removed.
After this operation, 391 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 219640 files and directories currently installed.)
Removing ceilometer-agent-central (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-agent-central (2014.2.1-0ubuntu1~cloud0) ...
 Removing any system startup links for /etc/init.d/ceilometer-agent-central ...
Removing ceilometer-agent-notification (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-agent-notification (2014.2.1-0ubuntu1~cloud0) ...
 Removing any system startup links for /etc/init.d/ceilometer-agent-notification ...
Removing ceilometer-alarm-evaluator (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-alarm-evaluator (2014.2.1-0ubuntu1~cloud0) ...
Removing ceilometer-alarm-notifier (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-alarm-notifier (2014.2.1-0ubuntu1~cloud0) ...
Removing ceilometer-api (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-api (2014.2.1-0ubuntu1~cloud0) ...
 Removing any system startup links for /etc/init.d/ceilometer-api ...
Removing ceilometer-collector (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-collector (2014.2.1-0ubuntu1~cloud0) ...
 Removing any system startup links for /etc/init.d/ceilometer-collector ...
Removing ceilometer-common (2014.2.1-0ubuntu1~cloud0) ...
Purging configuration files for ceilometer-common (2014.2.1-0ubuntu1~cloud0) ...
dpkg: warning: while removing ceilometer-common, directory '/var/log/ceilometer' not empty so not removed
dpkg: warning: while removing ceilometer-common, directory '/var/lib/ceilometer' not empty so not removed
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-agent-central' is not installed, so not removed
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-agent-notification' is not installed, so not removed
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-alarm-evaluator' is not installed, so not removed
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-alarm-notifier' is not installed, so not removed
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-api' is not installed, so not removed
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-collector' is not installed, so not removed
The following package was automatically installed and is no longer required:
  python-ceilometer
Use 'apt-get autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 37 not upgraded.
openstack@controller:~$ 

然后自动删除:

openstack@controller:~$  sudo apt-get autoremove ceilometer-api ceilometer-collector 

ceilometer-agent-central ceilometer-agent-notification ceilometer-alarm-evaluator ceilometer-alarm-notifier python-ceilometerclient
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'ceilometer-agent-central' is not installed, so not removed
Package 'ceilometer-agent-notification' is not installed, so not removed
Package 'ceilometer-alarm-evaluator' is not installed, so not removed
Package 'ceilometer-alarm-notifier' is not installed, so not removed
Package 'ceilometer-api' is not installed, so not removed
Package 'ceilometer-collector' is not installed, so not removed
The following packages will be REMOVED:
  python-ceilometer python-ceilometerclient
0 upgraded, 0 newly installed, 2 to remove and 37 not upgraded.
After this operation, 3,774 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 219592 files and directories currently installed.)
Removing python-ceilometer (2014.2.1-0ubuntu1~cloud0) ...
Removing python-ceilometerclient (1.0.10-0ubuntu1~cloud0) ...
openstack@controller:~$ 

甚至认为清理了缓存:

openstack@controller:~$ sudo apt-get clean
[sudo] password for openstack: 
openstack@controller:~$ sudo apt-get autoclean 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
openstack@controller:~$ sudo apt-get update 

现在一切正常,但它安装了未损坏的数据包,并面临与上述 apt-get install 相同的错误(http://paste.ubuntu.com/9832819/

又做了

dpkg --configure -a 

给出与上面相同的结果

真的不知道该如何解决这个问题,如果我可以将系统回滚到第一次 sudo apt-get install 时我的系统意外重启的地方,那就太好了

有办法解决吗?

答案1

尝试重新安装 ceilometer:

sudo apt-get purge ceilometer-api ceilometer-collector ceilometer-agent-central ceilometer-agent-notification ceilometer-alarm-evaluator ceilometer-alarm-notifier python-ceilometerclient
sudo apt-get --purge autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/ceilometer/ /var/log/ceilometer
sudo deluser ceilometer
sudo apt-get update
sudo apt-get dist-upgrade (or upgrade)
sudo apt-get install ceilometer-api ceilometer-collector ceilometer-agent-central ceilometer-agent-notification ceilometer-alarm-evaluator ceilometer-alarm-notifier python-ceilometerclient

如果你正在使用 mongodb,你必须删除 ceilometer 数据库

相关内容