今天用 pve 所在 debian 系统,apt install nut ,用于 ups 管理,发现报错
W: (pve-apt-hook) !! WARNING !!
W: (pve-apt-hook) You are attempting to remove the meta-package 'proxmox-ve'!
W: (pve-apt-hook)
W: (pve-apt-hook) If you really want to permanently remove 'proxmox-ve' from your system, run the following command
W: (pve-apt-hook) touch '/please-remove-proxmox-ve'
W: (pve-apt-hook) run apt purge proxmox-ve to remove the meta-package
W: (pve-apt-hook) and repeat your apt invocation.
W: (pve-apt-hook)
W: (pve-apt-hook) If you are unsure why 'proxmox-ve' would be removed, please verify
W: (pve-apt-hook) - your APT repository settings
W: (pve-apt-hook) - that you are using 'apt full-upgrade' to upgrade your system
E: Sub-process /usr/share/proxmox-ve/pve-apt-hook returned an error code (1)
E: Failure running script /usr/share/proxmox-ve/pve-apt-hook
后面经过一番搜索,才发现应该是收费订阅服务的问题,导致我现在用不了 apt 。
然后我就去网上搜了,按照网上文章 https://blog.51cto.com/sery/2178466 的评论:
这个问题解决了,方法如下; mkdir /usr/share/proxmox-ve && touch /usr/share/proxmox-ve/pve-apt-hook && chmod 0755 /usr/share/proxmox-ve/pve-apt-hook ## pve 6.x buster 版本 ## pve 7.x bullseye 版本 记得替换版本代号 echo "deb http://mirrors.ustc.edu.cn/proxmox/debian/pve/ bullseye pve-no-subscription" > /etc/apt/sources.list.d/pve-no-sub.list apt update && apt dist-upgrade
我进行了如下查看
root@pve:~# ls -l /etc/apt/sources.list.d/
total 8
-rw-r--r-- 1 root root 71 Dec 25 2022 pve-enterprise.list
-rw-r--r-- 1 root root 80 Dec 25 2022 pve-no-subscription.list
root@pve:~# cat /etc/apt/sources.list.d/pve-enterprise.list
#deb https://enterprise.proxmox.com/debian/pve bullseye pve-enterprise
root@pve:~# cat /etc/apt/sources.list.d/pve-no-subscription.list
deb https://mirrors.ustc.edu.cn/proxmox/debian/pve bullseye pve-no-subscription
进行了如下备份操作,
root@pve:~# mv /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak
root@pve:~# mv /usr/share/proxmox-ve/pve-apt-hook /usr/share/proxmox-ve/pve-apt-hook.bak
root@pve:~# cat /usr/share/proxmox-ve/pve-apt-hook
cat: /usr/share/proxmox-ve/pve-apt-hook: No such file or directory
root@pve:~# touch /usr/share/proxmox-ve/pve-apt-hook
root@pve:~# chmod 0755 /usr/share/proxmox-ve/pve-apt-hook
然后开始 apt install ,没想到 install 操作连带着 remove ,没仔细看直接同意 Y 了
root@pve:~# apt update
root@pve:~# apt install nut nut-server nut-client nut-cgi
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
proxmox-mail-forward proxmox-offline-mirror-docs proxmox-offline-mirror-helper
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
apache2 apache2-bin apache2-data apache2-utils chrony gcc-12-base libabsl20220623 libaom3 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap
libavif15 libc-bin libc-l10n libc6 libdav1d6 libgav1-1 libgd3 libgmp10 libgnutls-dane0 libgnutls30 libjansson4 libldap-2.5-0 libldap-common liblerc4 libltdl7
libnghttp2-14 libnutscan2 libpve-common-perl librav1e0 libsasl2-2 libsasl2-modules-db libssl3 libstdc++6 libsvtav1enc1 libtiff6 libupsclient6 libwebp7 libxpm4
libyuv0 libzstd1 locales proxmox-widget-toolkit
Suggested packages:
apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser networkd-dispatcher glibc-doc libnss-nis libnss-nisplus libgd-tools dns-root-data
nut-monitor nut-i2c nut-ipmi nut-modbus nut-snmp nut-xml
Recommended packages:
libsasl2-modules
The following packages will be REMOVED:
libgnutlsxx28 lxc-pve proxmox-ve pve-container pve-ha-manager pve-manager qemu-server
The following NEW packages will be installed:
apache2 apache2-bin apache2-data apache2-utils gcc-12-base libabsl20220623 libaom3 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libavif15
libdav1d6 libgav1-1 libgd3 libldap-2.5-0 libldap-common liblerc4 libnutscan2 librav1e0 libssl3 libsvtav1enc1 libtiff6 libupsclient6 libwebp7 libxpm4 libyuv0
nut nut-cgi nut-client nut-server
The following packages will be upgraded:
chrony libc-bin libc-l10n libc6 libgmp10 libgnutls-dane0 libgnutls30 libjansson4 libltdl7 libnghttp2-14 libpve-common-perl libsasl2-2 libsasl2-modules-db
libstdc++6 libzstd1 locales proxmox-widget-toolkit
17 upgraded, 31 newly installed, 7 to remove and 582 not upgraded.
我没注意看
The following packages will be REMOVED:
libgnutlsxx28 lxc-pve proxmox-ve pve-container pve-ha-manager pve-manager qemu-server
然后就同意 Y 了,结果
Removing proxmox-ve (7.3-1) ...
Removing pve-manager (7.3-4) ...
Removing pve-ha-manager (3.5.1) ...
Removing pve-container (4.4-2) ...
Removing lxc-pve (5.0.0-3) ...
Removing 'diversion of /usr/share/apparmor-features/features to /usr/share/apparmor-features/features.stock by lxc-pve'
Removing libgnutlsxx28:amd64 (3.7.1-5+deb11u2) ...
Removing qemu-server (7.3-2) ...
现在开着的虚拟机不敢关了,pve 所在 debian 也不敢重启,pve web 肯定是登录不进去了,重新装也装不了。。
root@pve:~# apt install proxmox-ve
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
lxc-pve : Depends: libgnutlsxx28 but it is not installable
E: Unable to correct problems, you have held broken packages.
root@pve:~# apt install libgnutlsxx28
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package libgnutlsxx28 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libgnutlsxx28' has no installation candidate
root@pve:~# qm
bash: qm: command not found
哪位朋友有时间帮忙解决一下,付费 100 以表谢意。
1
blankmiss 2023-07-18 14:30:33 +08:00
我之前升级 PVE 失败 也把 pve 删掉了 后面把虚拟机文件备份 以后重新安装了
|
3
hymzhek 2023-07-18 14:38:14 +08:00
ssh 还能进去吧 还原 /etc/apt/sources.list.d/ 里的文件 那个几个包装回去呢
|
4
blankmiss 2023-07-18 14:47:24 +08:00
还有一种方法 挂载一个 pve 的系统镜像或者相同版本的 debian 镜像 通过 apt 本地镜像源 安装你要的包
|
5
hanssx OP |
6
ochatokori 2023-07-18 14:51:40 +08:00 via Android
apt 这个真的是坑,什么时候 apt 才能在移除包时加个二次确认
|
7
hymzhek 2023-07-18 14:52:47 +08:00 2
@hanssx #5 先把 nut nut-server nut-client nut-cgi 这些包 删了 然后 还原备份过的文件 apt update apt install proxmox-ve 最多 ssh 把虚拟机硬盘文件复制出来
|
8
blankmiss 2023-07-18 14:52:54 +08:00
![]( https://mjj.today/i/Wq6M74)
|
9
hymzhek 2023-07-18 14:53:28 +08:00
@ochatokori #6 本来有 hook 脚本 他看那个坑人的教程 给删了
|
10
blankmiss 2023-07-18 14:55:54 +08:00
这个目录 有虚拟机文件/dev/mapper/ , /etc/pve/ 配置 和 /var/lib/vz/ 镜像和杂七杂八的
|
11
blankmiss 2023-07-18 15:01:24 +08:00
我说的是教你 怎么备份然后重装,不是教你修复现在的系统。我当时就是这么重新恢复的
|
12
defunct9 2023-07-18 15:03:46 +08:00
开 ssh ,让我上去看看
|
13
villivateur 2023-07-18 15:08:41 +08:00 2
这个帖子,刚看到标题就莫名喜感,然后前几楼的头像让我没绷住,然后楼上又是著名的 ssh 哥,今天的快乐源泉就是这个帖子了。
正经答:先备份重要数据,虚拟机文件应该不会被删,先备份。然后卸载你误操作装的包,再安装你误操作删掉的包。 |
14
qW7bo2FbzbC0 2023-07-18 15:14:20 +08:00
我也遇到过,不是生产环境,直接按照官方安装方法给安装回去就行了,小问题
|
15
zljklang 2023-07-18 15:16:56 +08:00
看下这个日志/var/log/apt/history.log 卸载了那些,重新安装下
|
16
NSAgold 2023-07-18 15:24:26 +08:00 via Android 1
找另一台设备,在 linux 桌面环境下开 virtmanager 远程连接到你这台 pve 的 kvm 环境看看能不能把虚拟机配置备份了先,然后把镜像也备份了。
之后试着把你删了的包装回去试试 |
18
deorth 2023-07-18 16:27:38 +08:00 via Android 1
你就当现在是个纯 debian ,按官方那个在 debian 上安装 pve 的教程走一遍就行了
|
19
gromit1337 2023-07-18 18:24:00 +08:00
@defunct9 你发了这么多句,有没有人让你看过啊
|
20
defunct9 2023-07-18 18:38:12 +08:00
@gromit1337 经常有人让我上去看
|
22
flyqie 2023-07-18 20:28:06 +08:00 via Android
快乐源泉。。
非常好奇你是怎么能做到 `后面经过一番搜索,才发现应该是收费订阅服务的问题,导致我现在用不了 apt 。` 上面的提示很明显就跟收费订阅服务没半毛钱关系啊,说的是你在执行移除 pve 相关包的危险操作,要求你二次确认。。 |
23
flyqie 2023-07-18 20:30:47 +08:00 via Android
|
24
hanssx OP @flyqie 这个表述确实有问题,具体我也不清楚怎么回事,apt update 并不会出现问题,apt install nut 的末尾会出现我上面说的那些。
|
25
Jirajine 2023-07-18 20:50:03 +08:00
@ochatokori 这还叫坑,那是被那些喜欢把用户当巨婴的系统惯坏了。
非要说坑,就是 apt 的输出太罗嗦不够简洁明了,you know what you're doing ,不以“为用户好”的理由设限是自由软件一个重要的有点。 |