Ubuntu 16.04无法安装php5-tidy,已添加Debian源并更新APT求协助
Hey there! Let's work through this php5-tidy installation issue step by step—since you've already added the Sid repo and run apt update, we can focus on resolving common roadblocks that might be getting in the way:
1. Double-Check Your Repository Entry
First, confirm your /etc/apt/sources.list has a properly formatted entry for the Debian Sid repo. It should look like this:
deb http://deb.debian.org/debian sid main
Run this command to verify APT recognizes the repo as a source for php5-tidy:
apt-cache policy php5-tidy
You should see the Sid repo listed in the output. If not, scan your sources.list file for typos (like missing spaces or misspelled URLs).
2. Avoid Unintended Sid Package Pulls with APT Pinning
Since Sid is Debian's unstable branch, mixing it with stable/testing repos can trigger dependency conflicts. To prioritize only php5-tidy from Sid (without upgrading other system packages):
- Create a pinning file at
/etc/apt/preferences.d/php5-tidy-pinwith these contents:Package: php5-tidy Pin: release n=sid Pin-Priority: 990
This tells APT to favor the Sid version of php5-tidy while keeping your system's other packages on their current branch.
3. Resolve Dependency Issues
Try installing the package with APT's built-in fix for broken dependencies:
sudo apt install php5-tidy -f
If you still get unmet dependency errors, run this command to get detailed conflict info:
sudo apt-get -o Debug::pkgProblemResolver=yes install php5-tidy
The output will show exactly which packages are blocking the installation, so you can address them individually.
4. Confirm Architecture Compatibility
You mentioned the arm64 package—make sure your system matches this architecture. Run:
dpkg --print-architecture
If your system uses a different architecture (like amd64), you'll need to adjust your repo setup to target the correct package variant.
5. Refresh APT Cache
Stale cache data can sometimes cause installation glitches. Clear and refresh it with:
sudo apt clean sudo apt update
Then try installing php5-tidy again.
If none of these steps work, share the exact error message you get when running sudo apt install php5-tidy—that will help narrow down the problem even further!
内容的提问来源于stack exchange,提问作者misaligar

