Uninstallation-script

After seeing a topic made by @Etz , i thought about a script to remove all the unnecessary software that have been installed. Maybe we can work togheter and remove (uncheck) what we want the script to remove for the Omnia.

For example some of us want to use transmission and not wanting to use the webcam ability. But those guys who want the webcam ability, while not wanting the transmission torrent client.

If we create a script with commented lines for each and every software package that, we can comment on what it does and stands for and to “install” or uninstall.

To give you a small example of the script.

#!/bin/bash

##Remove the "#" to activate that line. "##" stands for a comment.

##Transmission, used for downloading torrent files
#opkg remove luci-app-transmission transmission-daemon-openssl

Please do give me the necessary feedback. I have been using script, but i KNOW i am still an amateur. So the dinosaurs among us, please do educate us with your knowledge.

1 Like

Wouldn’t it be about the same amount of work to actually install packages you want and write Uninstall "pkg" into user.lua?

What my intention is, there are many packages that are installed, but by default we may not even know of their existence while not being necessary for own usage.

So the part of “actually install package” on that part on second thought, i guess you’re right.

This is not required and because it would have to be run after every updater execution it is also not recommended. If you want minimal system then uncheck all user lists in updater tab in foris. Or edit file /etc/config/updater.

1 Like

Here is the list of packages installed by default https://api.turris.cz/openwrt-repo/omnia/lists/base.lua

@miska , @cynerd

So we can then make a script that tells what those packages that have been installed are for, give the possibility to remove them and also put this in the “user.lua” as you (@miska) suggested?

The only “manual” thing to do is to “uncomment” certain packages we want to be removed. Because for each individual is a different situation with different need of packages.

In long. If you have some software you don’t want and after removing it with opkg remove it returns that it is mentioned somewhere in one of enable user lists. Unless it is base user list, you can disable it and this way get rid of that package. If it is just single package you don’t want but rest of user list is fine for you, than you can write rule to /etc/updater/user.lua in form of Uninstall "pkg" {priority=60} where pkg is package you don’t want. Only exception when this doesn’t work is when you are trying uninstall package that is marked as critical (you probably don’t want remove those because they are mostly system packages and essential tools).

@cynerd, What you are saying is exactly, but with the addition that somebody else knows MORE then me about certain packages and what they stand for.

I for example am not indeed of “sfp”. I also do not know which packages i need to remove, it is not that i cannot investigate and come to know of these packages. Somebody else knows about those exact packages and puts them in the “script”. I only have to uncomment those lines. The script removes it for me and puts it in the user.lua.

What is the difference? Time to investigate which packages are for “sfp”. SFP is just one of the many. Spend your time instead on other useful things.

