How should I finish this command with aptitude?

Need help with C, C++, perl, python, etc?

How should I finish this command with aptitude?

Postby maparus » 2007-04-01 23:45

I have a slow dial up connection and need to let my computer run all night sometimes So for example let's say I want to install amarok, bittornado, pan, and kshutdown. I also want the computer to shut down after the last piece of software is finished. So how would I finish this line with aptitude?

debian:/home/maparus# aptitude install


many thanks maparus
User avatar
maparus
 
Posts: 54
Joined: 2006-11-12 03:54
Location: Indiana, USA

Postby DeanLinkous » 2007-04-02 00:26

write a script and run it
not familar with aptitude but apt would need -y so it would assume YES to questions

#!/bin/bash
apt-get install -y amarok bittornado pan kshutdown
sleep 30
reboot
Aye, fight and you may fail, sellout, and you may live, a while. And dying in your MScash beds, you'll be willin' to trade ALL the cash, to come back here and tell our enemies that they may FUD our customers, but they'll never take...OUR FREEDOM!
User avatar
DeanLinkous
 
Posts: 1611
Joined: 2006-06-04 15:28

Postby mzilikazi » 2007-04-02 21:13

I have never been a big fan of feeding the -y switch to aptitude. IMHO it's better to only download the packages you need w/ the -d switch so something like:
Code: Select all
aptitude install -d amarok bittornado pan kshutdown && init 0

Then, when you next return to the machine your packages are there but not installed. You can install them as per usual and answer any questions presented to you instead of just assuming 'yes'.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby maparus » 2007-04-02 21:58

And the "&& init 0" at the end will turn my puter off after the the software has been downloaded????????

maparus
User avatar
maparus
 
Posts: 54
Joined: 2006-11-12 03:54
Location: Indiana, USA

Postby izar » 2007-04-02 22:03

It surely will (init 0).
You can try it as root from a console to see it in action.
User avatar
izar
 
Posts: 1715
Joined: 2007-01-01 18:34
Location: Euskal Herria

Postby maparus » 2007-04-04 01:20

Works fine thanks to all. One question what is the meaning of the "&&" and the "0" at the end?

maparus
User avatar
maparus
 
Posts: 54
Joined: 2006-11-12 03:54
Location: Indiana, USA

Postby mzilikazi » 2007-04-04 02:10

maparus wrote:Works fine thanks to all. One question what is the meaning of the "&&" and the "0" at the end?

maparus


&& means if the first command completes do the second command
You could use it like this too:
Code: Select all
apt-get update && apt-get upgrade && apt-get clean

Debian uses sysv init.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Postby maparus » 2007-04-04 03:28

Thanks again

maparus
User avatar
maparus
 
Posts: 54
Joined: 2006-11-12 03:54
Location: Indiana, USA


Return to Programming

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable