简体   繁体   English

如何在 debian 中安装 apt 包?

[英]How to install apt package in debian?

I am having Debian GNU/Linux 6.0.4 (squeeze).我有 Debian GNU/Linux 6.0.4(挤压)。 By mistake all the apt files are removed from my OS.错误地从我的操作系统中删除了所有 apt 文件。 I am trying to install package "apt_0.9.7.1_amd64.deb".我正在尝试安装包“apt_0.9.7.1_amd64.deb”。 But while installing the package i am getting the following errors :但是在安装软件包时,我收到以下错误:

Unpacking replacement apt ...
dpkg: dependency problems prevent configuration of apt:
 apt depends on libapt-pkg4.12 (>= 0.9.7.1); however:
  Package libapt-pkg4.12 is not installed.
 apt depends on libstdc++6 (>= 4.6); however:
  Version of libstdc++6 on system is 4.4.5-8.
 apt depends on debian-archive-keyring; however:
  Package debian-archive-keyring is not installed.
dpkg: error processing apt (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db ...
Errors were encountered while processing:
 apt

Can anyone know how to install the apt package?谁能知道如何安装apt包? or are there any other ways to install the package.或者有没有其他方法来安装软件包。

While using any command like sudo apt-get update etc. I am getting error使用 sudo apt-get update 等任何命令时,出现错误

apt : Depends: debian-archive-keyring but it is not going to be installed

For installing debian-archive-keyring I need apt and for apt I need debian-archive-keyring.要安装 debian-archive-keyring,我需要 apt,而对于 apt,我需要 debian-archive-keyring。 Please suggest any solution.请提出任何解决方案。

Since apt is no longer present on your system you'll have to fix this manually.由于apt不再存在于您的系统中,因此您必须手动修复此问题。

For me this worked on Ubuntu 13.10:对我来说,这适用于 Ubuntu 13.10:

Downloaded apt_1.0.1ubuntu2.5_amd64.deb : http://packages.ubuntu.com/trusty/apt下载apt_1.0.1ubuntu2.5_amd64.debhttp : apt_1.0.1ubuntu2.5_amd64.deb

Try to install it using dpkg :尝试使用dpkg安装它:

sudo dpkg -i apt_1.0.1ubuntu2.5_amd64.deb须藤 dpkg -i apt_1.0.1ubuntu2.5_amd64.deb

You might get error like:您可能会收到如下错误:

Unpacking apt (from apt_1.0.1ubuntu2.5_amd64.deb) ...
dpkg: dependency problems prevent configuration of apt:
 apt depends on libapt-pkg4.12 (>= 0.9.16); however:
  Version of libapt-pkg4.12:amd64 on system is 0.9.9.1~ubuntu3.

To fix this download correct version of the dependency from the same site .要修复此从同一站点下载正确版本的依赖项。

And install that:并安装:

sudo dpkg -i libapt-pkg4.12_1.0.1ubuntu2.5_amd64.deb须藤 dpkg -i libapt-pkg4.12_1.0.1ubuntu2.5_amd64.deb

Now you should be able to repeat the first command and install apt .现在您应该能够重复第一个命令并安装apt

Note: The package versions may be different depending upon your version of Ubuntu.注意:软件包版本可能会有所不同,具体取决于您的 Ubuntu 版本。 To locate the correct version use the menu in the header to select your ubuntu version:要找到正确的版本,请使用标题中的菜单选择您的 ubuntu 版本:在此处输入图片说明

尝试su在 tty 环境(无 gui)中 root,然后尝试apt-get update和/或apt-get -f install

尝试使用 aptitude 或下载该特定包(如有必要,带有依赖项)并使用 dpkg -i your-downloaded-packages*.deb 安装它

Try this one-liner, it has helped me most of the time, when I get dependency issues.试试这个单线,当我遇到依赖性问题时,它在大多数情况下对我有帮助。

Enter the following command sudo dpkg install -f .输入以下命令sudo dpkg install -f I hope this helps.我希望这有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM