Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#571 - opkg can be too easily removed #5689

Closed
openwrt-bot opened this issue Mar 1, 2017 · 3 comments
Closed

FS#571 - opkg can be too easily removed #5689

openwrt-bot opened this issue Mar 1, 2017 · 3 comments
Labels

Comments

@openwrt-bot
Copy link

openwrt-bot commented Mar 1, 2017

luizluca:

Hello,

opkg can remove itself too easily. Just a wrong paste can run something like;

opkg remove opkg install openvpn-openssl

It runs happily. However, without opkg, I cannot reinstall it.
This is very difficult to undo.

opkg should be somehow pre-locked in order to avoid removal. The user should need to supply some time of force or unlock the package before in order to really remove opkg.

@openwrt-bot
Copy link
Author

openwrt-bot commented Mar 1, 2017

luizluca:

A workaround would be to use:

cd /overlay/upper rm ./bin/opkg ./etc/opkg/distfeeds.conf ./etc/opkg.conf ./lib/upgrade/keep.d/opkg ./usr/lib/opkg/inf o/opkg.control ./usr/lib/opkg/info/opkg.conffiles ./usr/lib/opkg/info/opkg.list ./usr/sbin/opkg-key reboot -f

@openwrt-bot
Copy link
Author

openwrt-bot commented Mar 1, 2017

jow-:

I think we just need to mark opkg as essential package.
You can test the effect by carefully editing /usr/lib/opkg/status. Skip to the "Package: opkg" section and add "Essential: yes" to it, afterwards opkg will refuse to uninstall itself with:

root@LEDE:/# opkg remove opkg
Refusing to remove essential package opkg.
	Removing an essential package may lead to an unusable system, but if
	you enjoy that kind of pain, you can force opkg to proceed against
	its will with the option: --force-removal-of-essential-packages
No packages removed.

@openwrt-bot
Copy link
Author

openwrt-bot commented Apr 13, 2017

luizluca:

Jo,

That's exactly what I was requesting :) Thanks.
Maybe ebf846b should also be backported to 17.01.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant