A-A+

ubuntu删除python3.5带来的糟心恢复问题

2023年03月16日 学习小计, 学习随笔 暂无评论 阅读 739 次

正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
distro-info gir1.2-glib-2.0 iso-codes libdbus-glib-1-2 libgirepository-1.0-1 mysql-server-core-5.7
使用'sudo apt autoremove'来卸载它(它们)。
下列软件包将被【卸载】:
apparmor dh-python lsb-release mysql-server mysql-server-5.7 python3 python3-apt python3-dbus python3-gi
python3-pkg-resources python3-pycurl python3-setuptools python3-software-properties python3-venv python3-virtualenv
python3-yaml python3.5 python3.5-venv snapd software-properties-common ubuntu-advantage-tools unattended-upgrades
virtualenv
升级了 0 个软件包,新安装了 0 个软件包,要卸载 23 个软件包,有 0 个软件包未被升级。

正在卸载 snapd (2.54.3+16.04.0ubuntu0.1~esm5) ...
Stopping snap.canonical-livepatch.canonical-livepatchd.service
Stopping unit snap.canonical-livepatch.canonical-livepatchd.service
Waiting until unit snap.canonical-livepatch.canonical-livepatchd.service is stopped [attempt 1]
snap.canonical-livepatch.canonical-livepatchd.service is stopped.
Stopping snap.redis.server.service
Stopping unit snap.redis.server.service
Waiting until unit snap.redis.server.service is stopped [attempt 1]
snap.redis.server.service is stopped.
Stopping snap.shadowsocks-libev.ss-local-daemon.service
Stopping unit snap.shadowsocks-libev.ss-local-daemon.service
Waiting until unit snap.shadowsocks-libev.ss-local-daemon.service is stopped [attempt 1]
snap.shadowsocks-libev.ss-local-daemon.service is stopped.
Stopping snap.shadowsocks-libev.ss-server-daemon.service
Stopping unit snap.shadowsocks-libev.ss-server-daemon.service
Waiting until unit snap.shadowsocks-libev.ss-server-daemon.service is stopped [attempt 1]
snap.shadowsocks-libev.ss-server-daemon.service is stopped.
正在卸载 mysql-server (5.7.41-0ubuntu0.16.04.1+esm1) ...
正在卸载 mysql-server-5.7 (5.7.41-0ubuntu0.16.04.1+esm1) ...
update-alternatives: 使用 /etc/mysql/my.cnf.fallback 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
正在卸载 apparmor (2.10.95-0ubuntu2.11) ...
正在卸载 unattended-upgrades (1.1ubuntu1.18.04.7~16.04.7) ...
正在卸载 software-properties-common (0.96.20.10) ...
正在卸载 python3-software-properties (0.96.20.10) ...
正在卸载 lsb-release (9.20160110ubuntu0.2) ...
正在卸载 ubuntu-advantage-tools (27.13.5~16.04.1) ...
Removing apt source file: /etc/apt/sources.list.d/ubuntu-esm-infra.list
正在卸载 python3-apt (1.1.0~beta1ubuntu0.16.04.12) ...
正在卸载 python3-setuptools (20.7.0-1ubuntu0.1~esm1) ...
正在卸载 python3-dbus (1.2.0-3) ...
正在卸载 python3-gi (3.20.0-0ubuntu1) ...
正在卸载 virtualenv (15.0.1+ds-3ubuntu1.1) ...
正在卸载 python3-virtualenv (15.0.1+ds-3ubuntu1.1) ...
正在卸载 python3-pkg-resources (20.7.0-1ubuntu0.1~esm1) ...
正在卸载 python3-pycurl (7.43.0-1ubuntu1) ...
正在卸载 python3-venv (3.5.1-3) ...
正在卸载 python3-yaml (3.11-3build1) ...
正在卸载 python3.5-venv (3.5.2-2ubuntu0~16.04.13+esm6) ...
正在卸载 dh-python (2.20151103ubuntu1.2) ...
正在卸载 python3 (3.5.1-3) ...
正在卸载 python3.5 (3.5.2-2ubuntu0~16.04.13+esm6) ...
正在处理用于 man-db (2.7.5-1ubuntu0.1~esm1) 的触发器 ...
正在处理用于 mime-support (3.59ubuntu1) 的触发器 ...
正在处理用于 dbus (1.10.6-1ubuntu3.6+esm2) 的触发器 ...
正在处理用于 libc-bin (2.23-0ubuntu11.3+esm3) 的触发器 ...
(base) jiansuo@hahaha:/home/haha/MrDoc$

卧槽 仔细看大脑一片空白啊 卧槽

谷歌了一把 真的不能瞎折腾 这是第二次第二次误删了
y361606960 2020-01-15
我也遇到了,ubuntu16.04系统,卸载了python3.5,导致了很多问题,后来解决了,找了另外一台机器将老的文件复制过去恢复了系统的python3.5。将下面网盘里的文件解压后放在:/usr/lib/python3/dist-packages/ 链接:https://pan.baidu.com/s/1g9gbOEG1MSr-4T3xWW6wSw

