我想重新安装 APT Tool,所以我卸载了它,然后我意识到如果我只是删除/etc/apt
目录可能会更好。有什么办法可以解决我的错误吗?
我的 Ubuntu 版本是 18.04.2 LTS,输出ls /etc/apt
是
root@user-OptiPlex-755:~# ls /etc/apt
ls: cannot access '/etc/apt': No such file or directory
更新:我已经重新安装apt
,但是,这是我的输出:
root@user-OptiPlex-755:~# sudo apt install --reinstall apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package update-manager 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
However the following packages replace it:
ubuntu-release-upgrader-core update-manager-core
Package update-notifier-common 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
Package update-notifier 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
However the following packages replace it:
update-notifier-common
Package apt-utils 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
However the following packages replace it:
apt
Package ubuntu-release-upgrader-gtk 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 'apt-utils' has no installation candidate
E: Unable to locate package ubuntu-minimal
E: Package 'ubuntu-release-upgrader-gtk' has no installation candidate
E: Unable to locate package ubuntu-desktop
E: Package 'update-manager' has no installation candidate
E: Package 'update-notifier' has no installation candidate
E: Package 'update-notifier-common' has no installation candidate`
如果您使用 删除 APT
sudo apt remove apt
,则以下软件包在标准安装中会受到影响(至少在仿生(18.04)中):要重新安装 APT:
下载 APT 的 .deb 文件。
使用 dpkg 安装。
由于您也删除
/etc/apt
了,请从 GitHub 下载仿生的 zip,解压缩并使用以下命令复制 apt 文件夹:并运行更新:
再次安装已删除的软件包。
此外,切勿尝试弄乱对操作系统非常重要的系统文件/包,如 Python、APT 等。它们可能会导致您的系统崩溃。如果您需要重新安装软件包,请运行:
更新:我旁边确实有一个 Ubuntu 服务器,所以我将它
/etc/apt
与这个 Ubuntu 合并,问题就解决了。感谢您的所有帮助,我很确定我的第二个问题的核心是我丢失了/etc/apt/sources.list
文件。一旦我复制了这些文件,我就可以安装删除的包。再次感谢您的所有帮助!