Installing the sqlite driver for php 8.1 on Ubuntu 21.10 should be as simple as running:
sudo apt install php-sqlite3
However if you got the error:
Reading package lists... Done
Building dependency tree... Done
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:
php8.1-sqlite3 : Depends: php8.1-common (= 8.1.2-1ubuntu2.10) but 8.1.5-1+ubuntu21.10.1+deb.sury.org+1 is to be installed
E: Unable to correct problems, you have held broken packages.
Then you are in good company. This is how I solved. it.
Solution
NB: You should already have php 8.1 installed. Running php --version
should give a result of php 8.1
and above.
1. Update your System Dependencies
sudo apt update
sudo apt upgrade
2. Add PHP PPA
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
3. Install php-sqlite3
sudo apt install php8.1-sqlite3
This should work now.
Acknowledgement
This article is just a copy of https://medium.com/@laraveltuts/how-to-install-and-run-php-8-x-on-ubuntu-20-04-8f18e7565c41 shamelessly specialized for fixing the unmet dependencies problem.
Top comments (0)