適切なアップデートとppa削除時のエラー

適切なアップデートとppa削除時のエラー

Ansibleを使用してvagrantでPHP 7.0のインストールをテストしようとすると、次のエラーが発生します。

TASK [php-cli : Install php7.0-cli package] *****************************************************************************
Thursday 21 November 2019  20:08:15 +0000 (0:00:00.034)       0:00:02.156 *****
fatal: [127.0.0.1]: FAILED! => {"changed": false, "msg": "Failed to update apt cache: W:Failed to fetch http://ppa.launchpad.net/ansible/ansible/ubuntu/dists/jessie/main/binary-amd64/Packages  404  Not Found [IP: 127.0.0.1]\n, E:Some index files failed to download. They have been ignored, or old ones used instead."}

手動更新を再試行しましたが、成功しませんでした。

vagrant@jessie:~/ansible/infra/deployment$ sudo apt update
Ign http://ppa.launchpad.net jessie InRelease
Ign http://ppa.launchpad.net jessie Release.gpg
Ign http://ppa.launchpad.net jessie Release
Err http://ppa.launchpad.net jessie/main amd64 Packages
Err http://ppa.launchpad.net jessie/main amd64 Packages
Ign http://httpredir.debian.org jessie InRelease
Err http://ppa.launchpad.net jessie/main amd64 Packages
Get:1 http://httpredir.debian.org jessie-updates InRelease [16.3 kB]
Hit http://security.debian.org jessie/updates InRelease
Err http://ppa.launchpad.net jessie/main amd64 Packages
Hit http://httpredir.debian.org jessie Release.gpg
Err http://ppa.launchpad.net jessie/main amd64 Packages
  404  Not Found [IP: 127.0.0.1]
Hit http://httpredir.debian.org jessie Release
Hit http://security.debian.org jessie/updates/main Sources
Get:2 http://httpredir.debian.org jessie-updates/main Sources [20 B]
Hit http://security.debian.org jessie/updates/main amd64 Packages
Get:3 http://httpredir.debian.org jessie-updates/main amd64 Packages [20 B]
Hit http://httpredir.debian.org jessie/main Sources
Hit http://httpredir.debian.org jessie/main amd64 Packages
Fetched 16.3 kB in 2s (5,943 B/s)
W: Failed to fetch http://ppa.launchpad.net/ansible/ansible/ubuntu/dists/jessie/main/binary-amd64/Packages  404  Not Found [IP: 127.0.0.1]
E: Some index files failed to download. They have been ignored, or old ones used instead.

ppaを削除してみてください。

vagrant@jessie:~/ansible/infra/deployment$ sudo add-apt-repository --remove ppa:whatever/ppa
Cannot access PPA (https://launchpad.net/api/1.0/~whatever/+archive/ppa) to get PPA information, please check your internet connection.
vagrant@jessie:~/ansible/infra/deployment$ ping -c3 www.google.com
PING www.google.com 56(84) bytes of data.
64 bytes from waw02s08-in-f196.1e100.net (): icmp_seq=1 ttl=63 time=48.7 ms
64 bytes from waw02s08-in-f196.1e100.net : icmp_seq=2 ttl=63 time=26.8 ms
64 bytes from waw02s08-in-f196.1e100.net : icmp_seq=3 ttl=63 time=48.1 ms
--- www.google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 26.818 ms

私のもの/etc/apt/sources.list

deb http://httpredir.debian.org/debian jessie main
deb-src http://httpredir.debian.org/debian jessie main

deb http://httpredir.debian.org/debian jessie-updates main
deb-src http://httpredir.debian.org/debian jessie-updates main

deb http://security.debian.org/ jessie/updates main
deb-src http://security.debian.org/ jessie/updates main

/etc/apt/sources.list.d/出力:

vagrant@jessie:/etc/apt$ ls
apt.conf.d        preferences.d  sources.list~   sources.list.save  trusted.gpg~
listchanges.conf  sources.list   sources.list.d  trusted.gpg        trusted.gpg.d
vagrant@jessie:/etc/apt$ cd sources.list.d/
vagrant@jessie:/etc/apt/sources.list.d$ ls
ansible-ansible-jessie.list

このエラーをどのように処理する必要がありますか?

ベストアンサー1

この ppa を手動で削除できます。

sudo rm /etc/apt/sources.list.d/ansible-ansible-jessie.list

それから:

sudo apt-get update

このppaを使用するには、trusty代わりにコード名を追加してくださいjessie

sudo nano /etc/apt/sources.list.d/ansible-ansible-jessie.list

次に、次の行を追加します。

deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main

次に、実行して許可さsudo apt-get updateれているコード名を確認してください。アンシプルPPA、ご覧のとおり、jessieディレクトリは表示されません。

おすすめ記事