我尝试 apt-get install postgresql,但由于对 texlive 的依赖性投诉而失败。
错误消息建议使用 apt --fix-broken install,但是也会失败并显示有关 texlive 的投诉。
我确实使用 texlive,但我不确定它与 postgres 有何关系。
cat /etc/apt/sources.list
deb http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse
deb-src http://security.ubuntu.com/ubuntu bionic-security multiverse
cat /etc/lsb-release
:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"
uname -a
Linux TroysYoga 4.4.0-174-generic #204-Ubuntu SMP Wed Jan 29 06:41:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
控制台输出:
troy@TroysYoga:~$ sudo apt-get install postgresql
[sudo] password for troy:
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:
context : Depends: texlive-binaries (>= 2017)
Depends: texlive-base (>= 2017) but 2015.20160320-1ubuntu0.1 is to be installed
Depends: texlive-metapost (>= 2017) but 2015.20160320-1ubuntu0.1 is to be installed
Recommends: fonts-freefont but it is not installable
dvipng : Depends: texlive-base-bin
feynmf : Depends: texlive-font-utils but it is not going to be installed
Depends: texlive-extra-utils but it is not going to be installed
fragmaster : Depends: texlive-base-bin
Depends: texlive-extra-utils but it is not going to be installed
Depends: texlive-font-utils but it is not going to be installed
imagemagick-6.q16 : Depends: libmagickcore-6.q16-2 (>= 8:6.8.8.2) but it is not installable
Depends: libmagickwand-6.q16-2 (>= 8:6.8.8.2) but it is not installable
Recommends: libmagickcore-6.q16-2-extra
latex-cjk-common : Depends: texlive-font-utils (>= 2007.dfsg.2-1) but it is not going to be installed
obex-data-server : Depends: libmagickwand-6.q16-2 (>= 8:6.8.8.2) but it is not installable
postgresql : Depends: postgresql-10 but it is not going to be installed
prosper : Depends: texlive-latex-extra (>= 2017.20170628) but 2015.20160320-1 is to be installed
tex4ht-common : Depends: texlive-base-bin
Recommends: tex4ht
texlive : Depends: texlive-fonts-recommended (>= 2017.20170628) but 2015.20160320-1ubuntu0.1 is to be installed
Depends: texlive-latex-base (>= 2017.20170628) but 2015.20160320-1ubuntu0.1 is to be installed
Depends: texlive-latex-recommended (>= 2017.20170628) but 2015.20160320-1ubuntu0.1 is to be installed
texlive-base : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-fonts-recommended-doc : Depends: texlive-base (>= 2017.20170628) but 2015.20160320-1ubuntu0.1 is to be installed
texlive-formats-extra : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-games : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-htmlxml : Depends: texlive-formats-extra (>= 2017.20170628) but 2015.20160320-1 is to be installed
Depends: texlive-latex-extra (>= 2017.20170628) but 2015.20160320-1 is to be installed
Depends: texlive-latex-recommended (>= 2017.20170628) but 2015.20160320-1ubuntu0.1 is to be installed
Depends: texlive-plain-generic (>= 2017.20170628) but it is not going to be installed
texlive-humanities : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-cjk : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-cyrillic : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-czechslovak : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-greek : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-indic : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-japanese : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-korean : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-lang-polish : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-latex-base : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-latex-extra : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-latex-recommended : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-luatex : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-math-extra : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-metapost : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-music : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-omega : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-pictures : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-pstricks : Depends: texlive-binaries (>= 2015.20160222.37495-1)
Recommends: texlive-font-utils but it is not going to be installed
Recommends: texlive-extra-utils but it is not going to be installed
texlive-science : Depends: texlive-binaries (>= 2015.20160222.37495-1)
texlive-xetex : Depends: texlive-binaries (>= 2015.20160222.37495-1)
tipa : Depends: texlive-base-bin
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
troy@TroysYoga:~$ sudo apt --fix-broken install
[sudo] password for troy:
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:
appstream caribou context context-modules dleyna-server
evolution-data-server-online-accounts fonts-arphic-bkai00mp
fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp fonts-arphic-gkai00mp
fonts-baekmuk fonts-cabin fonts-comfortaa fonts-ebgaramond
fonts-ebgaramond-extra fonts-font-awesome fonts-freefont-otf
fonts-gfs-artemisia fonts-gfs-baskerville fonts-gfs-bodoni-classic
fonts-gfs-complutum fonts-gfs-didot fonts-gfs-didot-classic fonts-gfs-gazis
fonts-gfs-neohellenic fonts-gfs-olga fonts-gfs-porson fonts-gfs-solomos
fonts-gfs-theokritos fonts-hosny-amiri fonts-junicode fonts-lobster
fonts-lobstertwo fonts-oflb-asana-math fonts-roboto-hinted
fonts-sil-gentiumplus fonts-unfonts-core fonts-unfonts-extra gcc-5-base:i386
gcc-6-base:i386 gir1.2-caribou-1.0 gir1.2-clutter-1.0 gir1.2-cogl-1.0
gir1.2-coglpango-1.0 gir1.2-gkbd-3.0 gir1.2-nmgtk-1.0 gir1.2-xkl-1.0
gnome-backgrounds gnome-software-common imagemagick-common latex-cjk-all
latex-cjk-chinese latex-cjk-chinese-arphic-bkai00mp
latex-cjk-chinese-arphic-bsmi00lp latex-cjk-chinese-arphic-gbsn00lp
latex-cjk-chinese-arphic-gkai00mp latex-cjk-common latex-cjk-japanese
latex-cjk-japanese-wadalab latex-cjk-korean latex-cjk-thai lcdf-typetools
libappstream3 libboost-date-time1.58.0 libcapnp-0.5.3 libcaribou-common
libcaribou0 libchromaprint0 libdata-alias-perl
libdleyna-connector-dbus-1.0-1 libdleyna-core-1.0-3 libdns-export162
libfcitx-gclient0 libfwupd1 libgrilo-0.2-1 libgtkspell3-3-0
libgupnp-av-1.0-2 libgupnp-dlna-2.0-3 libgweather-3-6 libhal-storage1
libhal1 libhud2 libical1a libicu4j-java libidn11:i386 libieee1284-3:i386
libisc-export160 libjetty8-java libjson-c2:i386 libmozjs-24-0v5
libnma-common libopencv-calib3d2.4v5 libopencv-contrib2.4v5
libopencv-features2d2.4v5 libopencv-flann2.4v5 libopencv-legacy2.4v5
libopencv-ml2.4v5 liborcus-0.10-0v5 libparams-validate-perl libpodofo0.9.3
libprocps4 libprotobuf-lite9v5 libqcustomplot1.3 libqt5clucene5
libqt5feedback5 libqt5multimedia5 libqt5organizer5 libreoffice-gtk
libreoffice-gtk2 librhythmbox-core9 libruby2.3 libservlet3.0-java
libsodium18 libsrtp0 libtomcat7-java libtracker-sparql-1.0-0
libunity-action-qt1 libvpx3:i386 libwebpdemux1 libwebrtc-audio-processing-0
libxapian-1.3-5 onboard-data plainbox-provider-checkbox
plainbox-provider-resource-generic prosper python3-pyasn1 python3.5
python3.5-minimal qml-module-qtfeedback qml-module-qtgraphicaleffects
qml-module-qtquick-layouts qml-module-qtquick-window2
qml-module-ubuntu-performancemetrics qtdeclarative5-unity-action-plugin
rename ruby2.3 suru-icon-theme texlive-fonts-extra-doc texlive-games
texlive-generic-extra texlive-htmlxml texlive-humanities
texlive-humanities-doc texlive-lang-african texlive-lang-arabic
texlive-lang-chinese texlive-lang-cjk texlive-lang-cyrillic
texlive-lang-czechslovak texlive-lang-english texlive-lang-european
texlive-lang-french texlive-lang-german texlive-lang-greek
texlive-lang-indic texlive-lang-italian texlive-lang-japanese
texlive-lang-korean texlive-lang-other texlive-lang-polish
texlive-lang-portuguese texlive-lang-spanish texlive-omega
texlive-plain-extra texlive-science ubuntu-mobile-icons
ubuntu-ui-toolkit-theme
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp
fonts-arphic-gkai00mp fonts-baekmuk fonts-unfonts-core fonts-unfonts-extra
imagemagick imagemagick-6.q16 libkpathsea6 libmagickcore-6.q16-3-extra
libmime-charset-perl libostyle1c2 libptexenc1 libsombok3 libsynctex1
libtexlua52 libtexluajit2 libunicode-linebreak-perl obex-data-server
openjade prerex texlive-base texlive-binaries texlive-extra-utils
texlive-font-utils texlive-fonts-extra-doc texlive-fonts-recommended
texlive-formats-extra texlive-games texlive-generic-extra
texlive-generic-recommended texlive-humanities texlive-humanities-doc
texlive-lang-african texlive-lang-arabic texlive-lang-chinese
texlive-lang-cjk texlive-lang-cyrillic texlive-lang-czechslovak
texlive-lang-english texlive-lang-european texlive-lang-french
texlive-lang-german texlive-lang-greek texlive-lang-indic
texlive-lang-italian texlive-lang-japanese texlive-lang-korean
texlive-lang-other texlive-lang-polish texlive-lang-portuguese
texlive-lang-spanish texlive-latex-base texlive-latex-base-doc
texlive-latex-extra texlive-latex-extra-doc texlive-latex-recommended
texlive-latex-recommended-doc texlive-luatex texlive-metapost
texlive-metapost-doc texlive-music texlive-omega texlive-pictures
texlive-pictures-doc texlive-plain-extra texlive-plain-generic
texlive-pstricks texlive-pstricks-doc texlive-publishers
texlive-publishers-doc texlive-science texlive-science-doc texlive-xetex
Suggested packages:
imagemagick-doc autotrace curl enscript gimp grads graphviz hp2xx html2ps
mplayer povray radiance ufraw-batch libjxr-tools libencode-hanextra-perl
libpod2-base-perl perl-tk texlive-fonts-extra icc-profiles
libspreadsheet-parseexcel-perl dot2tex ruby-tcltk | libtcltk-ruby
The following packages will be REMOVED:
tex4ht-common texlive-math-extra
The following NEW packages will be installed:
fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp
fonts-arphic-gkai00mp fonts-baekmuk fonts-unfonts-core fonts-unfonts-extra
libmagickcore-6.q16-3-extra libmime-charset-perl libostyle1c2 libsombok3
libunicode-linebreak-perl openjade texlive-binaries texlive-extra-utils
texlive-font-utils texlive-plain-generic
The following packages will be upgraded:
imagemagick imagemagick-6.q16 libkpathsea6 libptexenc1 libsynctex1
libtexlua52 libtexluajit2 obex-data-server prerex texlive-base
texlive-fonts-extra-doc texlive-fonts-recommended texlive-formats-extra
texlive-games texlive-generic-extra texlive-generic-recommended
texlive-humanities texlive-humanities-doc texlive-lang-african
texlive-lang-arabic texlive-lang-chinese texlive-lang-cjk
texlive-lang-cyrillic texlive-lang-czechslovak texlive-lang-english
texlive-lang-european texlive-lang-french texlive-lang-german
texlive-lang-greek texlive-lang-indic texlive-lang-italian
texlive-lang-japanese texlive-lang-korean texlive-lang-other
texlive-lang-polish texlive-lang-portuguese texlive-lang-spanish
texlive-latex-base texlive-latex-base-doc texlive-latex-extra
texlive-latex-extra-doc texlive-latex-recommended
texlive-latex-recommended-doc texlive-luatex texlive-metapost
texlive-metapost-doc texlive-music texlive-omega texlive-pictures
texlive-pictures-doc texlive-plain-extra texlive-pstricks
texlive-pstricks-doc texlive-publishers texlive-publishers-doc
texlive-science texlive-science-doc texlive-xetex
58 upgraded, 17 newly installed, 2 to remove and 308 not upgraded.
5 not fully installed or removed.
Need to get 0 B/1,805 MB of archives.
After this operation, 616 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 578014 files and directories currently installed.)
Preparing to unpack .../texlive-fonts-extra-doc_2017.20180305-2_all.deb ...
Unpacking texlive-fonts-extra-doc (2017.20180305-2) over (2015.20160320-1) ...
dpkg: error processing archive /var/cache/apt/archives/texlive-fonts-extra-doc_2017.20180305-2_all.deb (--unpack):
trying to overwrite '/usr/share/doc/texlive-doc/latex/mweights/README', which is also in package texlive-latex-extra-doc 2015.20160320-1
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/texlive-fonts-extra-doc_2017.20180305-2_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
你
sources.list
看起来应该是这样的:deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ bionic universe deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates universe deb http://us.archive.ubuntu.com/ubuntu/ bionic multiverse deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates multiverse deb http://security.ubuntu.com/ubuntu bionic-security main restricted deb http://security.ubuntu.com/ubuntu bionic-security universe deb http://security.ubuntu.com/ubuntu bionic-security multiverse
将所有
/etc/apt/sources.list.d/*
存储库暂时移至安全的地方- 删除所有有冲突依赖项的包。但请确保没有重要的系统包。您可以删除
texlive
然后使用 autoremove:sudo apt purge texlive && sudo apt autoremove
来更快地完成此操作 sudo apt clean && sudo apt update && sudo apt upgrade
- 尝试
postgresql
再次安装