Jika docker image yang kita pakai sudah bertahun-tahun mungkin OS yang dipakai image tersebut sudah tidak disupport, sehingga saat kita mau update (misal perlu install lib / package tambahan, namun harus update dulu) akan mengalami kendala sbb:
root@myawesomeimagedocker:/# apt update
Ign:1 http://security.debian.org/debian-security buster/updates InRelease
Ign:2 http://deb.debian.org/debian buster InRelease
Err:3 http://security.debian.org/debian-security buster/updates Release
404 Not Found [IP: 151.101.130.132 80]
Ign:4 http://deb.debian.org/debian buster-updates InRelease
Err:5 http://deb.debian.org/debian buster Release
404 Not Found [IP: 151.101.130.132 80]
Err:6 http://deb.debian.org/debian buster-updates Release
404 Not Found [IP: 151.101.130.132 80]
Reading package lists... Done
E: The repository 'http://security.debian.org/debian-security buster/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://deb.debian.org/debian buster Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'http://deb.debian.org/debian buster-updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.Error tersebut terjadi karena OS misal Debian Buster (10) telah melewati masa dukungan dan repositori regulernya telah dipindahkan ke arsip. Sejak 30 Juni 2024, Debian Buster tidak lagi menerima pembaruan keamanan rutin dan repositorinya dihapus dari mirror utama (deb.debian.org dan security.debian.org), sehingga menghasilkan 404 Not Found saat menjalankan apt update.
Solusinya ubah /etc/apt/sources.list agar tidak lagi mengarah ke deb.debian.org atau security.debian.org
contoh kalau menggunakan nano:
nano /etc/apt/sources.listkita update menjadi sbb:
deb http://archive.debian.org/debian buster main contrib non-free
deb http://archive.debian.org/debian-security buster/updates main contrib non-free
deb http://archive.debian.org/debian buster-updates main contrib non-free
namun, jika kita belum pernah install editor (misal nano atau vi) di docker image sebelumnya maka saat akan install editor kita diminta update dulu, sedangkan update aja nggak bisa :D
Solusinya bisa dengan edit file /etc/apt/sources.list di luar docker (copy keluar, edit, kemudian copy lagi ke image docker), caranya:
- Copy file sources.list ke luar dulu, misal nama containernya
odoo14ce-odoo-1:
docker cp odoo14ce-odoo-1:/etc/apt/sources.list ./sources.list
- Lakukan edit dengan editor lokal komputer kita
- Kemudian copy lagi ke container
docker cp ./sources.list odoo14ce-odoo-1:/etc/apt/sources.list
Jika sudah, masuk ke container, kemudian jalankan apt clean
Maka seharusnya kita sudah bisa update, jalankan apt update
Semoga bermanfaat.