我正在尝试升级安装了 Debian 8.11 Jessie 的 VPS。为了进行主要升级,我首先进行次要升级。我已经完成了以下操作,我知道这是通常的路线:
sudo apt-get update
sudo apt-get upgrade
sudo sed -i 's/jessie/stretch/g' /etc/apt/sources.list
sudo apt-get update
一切顺利,然后我运行:
sudo apt-get upgrade
我收到以下错误:
The following packages have unmet dependencies:
libmariadb3 : Breaks: libmariadbclient18 (< 1:10.3.12-2) but 10.1.37-0+deb9u1 is to be installed
libssl1.1 : Breaks: python-httplib2 (< 0.11.3-1) but 0.9.2+dfsg-1 is to be installed
E: Broken packages
我尝试删除,python-httplib2
但像往常一样apt
想要删除系统上的重要软件包,这肯定会导致系统永久损坏。我不知道这个libmariadb3
包,但我在生产网站上使用 MySQL,所以我认为它会想要删除所有类型来做到这一点。
apt 缓存策略
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://ftp.us.debian.org/debian testing/non-free amd64 Packages
release o=Debian,a=testing,n=buster,l=Debian,c=non-free,b=amd64
origin ftp.us.debian.org
500 http://ftp.us.debian.org/debian testing/contrib amd64 Packages
release o=Debian,a=testing,n=buster,l=Debian,c=contrib,b=amd64
origin ftp.us.debian.org
500 http://ftp.us.debian.org/debian testing/main amd64 Packages
release o=Debian,a=testing,n=buster,l=Debian,c=main,b=amd64
origin ftp.us.debian.org
500 http://ftp.us.debian.org/debian stretch-updates/main amd64 Packages
release o=Debian,a=stable-updates,n=stretch-updates,l=Debian,c=main,b=amd64
origin ftp.us.debian.org
500 http://security.debian.org stretch/updates/main amd64 Packages
release v=9,o=Debian,a=stable,n=stretch,l=Debian-Security,c=main,b=amd64
origin security.debian.org
500 http://ftp.us.debian.org/debian stretch/main amd64 Packages
release v=9.7,o=Debian,a=stable,n=stretch,l=Debian,c=main,b=amd64
origin ftp.us.debian.org
Pinned packages:
来源.list
deb http://ftp.us.debian.org/debian stretch main
deb http://security.debian.org/ stretch/updates main
deb http://ftp.us.debian.org/debian stretch-updates main
deb http://ftp.us.debian.org/debian testing main contrib non-free
我已经deb http://ftp.us.debian.org/debian testing main contrib non-free
从我的源代码中删除了,并且能够删除,libmariadb3
因为我意识到当我升级时,我可以重新安装与此相关的任何软件包(default-libmysqlclient-dev libmariadb-dev libmariadb-dev-compat libmariadb3
),但尝试删除 libssl1.1(从源代码手动编译)将会造成伤害我的系统要删除:
apt-transport-https autoconf automake bind9-host build-essential ca-certificates cloud-init cloud-initramfs-growroot cloud-utils curl dh-python dnsutils
dpkg-dev euca2ools ghostscript git host libalgorithm-c3-perl libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl libarchive-extract-perl
libauthen-sasl-perl libbind9-90 libcgi-fast-perl libcgi-pm-perl libclass-accessor-perl libclass-c3-perl libclass-c3-xs-perl libcpan-meta-perl libcups2
libcupsfilters1 libcupsimage2 libcurl3-gnutls libcurl4 libdata-optlist-perl libdata-section-perl libdbd-mysql-perl libdbi-perl libdns100 libdpkg-perl
libencode-locale-perl liberror-perl libfcgi-perl libfile-fcntllock-perl libfile-listing-perl libfont-afm-perl libgs9 libgssapi-krb5-2 libgtk2.0-0 libgtk2.0-bin
libhtml-form-perl libhtml-format-perl libhtml-parser-perl libhtml-tagset-perl libhtml-template-perl libhtml-tree-perl libhttp-cookies-perl libhttp-daemon-perl
libhttp-date-perl libhttp-message-perl libhttp-negotiate-perl libintl-perl libio-html-perl libio-socket-ssl-perl libio-string-perl libisccfg90 libkrb5-3
liblog-message-perl liblog-message-simple-perl liblwp-mediatypes-perl liblwp-protocol-https-perl libmailtools-perl libmodule-build-perl
libmodule-pluggable-perl libmodule-signature-perl libmro-compat-perl libnet-http-perl libnet-smtp-ssl-perl libnet-ssleay-perl libpackage-constants-perl
libparams-util-perl libparse-debianchangelog-perl libperl4-corelibs-perl libpod-latex-perl libpod-readme-perl libpython3-stdlib libpython3.5-minimal
libpython3.5-stdlib libregexp-common-perl libsoftware-license-perl libssl-dev libssl1.1 libsub-exporter-perl libsub-install-perl libsub-name-perl
libswitch-perl libterm-readkey-perl libterm-ui-perl libtext-soundex-perl libtext-template-perl libtext-unidecode-perl libtimedate-perl libtirpc1 liburi-perl
libwww-perl libwww-robotrules-perl libxml-libxml-perl libxml-namespacesupport-perl libxml-parser-perl libxml-sax-base-perl libxml-sax-expat-perl
libxml-sax-perl lsof mutt mysql-client-5.5 mysql-server mysql-server-5.5 mysqltuner nfs-common openssh-client openssh-server openssh-sftp-server openssl perl
perl-modules pinentry-gtk2 python-boto python-chardet-whl python-pip python-pip-whl python-reportbug python-requestbuilder python-requests python-requests-whl
python-software-properties python-virtualenv python3 python3-apt python3-minimal python3-pkg-resources python3-virtualenv python3.5 python3.5-minimal rename
reportbug rpcbind sendmail sendmail-base sendmail-bin texinfo unattended-upgrades virtualenv
答案1
警告!!在没有了解潜在风险之前,不要做我所做的事情!你被警告了 好吧,所以我只是想我会“冒着饼干的风险”并允许 apt 删除它想要删除的内容。幸运的是,世界末日确实到来了,我的系统现在运行良好。详细说明我所做的:
sudo apt remove libmariadb3
sudo dpkg -r --force-depends libssl1.1 <-- this removed the big list of packages in my question
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
我将安装我需要的任何软件包。
我真的不建议这样做
答案2
什么地方出了错
看起来您目前拥有的大部分是 Debian 8 ( jessie
),但您的 MySQL/MariaDBpython-httplib2
已经更新到当前的 testing
(即最终将成为 Debian 10,buster
)。
当您最初添加testing
到您的版本时,它可能与(= Debian 9,当前版本)sources.list
同义,但是在 Debian 9 发布的当天,也跳到了指向下一个版本,因此您的“次要更新”(您的初始+ ) 可能至少将一些软件包更新到版本级别。stretch
stable
testing
sudo apt-get update
sudo apt-get upgrade
buster
testing
这就是使用像stretch
或 这样的发布代号的危险buster
:您需要在发布日准确地更新您的存储库配置,否则您将很容易获得计划外的、可能是部分的升级,除非您非常小心。
接下来做什么
以下命令可能有助于识别所有不在当前版本级别的软件包stable
(假设它在 Debian 8 中工作;我不确定它是否在其中可用):
apt list --installed | grep -v /stable
运行grep upgrade /var/log/dpkg.log
以查看最新的软件包升级,并检查它们的版本。查找所有意外升级到buster
/的包testing
,以及降级(不要删除)它们恢复到正确的版本。
日志消息将如下所示:
<timestamp> upgrade <package name> <old version> <new version>
这样你就可以看到以前的版本是什么。如果某个软件包的旧版本已经适合stretch
(即它是在testing
Debian 8 发布时安装的stable
),则将该软件包降级回stretch
当前级别:
sudo apt-get -t=stretch <package name>
或者如果您需要指定确切的版本号:
sudo apt-get install <package-name>=<package-version-number>