apt-get install list of programs.

Help with issues regarding installation of Debian

apt-get install list of programs.

Postby Piter_ » 2009-06-13 09:12

Hi all.
Yesterday I have reinstalled linux on my computer. Now I have to install a lot of things.
I want to make a txt file with programs i need, and feed it to apt-get. Is there any possibility for that?
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23

Re: apt-get install list of programs.

Postby bugsbunny » 2009-06-13 09:49

With 1 package name per line the following will work:

aptitude install $(cat <textfile>)

The same will not work with apt-get. It would process the first package only. It would work if all the packages were on 1 line. Aptitude is a better choice in any case.
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: apt-get install list of programs.

Postby Piter_ » 2009-06-13 09:53

Thanks
Joybook A52 laptop. Debian stable.
Piter_
 
Posts: 208
Joined: 2006-05-30 14:23

Re: apt-get install list of programs.

Postby Telemachus » 2009-06-13 10:19

To do this with apt-get, you simply need to write a list of packages you want installed followed by a tab and the word "install".

Code: Select all
foo     install
blah    install
yadda   install
ding    install
dong    install

Save this file as 'packages', and then run these commands (as root):

Code: Select all
dpkg --set-selections < packages
apt-get -u dselect-upgrade
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System
User avatar
Telemachus
 
Posts: 4676
Joined: 2006-12-25 15:53

Re: apt-get install list of programs.

Postby Soul Singin' » 2009-06-13 14:27

bugsbunny wrote:With 1 package name per line the following will work:

aptitude install $(cat <textfile>)

The same will not work with apt-get. It would process the first package only.

I beg to differ. The same will work with apt-get.

I just created the following text file and called it file.txt:
Code: Select all
gnome-chess
gnome-hearts

Then I ran:
Code: Select all
[ Sat 13-Jun-2009 10.23 root ] xxxx # apt-get -s install $(cat file.txt)
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  gnome-cards-data
Recommended packages:
  gnome-games-extra-data
The following NEW packages will be installed:
  gnome-cards-data gnome-chess gnome-hearts
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Inst gnome-cards-data (1:2.22.3-3 Debian:5.0.1/stable)
Inst gnome-hearts (0.3-2 Debian:5.0.1/stable)
Inst gnome-chess (0.4.0-3 Debian:5.0.1/stable)
Conf gnome-cards-data (1:2.22.3-3 Debian:5.0.1/stable)
Conf gnome-hearts (0.3-2 Debian:5.0.1/stable)
Conf gnome-chess (0.4.0-3 Debian:5.0.1/stable)
.
User avatar
Soul Singin'
 
Posts: 1466
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

Postby Telemachus » 2009-06-13 14:40

I'll do you both one better. These both work, and they avoid the useless use of cat award:

Code: Select all
aptitude install $(< file.txt)
apt-get  install $(< file.txt)


@ SoulSingin': On the other hand, aptitude still wins this round since it is smart enough to let me test these commands, as a regular user, if I use the -s|--simulate flag. Even with that flag, you must be root even to test apt-get commands. As my students say, "Epic fail."
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System
User avatar
Telemachus
 
Posts: 4676
Joined: 2006-12-25 15:53

Re: apt-get install list of programs.

Postby Soul Singin' » 2009-06-13 14:58

Telemachus wrote:aptitude still wins this round ...

You will have to pry apt-get from my cold, dead hands.
.
User avatar
Soul Singin'
 
Posts: 1466
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

Postby Telemachus » 2009-06-13 15:03

Soul Singin' wrote:You will have to pry apt-get from my cold, dead hands.
.

So I've heard. Out of curiosity, why? That is, why do you prefer it so much? Not flaming, simply curious. (I can say that I started using aptitude back when I was an Ubuntu-newbie, after I learned that it automatically cleans up packages that were installed only as dependencies of etc.)
"We have not been faced with the need to satisfy someone else's requirements, and for this freedom we are grateful."
Dennis Ritchie and Ken Thompson, The UNIX Time-Sharing System
User avatar
Telemachus
 
Posts: 4676
Joined: 2006-12-25 15:53