卧槽这个也没了 这度娘超级不靠谱啊
Failed to start apt-news.service: Unit apt-news.service not found.
Failed to start esm-cache.service: Unit esm-cache.service not found.

What are the services 'apt-news' and 'esm-cache', and how do I disable them?

注意正确解决方法来了

使用sudo aptitude install xxx代替sudo apt-get install xxx,但是注意,一般aptitude安装时候第一次推荐给你的方案都是没有改变原有依赖关系的,所以第一次提示你输入y还是n的时候,需要你输入
n,第二次才会给你具体处理依赖的方法,如降级等,如图,便可以完美解决依赖关系啦。
恢复snapd
root@hahaha:/etc/apt# apt install snapd
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
将会同时安装下列软件:
apparmor dh-python python3
建议安装:
apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils python3-doc python3-tk python3-venv zenity
| kdialog
下列【新】软件包将被安装:
apparmor dh-python python3 snapd
升级了 0 个软件包,新安装了 4 个软件包,要卸载 0 个软件包,有 0 个软件包未被升级。
需要下载 21.6 MB 的归档。
解压缩后会消耗 105 MB 的额外空间。
您希望继续执行吗? [Y/n]
获取:1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 dh-python all 2.20151103ubuntu1.2 [73.9 kB]
获取:2 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 python3 amd64 3.5.1-3 [8,710 B]
获取:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 apparmor amd64 2.10.95-0ubuntu2.11 [451 kB]
获取:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 snapd amd64 2.48.3 [21.1 MB]
已下载 21.6 MB,耗时 36秒 (594 kB/s)
正在预设定软件包 ...
正在选中未选择的软件包 dh-python。
(正在读取数据库 ... 系统当前共安装有 92615 个文件和目录。)
正准备解包 .../dh-python_2.20151103ubuntu1.2_all.deb ...
正在解包 dh-python (2.20151103ubuntu1.2) ...
正在选中未选择的软件包 python3。
正准备解包 .../python3_3.5.1-3_amd64.deb ...
正在解包 python3 (3.5.1-3) ...
正在选中未选择的软件包 apparmor。
正准备解包 .../apparmor_2.10.95-0ubuntu2.11_amd64.deb ...
正在解包 apparmor (2.10.95-0ubuntu2.11) ...
正在选中未选择的软件包 snapd。
正准备解包 .../snapd_2.48.3_amd64.deb ...
正在解包 snapd (2.48.3) ...
正在处理用于 man-db (2.7.5-1ubuntu0.1~esm1) 的触发器 ...
正在处理用于 systemd (229-4ubuntu21.31+esm1) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19.1) 的触发器 ...
正在处理用于 mime-support (3.59ubuntu1) 的触发器 ...
正在设置 python3 (3.5.1-3) ...
running python rtupdate hooks for python3.5...
running python post-rtupdate hooks for python3.5...
正在设置 apparmor (2.10.95-0ubuntu2.11) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
正在设置 snapd (2.48.3) ...
正在安装新版本配置文件 /etc/apparmor.d/usr.lib.snapd.snap-confine.real ...
正在安装新版本配置文件 /etc/profile.d/apps-bin-path.sh ...
snapd.failure.service is a disabled or a static unit, not starting it.
snapd.snap-repair.service is a disabled or a static unit, not starting it.
正在设置 dh-python (2.20151103ubuntu1.2) ...

接下来是收尾了啦
重新恢复mysql5.7

root@hahaha:/etc/apt# aptitude install mysql-server-5.7
The following NEW packages will be installed:
mysql-server-5.7{b}
0 packages upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,423 kB of archives. After unpacking 47.6 MB will be used.
The following packages have unmet dependencies:
mysql-server-5.7 : 依赖: mysql-server-core-5.7 (= 5.7.33-0ubuntu0.16.04.1) but 5.7.41-0ubuntu0.16.04.1+esm1 is installed.
The following actions will resolve these dependencies:

Keep the following packages at their current version:
1) mysql-server-5.7 [Not Installed]

 

Accept this solution? [Y/n/q/?] n
The following actions will resolve these dependencies:

