[Apt-Rpm] question about apt-rpm script
Panu Matilainen
pmatilai at laiskiainen.org
Sat Jan 5 06:41:34 PST 2008
On Fri, 4 Jan 2008, tonytraductor at linguasos.org wrote:
> Hi,
>
> I asked last week about a script to install extra packages on a pclos
> based distro, after install. I didn't get much of a response, but, I'm
> going to try again. (Daddy alwas said, you cain't learn nothing if you
> up'n stop tryin'...)
This list is so quiet these days I don't read it every day, so responses
occasionally take a bit of time. Doesn't mean your messages was ignored :)
> Also, I apologize for the x-post.
>
> I want to make it trivial for the user to install KDE and some extra
> packages after installation of this PCfluxboxOS based distro to their
> hdd.
>
> I figure, if I make a script and link to it in their fluxbox menu, that
> should do the trick.
>
> So, what I want to know is, if the following looks like I'm on the right
> track here:
>
> #!/bin/bash
>
> gksu apt-rpm -y install planner xmms evolution kompozer gimp scribus pidgin firefox3 gxine mplayer (kitchen sink, etc.)
> gksu apt-rpm -y install kde-desktop (blah blah...everything needed to get KDE up'n runnin')
> rm ~/.fluxbox/menu
> cp ~/.fluxbox/extrasmenu ~/.fluxbox/menu
> medit ~/.fluxbox/postxtrainstall.txt
That'll probably end up asking for root password twice (unless gksu does
some sort of caching, which I doubt...). Also you'd need to do "apt-get
update" before the installs, otherwise apt might not even have any
repository data in it's local cache and thus be unable to do anything at
all.
> -
> I will call this installextras.sh and put a link to it in the fluxbox menu.
> [exec] (install extras) {/usr/local/bin/installextras.sh}
>
> I want it to install the packages, then replace the current fluxbox menu with
> one (premade and stuffed into /home/username/somewhere)) with a menu that reflects
> these recommended additions.
>
> I realize that the fluxbox part might be unfamiliar to many, but,
> basically, I just need to replace the text file that sets the fluxbox
> menu with another file...I'm pretty sure the rm oldmenu and cp
> extrasmenu part should work for that. Then, I want it to open a file
> with instructions to log out, and log back in to KDE.
>
> The big part I question is whether I am correcting in using the
> gksu. I want the user to be able to click on the link in the menu,
> get a prompt to enter their root password, and let the script do the rest.
Well, the proper mechanism for gaining root depends on the distro setup -
I'm not really familiar with gksu but I suppose it'll do the job just
fine.
I can't help with the fluxbox menus and such, but Synaptic has some hidden
and little known features that you might find nice for this, if only to
make the install-phase visually more pleasing than apt-get running in a
terminal window:
You can create a "selections file" and feed that to synaptic. For the
example above, the file would look somewhat like this:
--- cut here ---
planner i
xmms i
evolution i
kompozer i
gimp i
scribus i
kde-desktop i
--- cut here ---
Put the file someplace, for the examples purposes say
/usr/local/share/synaptic-extras.txt
Then instead of using apt-rpm in the script, use
gksu synaptic --non-interactive ---update-at-startup \
--set-selections-file=/usr/local/share/synaptic-extras.txt
That'll give you a nice graphical installation of the components in the
selection file that exists at the end of installation, no questions asked
from the user. For added bonus, it's possible to even run a slide-show
while installation is running.
> I would autostart.sh a file to open, either in the browser or medit, with
> instructions to find the script in the menu and execute it.
>
> I'm trying to keep the distro on one cdrom. The current .iso is only 412mb
> and only includes the basics and some translation industry specific tools, but,
> I want to make it easier than falling off a log for the user to install
> all the extra goodies...This is for newbies, of course. Obviously, a seasoned
> linux user would open synaptic or apt-rpm on their own, and likely make
> different choices regarding what packges to install.
> I just want to make the system easy for those who might be a bit lost at first.
> Basically, I want the user to be able to dl the 412mb livecd, and if they dig it, install
> to their hdd, and, with a script, turn Linguas OS into PCLOS-Trans.
>
> Bash scripting is kind of new to me, despite 8 years of using linux.
I can help with using apt/synaptic from scripts, but generic bash
scripting is out of scope on this forum.
> (I amused myself when I wrote one that makes my terminal talk back at me when I tell it to
> $ pissoff). Linux is FUN!
>
> Any and all assistance appreciated, as always.
Hope this helps...
- Panu -
More information about the Apt-Rpm
mailing list