(我只是从ubuntu 18.04移动到Ubuntu 20.04。)
php7.4-mysql : Depends: php7.4-common (= 7.4.3-4ubuntu2.2) but 7.4.9-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
php7.4-mysql
依赖于on php7.4-common
(它已经安装好了,所以我看不到问题所在),但是它也写着(= 7.4.3-4ubuntu2.2)
,然后我迷路了……7.4.3-4 ubuntu2.2?那是什么?如果这还不够复杂的话.but 7.4.9-1+ubuntu18.04.1+deb.sury.org+1
,然后我就想不出怎么克服这个问题了。$ php artisan migrate
命令(我雇了一个主机,我只是在处理它),我得到了输出. Illuminate\Database\QueryException
could not find driver (SQL: select * from information_schema.tables where table_schema = gastigram and table_name = migrations and table_type = 'BASE TABLE')
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {
> 671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|
+34 vendor frames
35 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
$ sudo apt install php7.4-mysql
Reading package lists... Done
Building dependency tree
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:
php7.4-mysql : Depends: php7.4-common (= 7.4.3-4ubuntu2.2) but 7.4.9-1+ubuntu18.04.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
如何解决这个问题与未满足的依赖,因为一个破碎的包?
$ apt-cache policy php7.4-common
这是输出
php7.4-common:
Installed: 7.4.9-1+ubuntu18.04.1+deb.sury.org+1
Candidate: 7.4.9-1+ubuntu18.04.1+deb.sury.org+1
Version table:
*** 7.4.9-1+ubuntu18.04.1+deb.sury.org+1 100
100 /var/lib/dpkg/status
7.4.3-4ubuntu2.2 500
500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://us.archive.ubuntu.com/ubuntu focal-security/main amd64 Packages
7.4.3-4ubuntu1 500
500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
发布于 2020-09-08 20:08:46
$ sudo apt remove php7.4-common
然后我又安装了一次,之后我又尝试了同样的命令,瞧!
我必须说,我确实检查了@卡雷尔建议的帖子,并创建了一个新的sources.list文件,就像这些问题的答案一样,而且它起了作用,这也可能与此有关。老实说,我以前没有尝试过什么解决了我的问题(这是卸载php7.4-常见的;因为我不太明白os告诉我的是什么),所以我不知道用软件和更新的更改来创建新文件是否有帮助。
https://askubuntu.com/questions/1273697
复制