LoginSignup
10
8

More than 5 years have passed since last update.

Ubuntuで手動で削除してしまった設定ファイルが再インストールで生成されない件

Last updated at Posted at 2013-09-21

手動でファイルを削除してしまいました。
CentOSなら自動的に見つからない設定ファイルは生成してくれたのでUbuntuでもそうだろうと思っていました。
再インストールしてもデフォルトの設定ファイルは復元されませんでした。。。
いろいろと試行錯誤したのでまとまりがないです。

問題の行動

まず削除

$ sudo apt-get remove glance

再度インストール

$ sudo apt-get install glance

結果

/etc/glance/glance-api-paste.ini が見つかりませんでした。。。

どうにかする

まずパッケージを削除。

$ sudo apt-get purge glance
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required
  python-jsonschema python-json-pointer python-warlock glance-common python-httplib2 python-json-patch glance-registry
  python-swiftclient libyaml-0-2 python-anyjson python-glance python-boto python-kombu python-yaml python-oslo-config
  python-amqplib python-dateutil python-glanceclient python-xattr glance-api
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  glance*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 32.8 kB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 89765 files and directories currently installed.)
Removing glance ...

依存パッケージは削除してくれない?
以下のようにして対処。

$ sudo apt-get autoremove glance
$ sudo apt-get install glance

No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
 glance-registry
 glance
E: Sub-process /usr/bin/dpkg returned an error code (1)

エラーコードを吐いて一部インストール出来ない。
とにかくpurgeしまくる。
全部設定ファイルを削除。

$ sudo apt-get --purge remove glance-registry
$ sudo apt-get --purge remove glance
$ sudo apt-get install glance

とりあえずインストール時にエラーは出なくなったけど依然として /etc/glance/glance-api-paste.ini が生成されない。
他の設定ファイルは復元されているっぽい。
依存関係定義のミス?
直接依存パッケージ glance-api を指定して設定ファイルを強制的に再生成させる。

$ sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install glance-api

やっと生成された。。。

参考サイト

10
8
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
8