Re: apt-get install list of programs.

Postby bugsbunny » 2009-06-13 15:05

I must have keyed something in wrong when I tested the apt-get version. aptitude is still the better choice though :) The dpkg method I knew about (and was going to add a post but OP had already said thanks).

Avoiding cat - yeah - my bad.
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: apt-get install list of programs.

Postby BioTube » 2009-06-13 15:48

Telemachus wrote:
Soul Singin' wrote:You will have to pry apt-get from my cold, dead hands.
.

So I've heard. Out of curiosity, why? That is, why do you prefer it so much? Not flaming, simply curious. (I can say that I started using aptitude back when I was an Ubuntu-newbie, after I learned that it automatically cleans up packages that were installed only as dependencies of etc.)
apt-get can surgically remove packages.
Image
Ludwig von Mises wrote:The elite should be supreme by virtue of persuasion, not by the assistance of firing squads.
User avatar
BioTube
 
Posts: 7551
Joined: 2007-06-01 04:34

Re: apt-get install list of programs.

Postby Soul Singin' » 2009-06-13 15:55

Telemachus wrote:
Soul Singin' wrote:You will have to pry apt-get from my cold, dead hands.

So I've heard. Out of curiosity, why?

I don't know. Habit? My fingers type apt-get or apt-cache.

Or maybe it's because I just bought a new T-shirt:
debian-tee_0.jpg
debian-tee_0.jpg (21.45 KiB) Viewed 12360 times

.
User avatar
Soul Singin'
 
Posts: 1466
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

Postby bugsbunny » 2009-06-13 15:56

so can aptitude (surgically remove packages). There's nothing apt-get can do that aptitude can't. At least not that I've found so far. Although in some cases I may prefer another tool, and for surgical removal I'd usually use dpkg
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: apt-get install list of programs.

Postby Soul Singin' » 2009-06-13 16:14

bugsbunny wrote:There's nothing apt-get can do that aptitude can't.

And it's also true that aptitude can do some things that apt-get cannot. But is the advantage really that large?

In my case, I have a pair of desktops that run Debian Stable. Almost all of the packages that I will ever need are already installed on them, but there may be a few things that I will want to install at some point in the future. What advantage does aptitude have over apt-get on such a system?

My case is obviously extreme, so it would be really great if you could provide a clear example of a case in which the difference between aptitude and apt-get really does matter.
.
User avatar
Soul Singin'
 
Posts: 1466
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

Postby bugsbunny » 2009-06-13 16:32

There aren't that many. And for a situation like yours there's no practical difference (I don't think). I don't hate apt-get, it's a real program. As opposed to that children's toy known as synaptic :)

For most usage apt-get and aptitude are interchangeable. This is especially true if you're running a stable system. However, even on a stable system, when updates get complicated (as in a dist upgrade) you're still better off using aptitude. Dependency resolution and handling is better in aptitude.

For the same reason I'd argue that if you're running mixed systems you're better off running aptitude, although you still need to know what you're doing and have other pieces setup correctly. But for a mixed system aptitude just makes things easier at times. And at other times it really doesn't matter which tool you use.

Whichever one you use I think you should at least be familiar with the basics of the others.

But you can manage a system successfully with either one (if you know what you're doing). My real problem comes with those people (see sidux developers) that run around yelling aptitude is broken don't use it or you'll eventually break your system just because you use aptitude. To that I say - BS.
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: apt-get install list of programs.

Postby Soul Singin' » 2009-06-13 17:16

bugsbunny wrote:As opposed to that children's toy known as synaptic :)

rickh ??? Is that you ???

rickh wrote:My position is well known ... All GUI package managers (including Synaptic) are worthless and unnecessary fat for your well designed Debian system. If you just want a free (as in beer) Windows OS, GUI installers are fine; otherwise, do it right ... learn aptitude, or at least apt-get
rickh wrote:Keep the "tools" ... get rid of the "toys".
.
User avatar
Soul Singin'
 
Posts: 1466
Joined: 2008-12-21 07:02

Next

Return to Installation

Who is online

Users browsing this forum: DEW and 9 guests

fashionable