Rsync 迁移后 Apt 无法识别已安装的软件包

Rsync 迁移后 Apt 无法识别已安装的软件包

我的服务器最近通过 进行了迁移rsync,虽然一切似乎正常,apt但无法识别某些包和服务的存在。

问题:
有没有办法刷新' apt 以便它能识别当前服务器上的所有包和服务?

问题示例
这表明 php7.4-fpm 已安装并正在运行

root@admin:~# service php7.4-fpm status
● php7.4-fpm.service - The PHP 7.4 FastCGI Process Manager
     Loaded: loaded (/lib/systemd/system/php7.4-fpm.service; enabled; vendor preset: enabled)
     Active: active (running) since Mon 2022-02-21 20:10:25 CST; 20h ago
       Docs: man:php-fpm7.4(8)
    Process: 1339 ExecStartPost=/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.so>
   Main PID: 915 (php-fpm7.4)
     Status: "Processes active: 0, idle: 2, Requests: 1236, slow: 0, Traffic: 0req/sec"
      Tasks: 3 (limit: 4612)
     Memory: 3.9M
     CGroup: /system.slice/php7.4-fpm.service
             ├─ 915 php-fpm: master process (/etc/php/7.4/fpm/php-fpm.conf)
             ├─1326 php-fpm: pool www
             └─1327 php-fpm: pool www

然而这表明 apt 无法识别 php7.4 包(对于 apache、mysql 等也是如此)

root@admin:/etc/apt# apt remove php7.4-fpm 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'php7.4-fpm' is not installed, so not removed
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

感谢协助

我尝试过的解决方案

#rm /var/lib/apt/lists/lock
#rm /var/lib/dpkg/lock
#rm /var/lib/dpkg/lock-frontend
#dpkg --configure -a
#apt clean
#apt update --fix-missing
#apt install -f
#dpkg --configure -a
#apt upgrade
#reboot

从字面上看,一切都运行正常......只是apt没有意识到我的包裹的存在。

相关内容