使用 apt-get 强制安装

使用 apt-get 强制安装

sudo apt-get install beanstalkd我尝试使用(也带有选项)安装 beanstalkd -f,但出现以下错误:

Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run `apt-get -f install' to correct these:
The following packages have unmet dependencies:
  beanstalkd: Depends: libevent-1.4-2 (>= 1.4.13-stable) but it is not going to be installed
  mysql-server-5.1: Depends: mysql-client-5.1 (>= 5.1.62-0ubuntu0.10.04.1) but it is not going to be installed
                    Depends: libmysqlclient16 (>= 5.1.21-1) but it is not going to be installed
                    Depends: mysql-server-core-5.1 (>= 5.1.62-0ubuntu0.10.04.1) but it is not going to be installed
                    PreDepends: mysql-common (>= 5.1.62-0ubuntu0.10.04.1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

答案1

首先从存储库下载 deb 包:

apt-get download <package_name>

安装 deb 文件(它应该在当前文件夹中):

sudo dpkg -i <downloaded_package_deb_file>

答案2

尝试

sudo apt-get install -f

终端中没有包。

如果仍然出现依赖项错误,则必须发出

sudo apt-get remove beanstalkd

然后尝试

sudo apt-get install mysql-server beanstalkd

这应该安装 mysql 依赖项和 beanstalk。

答案3

尝试运行sudo apt-get --fix-missing install

答案4

跑步

apt --fix-broken install

没有软件包。然后尝试再次安装软件包。

相关内容