Yes you can make some script that does that (although I don’t see exact usage when that is exactly for what user lists are for), but as you implemented it it won’t work. Opkg wrapper doesn’t care about removal of packages that are chosen as dependencies or from user lists (it’s just simple script so it’s basically impossible). If you want get rid of some package than you must found out where it comes from. Basically it can come only from three places, it is mentioned in some user list or in updater configuration /etc/updater/*.lua or it is dependency of some other installed package. So simple script just calling opkg won’t solve this. You would have to have complicated logic in it, because unless user is just using your script it would be very easy to make it not work.

So you can make some minimal user list for some features, but don’t do it way of removing packages from system, do it so you create your own user list. So you would have to create file with Install "pkg1" "pkg2". Or use opkg install, but do not expect that you can remove packages that are in system, because of previously mentioned reasons.

Anyway if you are going to do it, do it right way and use updater configuration so it would be more clear and user could remove what they added just by removing some line from /etc/updater/user.lua

That is why i said, that i am still an amateur, but what i do have in mind is saving time.

Like you said removing some packages won’t do the job, that i can also understand, because you know more then me about Turris-OS/openWRT.

Removing packages is just as a example. Making a complicated part of the script that “adds” lines etc to some configuration files or removes lines, leaving critical packages alone etc etc being part of the whole script.

Off course this “idea” will not work, if nobody cares to share anything. So thank you for your feedback, it did help to clarify for myself some of the things.

Two comments.

If you don’t know what a particular piece of software is, why are you removing it? It may be put in place for a specific reason (dependencies). Mucking about with opkg and removing software is a pretty quick way to render your router non-functional and require a restore from scratch. What is it you hope to gain? Installed packages take up minimal space (of which the Omnia has plenty of compared to consumer routers) and something not currently running doesn’t drain resources. I could understand trying to free up space if you were on a consumer router running OpenWRT, where flash is at a premium, but the few k you’re recovering isn’t going to get you much.

For amateur’s there is a simple way to remove some software you don’t think you’ll be using, just uncheck it in the “easy” interface.

My advice, unless you have a thorough understanding of OpenWRT, don’t go about removing packages you don’t “feel” are needed. OpenWRT doesn’t install bloatware. Turris, might install software you feel isn’t necessary, like Transmission, but there’s already a way to remove that, anything else that isn’t in the easy interface I’d leave alone.

I am also not saying anything you are saying. I have never claimed openWRT has bloatware. All the stuff that is installed are the necessary stuff.

Turris-OS has only some software (Transmission for example) being one of the packages not necessary to have if you are not going to use off course.This “some software” is exactly what i am referring to. Many people would leave it just like that, i have the mentality of if you are not gonna use or ever gonna use, why bother leaving it like that.

So i am not sure what else is under “some software” that can be removed what is not even part of openWRT as the base system. That is my whole “issue” is about :slight_smile:

But what if Turris decides to use Transmission to distribute updates? Now you’ve just lost the ability to pull down updates. Just because you aren’t going to use it you don’t know OpenWRT or Turris might not intend on using it at a later point, or it might be something scheduled in a once-a-month cron job.

I can understand you might not want a bittorrent client running, you can easily disable auto-start (actually it isn’t started by default). Even if it is running, unless it’s actively transferring it is consuming minimal resources. Linux is efficient like that.

It brings me back to my previous question, what is it you’re looking to do by removing software? Free up flash space? Reduce attack vectors? Just removing software because it’s there is a bad goal.

My goal were two things, the third one later on came with it. Security, minimal space of packages x, y, z has become a bit more then minimal when things are adding up. More space on it, will make things slow, although we might not even experience it.

Not wanting to have functionality when i am not going to use ever. If i decide to use it, there is ALWAYS the ability to then install it again. So it is not the question why i should not delete it, it is the question why i should keep it.

Your argument of CZ.NIC wanting to use certain functionality doesn’t give it the right to have it installed. If certain functionality is gonna be used they will say it way before pushing it. Pushing updates is one thing, but deciding how some updates should be pushed is another thing. Maybe many people don’t want their upload to be used or don’t have enough upload speed.

I have a ubuntu LXC running with Deluge-torrent client on the Omnia :slight_smile: Why have two torrent client on it, while one is doing nothing.

LOL.

First off, you admit you have little-to-no knowledge of OpenWRT and the Omnia OS. So how are you qualified to say what software is necessary for the router to function correctly or to make any calls on what is needed by Turris for correct operation of the router?

CZ.NIC has every “right” to have software packages installed in the Omnia OS, after all they created it.

As I’ve said, the amount of storage you are freeing up by removing packages is minimal. My Omnia is loaded up with quite a bit of additional software and is still using only 650M out of the 8G of flash space it came with. That’s less than 10% in use. Looking through the package list, transmission, plus the CLI, Web interface and daemon, looks to take up roughly 1.5M. That’s a drop of water in a very large bucket.

You asked for advice here from people who know OpenWRT better than you do, I’ve been using OpenWRT for many years on a variety of devices. My advice to you is thus: just let it be, your gains will be minimal, at best. Turris isn’t Microsoft, your router isn’t filled with bloatware. If you honestly feel Turris doesn’t know what they’re doing and selling you a device with a poor router OS, then perhaps you should buy a different product.

You seriously don’t get it. But i blame myself for it, because appearently i am not explaining it correctly. Let me make it short and powerful.

  • Give me the reason to have “mjpg streamer” or “hd-idle” installed.

(I have my Omnia in my living room. Not planning to put a webcam device on it).
(I have a mSATA SSD in the Omnia and i have my OWN BUILD NAS.)

Ok, this is the first time you’ve mentioned the mjpg streamer or hd-idle. We were previously discussing Transmission.

You’re missing my point, I said several times removing software on the “Updater” page of the easy interface shouldn’t compromise functionality of your router. But you were asking what software you can remove with opkg and I’ve pointed out several times, if you’re going the advanced (command line) route, you had better know exactly what you’re doing or you’re going to disable your router. By the way, it’s quite easy to get it to a state where you won’t easily be able to reinstall what you removed (try removing openssh and then scrounging around for a UART cable to get back in to a command line).

If you want to remove software, unclick the boxes on the “Updater” page. Anything beyond that, good luck! My advice for you is, don’t mess with opkg.

YOU SERIOUS!!???

You really really really thought i was ONLY talking about things like “Transmission”? I was talking about things we DON’T use necessarily.

There are things i do use, if you read this whole thread you would have understood why i wanted to involve other people in this. Because i don’t know everything about it and there are other who do know more then me. So we could together find out which packages we can safely remove and not by accident remove “openssh”. If that also by accident happens, i have bought a cable to directly have connection with the Omnia. Serial-cable kind of thing, that you got with the hacker-perk.

As I said, you clearly don’t know what software packages are installed (easy enough to see using opkg or LuCI) or what they do (try google), you asked for advice from other people who do. I do. My advice, leave it alone. There is very little to gain from removing software you feel doesn’t need to be installed and more to lose. OpenWRT doesn’t include boat. Turris gives you the option to add some software and easily remove it (Easy management site -> Updater page).

I’m done with this discussion, good luck bricking your router! You should have bought a Netgear and called it a day.

Well i am sure you know that feeling that you just leave something alone to do it’s job even though it has some thing on it.

Well i don’t :grin:. I if i see the possibility of “tweaking” something that is the first thing i do. That is why i bought the Omnia in the first place, to mess with it and make it the best it can be for my own situation.