CodeArt-编码艺术

【FixErrors】- 404 Not Found [IP:91.189.95.83 80]

字数统计: 314阅读时长: 2 min
2019/03/06 Share

本地环境:Laravel官方Homestead的box(ubuntu18.04.1)

问题:无phpize,导致无法编译PHP扩展

解决过程:

1
> sudo apt install php7.2-dev

报错

1
> E: Failed to fetch http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/o/openssl/libssl-dev_1.1.0h-2.0+ubuntu18.04.1+deb.sury.org+1_amd64.deb  404  Not Found [IP: 91.189.95.83 80]

由PPA引起

解决报错:

新建名为ppa-remove脚本,内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
sudo rm /tmp/update.txt; tput setaf 6; echo "Initializing.. Please Wait"
sudo apt-get update >> /tmp/update.txt 2>&1; awk '( /W:/ && /launchpad/ && /404/ ) { print substr($5,26) }' /tmp/update.txt > /tmp/awk.txt; awk -F '/' '{ print $1"/"$2 }' /tmp/awk.txt > /tmp/awk1.txt; sort -u /tmp/awk1.txt > /tmp/awk2.txt
tput sgr0
if [ -s /tmp/awk2.txt ]
then
tput setaf 1
printf "PPA's going to be removed\n%s\n" "$(cat /tmp/awk2.txt)"
tput sgr0
while read -r line; do echo "sudo add-apt-repository -r ppa:$line"; done < /tmp/awk2.txt > out
bash out
else
tput setaf 1
echo "No PPA's to be removed"
tput sgr0
fi

授予脚本执行权限:

1
sudo chmod +x ppa-remove

ppa-remove文件复制到/usr/bin目录,这样就可以从任何地方访问它。

执行:

1
sudo ppa-remove

这样即可消除报错,继续你的填坑之旅吧。

参考:https://askubuntu.com/questions/65911/how-can-i-fix-a-404-error-when-using-a-ppa-or-updating-my-package-lists

CATALOG