(我刚从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-4ubuntu2.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()
- 我用谷歌搜索,他们说是缺少驱动程序的问题,有道理...它说那里缺少驱动程序,所以我尝试安装 php7.4-mysql 驱动程序,但后来...
$ 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
按照@guiverc 的建议运行
这是输出
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
我刚刚删除了似乎有问题的包!
然后我再次安装它,之后我再次尝试了相同的命令,瞧!
我必须说我确实检查了@Karel 建议的帖子,并按照这些问题的答案建议的方式创建了一个新的 sources.list 文件,并且它起作用了,它可能也与此有关......老实说我没有'不要尝试之前解决我的问题的方法(即卸载 php7.4-common;因为我并不真正理解操作系统告诉我的内容),所以我不知道是否使用软件更改创建新文件&更新有没有帮助。