Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

apt-get install list of programs.

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
Piter_
Posts: 208
Joined: 2006-05-30 14:23

apt-get install list of programs.

#1 Post by Piter_ »

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.

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: apt-get install list of programs.

#2 Post by bugsbunny »

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.

Piter_
Posts: 208
Joined: 2006-05-30 14:23

Re: apt-get install list of programs.

#3 Post by Piter_ »

Thanks
Joybook A52 laptop. Debian stable.

User avatar
Telemachus
Posts: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

Re: apt-get install list of programs.

#4 Post by Telemachus »

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
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

#5 Post by Soul Singin' »

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
Telemachus
Posts: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

Re: apt-get install list of programs.

#6 Post by Telemachus »

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: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

Re: apt-get install list of programs.

#8 Post by Telemachus »

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
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: apt-get install list of programs.

#9 Post by bugsbunny »

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
BioTube
Posts: 7520
Joined: 2007-06-01 04:34

Re: apt-get install list of programs.

#10 Post by BioTube »

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
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

#11 Post by Soul Singin' »

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 22398 times
.

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: apt-get install list of programs.

#12 Post by bugsbunny »

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
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

#13 Post by Soul Singin' »

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
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: apt-get install list of programs.

#14 Post by bugsbunny »

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
Soul Singin'
Posts: 1605
Joined: 2008-12-21 07:02

Re: apt-get install list of programs.

#15 Post by Soul Singin' »

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".
.

anticapitalista
Posts: 428
Joined: 2007-12-14 23:16
Has thanked: 12 times
Been thanked: 13 times

Re: apt-get install list of programs.

#16 Post by anticapitalista »

...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.
To you I say -BS because sidux devs do not run around yelling aptitude is broken. They do say that sidux users should use apt-get to get sidux support.
antiX with runit - lean and mean.
https://antixlinux.com

User avatar
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: apt-get install list of programs.

#17 Post by bugsbunny »

Unfortunately I'm not rick. I'm not cranky enough (yet). But I liked rick, and agreed with him about aptitude (and a lot of other things as well). Consider it a tribute to him. The statement was made with rick in mind.

User avatar
Telemachus
Posts: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

Re: apt-get install list of programs.

#18 Post by Telemachus »

anticapitalista wrote:
...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.
To you I say -BS because sidux devs do not run around yelling aptitude is broken. They do say that sidux users should use apt-get to get sidux support.
Well, ok, but let's dig a little deeper. They say "No soup for you" if you use aptitude for a reason, right? They seem to think that aptitude does significantly less well than apt-get for dealing with Sid. I've never seen any evidence that that's true. In any case, they may not say aptitude is broken, but they certainly say that it's not as good as aptitude for Sid.
Sidux manual wrote: The Reasons NOT to use anything else but apt-get for a dist-upgrade

Package managers like adept, aptitude, synaptic and kpackage are not always able to account for the huge amount of changes which happen in Sid (depedency changes, name changes, maintainer script changes, ...). That's not the fault of the developers of those tools though, they write a excellent tools and fabulous for the debian stable branch, they are simply just not suitable for the very special needs of Debian Sid.

Use whatever you like to search for packages, but stick with apt-get for actually installing/removing/dist-upgrading

Package managers like adept, aptitude, synaptic and kpackage are at the least, non-deterministic (for complex package selection), mix that with a quickly moving target like sid and even worse an external repository of questionable quality (we don't use or recommend those, but they're a reality on your user systems) and you will be courting disaster. The other item to note is that all of these types of GUI package managers need to run in init 5, and/or, in X, and in doing a dist-upgrade in init 5 and/or X , (or even an 'upgrade' which is not recommended), you will end up damaging up your system beyond repair, maybe not today or tomorrow, in time you will.

apt-get on the other hand strictly does what it is asked to do, if there is any breakage you can pinpoint and debug/ fix the cause, if apt-get wants to remove half of the system (due to library transitions) it's the admin's call (that means you) to have at least a serious look.

This is the reason why debian builds use apt-get, not the other package manager tools.
There's lots to talk about here - aptitude is a GUI package manager? It needs to run in init 5? Doing dist-upgrades or upgrades in X will damage your system beyond repair (maybe not today or tomorrow, but it will)?

For me, though, the real problem with Sidux is the whole approach: Do it our way or we'll rap your knuckles.
Last edited by Telemachus on 2009-06-14 02:22, edited 3 times in total.
"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
bugsbunny
Posts: 5354
Joined: 2008-07-06 17:04
Been thanked: 1 time

Re: apt-get install list of programs.

#19 Post by bugsbunny »

anticapitalista wrote:
...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.
To you I say -BS because sidux devs do not run around yelling aptitude is broken. They do say that sidux users should use apt-get to get sidux support.
And they say that because they claim (wrongly) that apt handles sid better etc etc. Start here and follow all the links (and the links inside of links).
http://sidux.com/PNphpBB2-viewtopic-t-5768.html

Basically they say they won't support aptitude because in their (wrong) opinion aptitude is broken and does things wrong.

User avatar
Telemachus
Posts: 4574
Joined: 2006-12-25 15:53
Been thanked: 2 times

Re: apt-get install list of programs.

#20 Post by Telemachus »

I have to go one more round on this. After a minute or two browsing the links and links of links that Bugsbunny posted (first hit on Google for "sidux aptitude"), I find this from our very own Craigevil:
Craigevil wrote:Personally i have only tried using aptitude once and that was back when the last big KDE upgrade hit.

Aptitude wanted to remove a ton of packages, while APT was smart enough to just hold the effected packages back.
We all know exactly what we are seeing here: the metapackage problem. So, in a nutshell, his reason for not using aptitude is that it works exactly as it says it will, right there in the manual.

As for the Sidux devs, what you will find is variation after variation of this (in the initial bit, he's mocking someone who has pointed out that aptitude cleans up & removes dependencies of packages it removes):
Slam wrote:Wow! - a wow!-application in Linux! That's so - wow! - fantastic innovative, I can't really believe it! An application I don't just might use, but even love!

Official answer: This tool is very much depreciated in sidux because it's not designed to handle the complex situations in Debian Sid. Don't use it, we will not support it and any problems you might later on run into because you insisted to use it.

It might have it's place in stabilized repositories (Debian Stable, Ubuntu), however.
Notice that there is exactly zero explanation or argument here. Simply a statement that aptitude is not up to the task of Sid (by design, apparently), and a not very implicit threat that you will have your club membership revoked if you use the wrong fork. Utter bullshit.

Let me repeat that apt-get is outstanding. If you like it, use it and enjoy. But these are pitiful, pitiful reasons not to use aptitude from people who apparently don't know the first thing about how it works.
"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

Post Reply