Rozbitý opkg a localrepo

Dlouho jsem měl turris v rc branch ale při posledních pokusech jsem odinstaloval nějaké php-mod balíčky a teď je nemohu dostat zpět protože opkg localrepo je rozbitý.

Zkusil jsem přepnout branch na deploy ale stále stejná chyba a nevím si už rady.

openwrt /usr/share/updater # opkg update
Downloading https://repo.turris.cz/turris/packages//base/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 145k 100 145k 0 0 846k 0 --:–:-- --:–:-- --:–:-- 1516k
Updated list of available packages in /var/opkg-lists/turris_base
Downloading https://repo.turris.cz/turris/packages//base/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2323 0 --:–:-- --:–:-- --:–:-- 2396
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//lucics/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 73197 100 73197 0 0 882k 0 --:–:-- --:–:-- --:–:-- 893k
Updated list of available packages in /var/opkg-lists/turris_lucics
Downloading https://repo.turris.cz/turris/packages//lucics/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2220 0 --:–:-- --:–:-- --:–:-- 2287
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//management/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1976 100 1976 0 0 29058 0 --:–:-- --:–:-- --:–:-- 29939
Updated list of available packages in /var/opkg-lists/turris_management
Downloading https://repo.turris.cz/turris/packages//management/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2323 0 --:–:-- --:–:-- --:–:-- 2359
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//node/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1387 100 1387 0 0 21015 0 --:–:-- --:–:-- --:–:-- 21671
Updated list of available packages in /var/opkg-lists/turris_node
Downloading https://repo.turris.cz/turris/packages//node/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2323 0 --:–:-- --:–:-- --:–:-- 2396
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//openwisp/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 504 100 504 0 0 7753 0 --:–:-- --:–:-- --:–:-- 7875
Updated list of available packages in /var/opkg-lists/turris_openwisp
Downloading https://repo.turris.cz/turris/packages//openwisp/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2157 0 --:–:-- --:–:-- --:–:-- 2188
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//packages/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 191k 100 191k 0 0 1877k 0 --:–:-- --:–:-- --:–:-- 1915k
Updated list of available packages in /var/opkg-lists/turris_packages
Downloading https://repo.turris.cz/turris/packages//packages/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2323 0 --:–:-- --:–:-- --:–:-- 2396
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//php/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5722 100 5722 0 0 86696 0 --:–:-- --:–:-- --:–:-- 89406
Updated list of available packages in /var/opkg-lists/turris_php
Downloading https://repo.turris.cz/turris/packages//php/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2359 0 --:–:-- --:–:-- --:–:-- 2435
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//printing/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4260 100 4260 0 0 60000 0 --:–:-- --:–:-- --:–:-- 61739
Updated list of available packages in /var/opkg-lists/turris_printing
Downloading https://repo.turris.cz/turris/packages//printing/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2253 0 --:–:-- --:–:-- --:–:-- 2287
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//routing/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11272 100 11272 0 0 166k 0 --:–:-- --:–:-- --:–:-- 171k
Updated list of available packages in /var/opkg-lists/turris_routing
Downloading https://repo.turris.cz/turris/packages//routing/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2359 0 --:–:-- --:–:-- --:–:-- 2359
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//sidn/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1540 100 1540 0 0 24062 0 --:–:-- --:–:-- --:–:-- 24838
Updated list of available packages in /var/opkg-lists/turris_sidn
Downloading https://repo.turris.cz/turris/packages//sidn/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2013 0 --:–:-- --:–:-- --:–:-- 2068
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//telephony/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 5450 100 5450 0 0 81343 0 --:–:-- --:–:-- --:–:-- 83846
Updated list of available packages in /var/opkg-lists/turris_telephony
Downloading https://repo.turris.cz/turris/packages//telephony/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2435 0 --:–:-- --:–:-- --:–:-- 2516
Signature check failed.
Remove wrong Signature file.
Downloading https://repo.turris.cz/turris/packages//turrispackages/Packages.gz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 138k 100 138k 0 0 1507k 0 --:–:-- --:–:-- --:–:-- 1523k
Updated list of available packages in /var/opkg-lists/turris_turrispackages
Downloading https://repo.turris.cz/turris/packages//turrispackages/Packages.sig
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 151 100 151 0 0 2097 0 --:–:-- --:–:-- --:–:-- 2157
Signature check failed.
Remove wrong Signature file.

