
Kali Linuxボックスで最初のDVWA設定を開始しました。 rootとしてmariadb-server
インストールしようとしました。apt-get install mariadb-server
エラーが発生したため続行できません。
Preparing to unpack .../6-mariadb-client-10.3_1%3a10.3.23-1_amd64.deb ...
Unpacking mariadb-client-10.3 (1:10.3.23-1) ...
Selecting previously unselected package mariadb-server-core-10.3.
Preparing to unpack .../7-mariadb-server-core-10.3_1%3a10.3.23-1_amd64.deb ...
Unpacking mariadb-server-core-10.3 (1:10.3.23-1) ...
Selecting previously unselected package rsync.
Preparing to unpack .../8-rsync_3.2.2-2_amd64.deb ...
Unpacking rsync (3.2.2-2) ...
Setting up mariadb-common (1:10.3.23-1) ...
update-alternatives: error: alternative path /etc/mysql/mariadb.cnf doesn't exist
dpkg: error processing package mariadb-common (--configure):
installed mariadb-common package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
mariadb-common
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@kali:~#
問題は破損したdpkgパッケージだと思います。これについてもっと知る必要があります。
答え1
いいですね。エラーによると、ファイルがありません。あなたができることは、パッケージをダウンロードして解凍し、不足しているファイルを挿入してからパッケージを再インストールすることです。
まず、次のコマンドを実行してパッケージをダウンロードします。
cd
mkdir mariadbcommon
cd mariadbcommon
apt-get download mariadb-common
これでファイルを抽出します。
ar xvf *
tar xvf dat*
次に、必要なファイルを正しい場所にコピーします。
cp ./etc/mysql/mariadb.cnf /etc/mysql/mariadb.cnf
最後に、パッケージを再インストールします。
apt-get update
apt-get install --reinstall mariadb-common
正しい測定のために元のパッケージを再インストールしてください。
apt-get install --reinstall mariadb-server
システム全体の構成ファイルの処理に問題がない場合は、次のコマンドを実行できます。
apt install --reinstall -o Dpkg::Options::="--force-confmiss" mariadb-common
そして
apt install --reinstall -o Dpkg::Options::="--force-confmiss" mariadb-server
エラーがあればメッセージを残してください。
また、ファイルの欠落エラーが発生した場合は、apt-file
ファイルを含むパッケージを識別するのに役立ちます。以下は、トラブルシューティングの手順を案内します。
まず、aptファイルをインストールします。
apt-get update
apt-get install apt-file
apt-file update
/etc/mysql/mariadb.cnf
たとえば、不足しているファイルを含むパッケージを検索するには、次のコマンドを実行します。
apt-file search /etc/mysql/mariadb.cnf
apt-get download
次に、またはapt download
コマンドを使用して必要なパッケージをダウンロードし、パッケージ(debファイル)をダウンロードします。
次に、このar xvf *
コマンドを使用してdebファイルを解凍し、このコマンドをtar xvf dat*
使用してシステムファイルを含む「data.tar.xz」ファイルを解凍します。
最後に、コマンドを使用して抽出したファイルを正しい場所にコピーしますcp
。