libmagic1로 인해 apt-get 설치가 실패함

libmagic1로 인해 apt-get 설치가 실패함

libmagic1과 관련된 다음 오류로 인해 내 apt-get 설치가 실패했습니다. 내 우분투 버전은 12.04 LTS입니다. 혹시 아시는 분 계시면 도와주실 수 있나요? 내 작업에 필요한 일부 패키지를 업데이트하려면 이 문제를 해결해야 합니다.

~# sudo apt-get -f install
Reading package lists... Done

Building dependency tree
Reading state information... Done

Correcting dependencies... Done

The following packages were automatically installed and are no longer required:

  gir1.2-ubuntuoneui-3.0 libblas-dev patchutils libncurses5-dev po-debconf intltool-debian libreadline6-dev intltool liblapack-dev libtinfo-dev python-scour lesstif2 libubuntuoneui-3.0-1
  thunderbird-globalmenu html2text libmail-sendmail-perl libsys-hostname-long-perl dpatch libbz2-dev libreadline-dev
Use 'apt-get autoremove' to remove them.

The following extra packages will be installed:
  libmagic1

The following packages will be upgraded:
  libmagic1

1 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.
305 not fully installed or removed.

Need to get 0 B/218 kB of archives.

After this operation, 5,120 B of additional disk space will be used.

Do you want to continue [Y/n]? Y

(Reading database ... 263712 files and directories currently installed.)
Preparing to replace libmagic1 5.09-2 (using .../libmagic1_5.09-2ubuntu0.6_amd64.deb) ...
Unpacking replacement libmagic1 ...
dpkg: warning: libmagic1: conffile 'etc/magic' is not a plain file or symlink (= '/usr/share/file/magic')
dpkg: error processing /var/cache/apt/archives/libmagic1_5.09-2ubuntu0.6_amd64.deb (--unpack):

 unable to open '/etc/magic.dpkg-new': No such file or directory

No apport report written because MaxReports is reached already Errors were encountered while processing:

 /var/cache/apt/archives/libmagic1_5.09-2ubuntu0.6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

답변1

해당 파일이 있는지 확인 하고 폴더 /etc/magic도 있는지 확인하세요./usr/share/file/magic

/etc/magic이 존재하지 않으면 다음을 사용하십시오.

sudo touch /etc/magic

usr/share/file/magic 폴더가 없으면 다음을 사용하십시오.

sudo mkdir /usr/share/file/magic

그런 다음 다시 시도하세요. 문제가 해결되거나 적어도 계속할 수 있는 다른 방법이 나올 것입니다.

관련 정보