Downgrade the following packages:
1) mysql-server-core-5.7 [5.7.41-0ubuntu0.16.04.1+esm1 (now) -> 5.7.33-0ubuntu0.16.04.1 (xenial-security, xenial-updates

 

Accept this solution? [Y/n/q/?] y
The following packages will be DOWNGRADED:
mysql-server-core-5.7
The following NEW packages will be installed:
mysql-server-5.7
0 packages upgraded, 1 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 9,638 kB of archives. After unpacking 48.2 MB will be used.
Do you want to continue? [Y/n/?]
Get: 1 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-core-5.7 amd64 5.7.33-0ubuntu0.16.04.1 [7,215 kB]
Get: 2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 mysql-server-5.7 amd64 5.7.33-0ubuntu0.16.04.1 [2,423 kB]
Fetched 9,638 kB in 16秒 (601 kB/s)
正在预设定软件包 ...
dpkg:警告:即将把 mysql-server-core-5.7 从 5.7.41-0ubuntu0.16.04.1+esm1 降级到 5.7.33-0ubuntu0.16.04.1
(正在读取数据库 ... 系统当前共安装有 92785 个文件和目录。)
正准备解包 .../mysql-server-core-5.7_5.7.33-0ubuntu0.16.04.1_amd64.deb ...
正在将 mysql-server-core-5.7 (5.7.33-0ubuntu0.16.04.1) 解包到 (5.7.41-0ubuntu0.16.04.1+esm1) 上 ...
正准备解包 .../mysql-server-5.7_5.7.33-0ubuntu0.16.04.1_amd64.deb ...
正在解包 mysql-server-5.7 (5.7.33-0ubuntu0.16.04.1) ...
正在处理用于 man-db (2.7.5-1ubuntu0.1~esm1) 的触发器 ...
正在处理用于 systemd (229-4ubuntu21.31+esm1) 的触发器 ...
正在处理用于 ureadahead (0.100.0-19.1) 的触发器 ...
正在设置 mysql-server-core-5.7 (5.7.33-0ubuntu0.16.04.1) ...
正在设置 mysql-server-5.7 (5.7.33-0ubuntu0.16.04.1) ...
update-alternatives: 使用 /etc/mysql/mysql.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv OK
mysql.db OK
mysql.engine_cost OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.gtid_executed OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.innodb_index_stats OK
mysql.innodb_table_stats OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.server_cost OK
mysql.servers OK
mysql.slave_master_info OK
mysql.slave_relay_log_info OK
mysql.slave_worker_info OK
mysql.slow_log OK
mysql.tables_priv OK
mysql.time_zone OK
mysql.time_zone_leap_second OK
mysql.time_zone_name OK
mysql.time_zone_transition OK
mysql.time_zone_transition_type OK
mysql.user OK
The sys schema is already up to date (version 1.5.2).
Checking databases.
sys.sys_config OK
wordpress.wp_commentmeta OK
wordpress.wp_comments OK
wordpress.wp_html5lyrics_songs OK
wordpress.wp_links OK
wordpress.wp_login_security_solution_fail OK
wordpress.wp_messages OK
wordpress.wp_options OK
wordpress.wp_postmeta OK
wordpress.wp_posts OK
wordpress.wp_term_relationships OK
wordpress.wp_term_taxonomy OK
wordpress.wp_termmeta OK
wordpress.wp_terms OK
wordpress.wp_usermeta OK
wordpress.wp_users OK
wordpress.wp_weixin_credits OK
wordpress.wp_weixin_menus OK
wordpress.wp_weixin_messages OK
wordpress.wp_weixin_qrcodes OK
wordpress.wp_weixin_replies OK
wordpress.wp_weixin_subscribes OK
wordpress.wp_weixin_users OK
wordpress.wp_weixin_wx727abdec7c4a74b7_subscribes OK
wordpress.wp_weixin_wx727abdec7c4a74b7_users OK
wordpress.wp_weixins OK
wordpress.wp_wrc_caches OK
wordpress.wp_wrc_relations OK
Upgrade process completed successfully.
Checking if update is needed.

 

卧槽 不容易 数据还在啊 看来要备份一下了啊

接下来 还要恢复 redis 参见文档 好像相对简单 反正别删python3.5了啦

解决下面Failed to start问题
root@hahaha:~# apt update
Failed to start apt-news.service: Unit apt-news.service not found.
Failed to start esm-cache.service: Unit esm-cache.service not found.
命中:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
获取:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [99.8 kB]
获取:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [99.8 kB]
忽略:4 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 InRelease
命中:5 http://ppa.launchpad.net/jczaplicki/xenial-php74-temp/ubuntu xenial InRelease
命中:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release
获取:7 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [97.4 kB]
命中:8 https://packages.redis.io/deb xenial InRelease
命中:10 https://apt.syncthing.net syncthing InRelease
已下载 297 kB,耗时 0秒 (329 kB/s)
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
所有软件包均为最新。
网上的 What are the services 'apt-news' and 'esm-cache', and how do I disable them? 好像没有根本解决问题

apt install unattended-upgrades
apt install ubuntu-advantage-tools

完美解决问题
root@hahaha:~# apt update
命中:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
命中:2 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease
命中:3 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease
命中:4 http://security.ubuntu.com/ubuntu xenial-security InRelease
忽略:5 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 InRelease
命中:6 http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release
命中:7 http://ppa.launchpad.net/jczaplicki/xenial-php74-temp/ubuntu xenial InRelease
命中:8 https://packages.redis.io/deb xenial InRelease
命中:10 https://apt.syncthing.net syncthing InRelease
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
所有软件包均为最新。

耗时大约3小时 天啊

标签:

给我留言

Copyright © 浩然东方 保留所有权利.   Theme  Ality 07032740

用户登录