Zkoušel jsem nainstalovat nové certifikáty ale to jednak nejde ani nepomůže

openwrt /data # opkg install ca-certificates_20180409-2_mpc85xx.ipk
Package ca-certificates (20180409-2) installed in root is up to date.
Traceback (most recent call last):
File “/usr/bin/localrepo”, line 543, in
main()
File “/usr/bin/localrepo”, line 531, in main
cmd_add(args)
File “/usr/bin/localrepo”, line 295, in cmd_add
add_pkg(args.repo, index, fpkg)
File “/usr/bin/localrepo”, line 252, in add_pkg
ctl = pkg_ctl(file)
File “/usr/bin/localrepo”, line 239, in pkg_ctl
return parse_control(content)
File “/usr/bin/localrepo”, line 60, in parse_control
i = line.find(’:’)
TypeError: a bytes-like object is required, not ‘str’

Vše stejně končí chybou v /usr/bin/localrepo

openwrt /data # opkg install --force-reinstall ca-certificates_20180409-2_mpc85xx.ipk
Removing package ca-certificates from root…
Doing .
ca-certificates.crt => a94d09e5.0
Installing ca-certificates (20180409-2) to root…
Configuring ca-certificates.
Doing .
ACCVRAIZ1.crt => a94d09e5.0
AC_RAIZ_FNMT-RCM.crt => cd8c0d63.0
Actalis_Authentication_Root_CA.crt => 930ac5d2.0
AddTrust_External_Root.crt => 157753a5.0
AffirmTrust_Commercial.crt => 2b349938.0
<ZKRÁCENO>
WARNING: Skipping duplicate file ca-certificates.crt
certSIGN_ROOT_CA.crt => 8d86cdd1.0
ePKI_Root_Certification_Authority.crt => ca6e4ad9.0
thawte_Primary_Root_CA.crt => 2e4eed3c.0
thawte_Primary_Root_CA_-G2.crt => c089bbbd.0
thawte_Primary_Root_CA
-_G3.crt => ba89ed3b.0
Traceback (most recent call last):
File “/usr/bin/localrepo”, line 543, in
main()
File “/usr/bin/localrepo”, line 531, in main
cmd_add(args)
File “/usr/bin/localrepo”, line 295, in cmd_add
add_pkg(args.repo, index, fpkg)
File “/usr/bin/localrepo”, line 252, in add_pkg
ctl = pkg_ctl(file)
File “/usr/bin/localrepo”, line 239, in pkg_ctl
return parse_control(content)
File “/usr/bin/localrepo”, line 60, in parse_control
i = line.find(’:’)
TypeError: a bytes-like object is required, not ‘str’

Při pokusu instalovat jakýkoliv lokální balíček vždy stejná chyba :

opkg install ./php7-mod-sqlite3_7.1.23-1_mpc85xx.ipk
Package php7-mod-sqlite3 (7.1.23-1) installed in root is up to date.
Traceback (most recent call last):
File “/usr/bin/localrepo”, line 543, in
main()
File “/usr/bin/localrepo”, line 531, in main
cmd_add(args)
File “/usr/bin/localrepo”, line 295, in cmd_add
add_pkg(args.repo, index, fpkg)
File “/usr/bin/localrepo”, line 252, in add_pkg
ctl = pkg_ctl(file)
File “/usr/bin/localrepo”, line 239, in pkg_ctl
return parse_control(content)
File “/usr/bin/localrepo”, line 60, in parse_control
i = line.find(’:’)
TypeError: a bytes-like object is required, not ‘str’

Tak už jsem si pomohl sám, pokud by se někdo dostal do stejně špatné situace tak ani po změné branch z rc na deploy se nereinstalovaly cz nic certifikáty, tedy je třeba stáhnout

wget https://repo.turris.cz/turris/packages/turrispackages/cznic-repo-keys_4.1_mpc85xx.ipk
opkg install --force-reinstall cznic-repo-keys_4.1_mpc85xx.ipk

Tím dojde k znovunahrání klíčů do /etc/opkg/keys a následně již opkg správně aktualizuje.

1 Like

Díky za upozornění. Již jsem to tu na fóru potkal. Opravím až budu v práci. Oprava snad bude v dalším fixup releasu.