LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 05-03-2006, 06:15 PM   #1
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Rep: Reputation: 48
isntalling suggested and Recommended packages with apt-get


Hi,

I have 3 questions related to Debian package Management system

Q1:
I know that whenever you install packages with apt-get it also automatically installs packages which are marked as *Depends*. Now is there any way we can tell apt-get to install packages which are also marked as *Suggests*, *Recommends* along with *depends*?

Q2: I have been reading a lot these days that aptitude it the preferred method to install packages through the APT system. I am so used to apt-get that I really don;t want to give up using apt-get. I really LIKE apt-get. But from the technical viewpoint should I shift myself to aptitude?


Q3: I generally remove package with the following command:
dpkg --purge <package-name>
So now the above commands fails if I am trying to purge a package which has certain dependencies. So I have to explicity include the name of the package which are depenedent on the package that I am trying to remove like this:
dpkg --purge <package-name> <dependent-package-name(s)?
Is there any way dpkg can do purge the a package and it's dependencies automatically just like apt-get install package and its depenedencies automatically?

Thanks

Help will be much appreciated.
 
Old 05-03-2006, 06:19 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
1) I can't recall how to do this, but I think if you read the man page for apt-get it may become clearer. I'm almost positive it can be done... aptitude install --with-recommends package-name seems to work...

2) You can use aptitude just like apt-get from the command line (i.e. aptitude install package-name)

3) Generally, I think you'll have better luck removing packages if you use apt-get remove --purge package-name or aptitude purge package-name, which I believe removes dependencies as well. Again, man apt-get may give you more insight.

Last edited by pljvaldez; 05-03-2006 at 06:27 PM.
 
Old 05-03-2006, 06:47 PM   #3
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Unhappy

Quote:
Originally Posted by pljvaldez
1) I can't recall how to do this, but I think if you read the man page for apt-get it may become clearer. I'm almost positive it can be done... aptitude install --with-recommends package-name seems to work...

2) You can use aptitude just like apt-get from the command line (i.e. aptitude install package-name)

3) Generally, I think you'll have better luck removing packages if you use apt-get remove --purge package-name or aptitude purge package-name, which I believe removes dependencies as well. Again, man apt-get may give you more insight.
Thanks for looking into this.

In regards to the second question, I tried to use aptitude and to my surprise it gave me different result then apt-get. For example I tried to install package 'tcpspy' with apt-get and aptitude and this is what i get:

With apt-get
Code:
root@debian:~# apt-get install tcpspy
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  tcpspy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.0kB of archives.
After unpacking 160kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  tcpspy
Install these packages without verification [y/N]?
whereas with aptitude I get:
Code:
root@debian:~# aptitude install tcpspy
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done
Building tag database... Done
The following packages are unused and will be REMOVED:
  lib64gcc1 openoffice.org
The following NEW packages will be installed:
  tcpspy
0 packages upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 37.0kB of archives. After unpacking 115kB will be freed.
Do you want to continue? [Y/n/?]
Now why aptitude wants to remove the package openoffice.org and lib64gcc1 while apt-get does not??


EDIT: The answer for the first question is /etc/apt/apt.conf file. man apt-get did not had anything.

Last edited by kushalkoolwal; 05-03-2006 at 06:53 PM.
 
Old 05-04-2006, 12:01 PM   #4
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by kushalkoolwal
Thanks for looking into this.

In regards to the second question, I tried to use aptitude and to my surprise it gave me different result then apt-get. For example I tried to install package 'tcpspy' with apt-get and aptitude and this is what i get:

With apt-get
Code:
root@debian:~# apt-get install tcpspy
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed:
  tcpspy
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 37.0kB of archives.
After unpacking 160kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  tcpspy
Install these packages without verification [y/N]?
whereas with aptitude I get:
Code:
root@debian:~# aptitude install tcpspy
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Writing extended state information... Done
Reading task descriptions... Done
Building tag database... Done
The following packages are unused and will be REMOVED:
  lib64gcc1 openoffice.org
The following NEW packages will be installed:
  tcpspy
0 packages upgraded, 1 newly installed, 2 to remove and 0 not upgraded.
Need to get 37.0kB of archives. After unpacking 115kB will be freed.
Do you want to continue? [Y/n/?]
Now why aptitude wants to remove the package openoffice.org and lib64gcc1 while apt-get does not??


EDIT: The answer for the first question is /etc/apt/apt.conf file. man apt-get did not had anything.

Does Anyone has an answer?

 
Old 05-04-2006, 02:06 PM   #5
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
openoffice.org is a meta package. You can safely remove it. Look at the output it gave you:

Code:
After unpacking 115kB will be freed.
There you have it, openoffice.org weights a lot more.
 
Old 05-04-2006, 02:43 PM   #6
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by yanik
openoffice.org is a meta package. You can safely remove it. Look at the output it gave you:

Code:
After unpacking 115kB will be freed.
There you have it, openoffice.org weights a lot more.
yanik I understand what you are saying, but my question still remains is that why apt-get and aptitude are giving different results? Or is it because openoffice.org is a meta package and aptitude removes meta package?
 
Old 05-04-2006, 03:12 PM   #7
yanik
Member
 
Registered: Oct 2003
Location: Montreal Beach
Distribution: Debian Unstable
Posts: 368

Rep: Reputation: 30
I couldn't say. I'd like to know too. aptitude is supposed to be better than apt-get. Here's the part on aptitude in the debian reference guide:

Code:
6.2.3 aptitude

aptitude is a new menu-driven package installer similar to dselect but built from scratch on top of APT. It can be used as an alternative to apt-get for most commands. See aptitude(1) and /usr/share/doc/aptitude/README.

Once you start using aptitude it is best to continue using it rather than alternative methods of installing packages; otherwise you lose the advantage of aptitude keeping track of which packages you have deliberately installed.

aptitude in full screen mode accepts single-key commands which are usually lowercase. Notable key strokes are:

     Keystroke   Action
     F10         Menu
     ?           Help for keystroke (complete listing)
     u           Update package archive information
     +           Mark the package to be upgraded or newly installed
     -           Mark the package to be removed (keep config)
     _           Mark the package to be purged (remove config)
     =           Place the package on hold
     U           Mark all upgradable packages to be upgraded
     g           Download and install selected packages
     q           Quit current screen and save changes
     x           Quit current screen and discard changes
     Enter       View information about a package
     C           View a package's changelog
     l           Change the limit for the displayed packages
     /           Search for the first match
     \           Repeat the last search

Like apt-get, aptitude installs packages upon which a selected package Depends. aptitude also offers the option to pull in packages that a to-be-installed package Recommends or Suggests. You can change the default behavior by choosing F10 -> Options -> Dependency handling in its menu.

Other advantages of aptitude are:

    * aptitude offers access to all versions of a package.
    * aptitude logs its actions in /var/log/aptitude.
    * aptitude makes it easy to keep track of obsolete software by listing under "Obsolete and Locally Created Packages".
    * aptitude includes a fairly powerful system for searching particular packages and limiting the package display. Users familiar with mutt will pick up quickly, as mutt was the inspiration for the expression syntax. See "SEARCHING, LIMITING, AND EXPRESSIONS" in /usr/share/doc/aptitude/README.
    * aptitude in full screen mode has su functionality embedded and can be run from normal user until you really need administrative privileges.

I really like the logging feature. I'll be reinstalling soon (gotta make room for freebsd 6.1) and I'll stick with aptitude this time and see how it goes.

Yanik
 
Old 05-04-2006, 06:10 PM   #8
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by yanik
I couldn't say. I'd like to know too. aptitude is supposed to be better than apt-get. Here's the part on aptitude in the debian reference guide:

Code:
6.2.3 aptitude

aptitude is a new menu-driven package installer similar to dselect but built from scratch on top of APT. It can be used as an alternative to apt-get for most commands. See aptitude(1) and /usr/share/doc/aptitude/README.

Once you start using aptitude it is best to continue using it rather than alternative methods of installing packages; otherwise you lose the advantage of aptitude keeping track of which packages you have deliberately installed.

aptitude in full screen mode accepts single-key commands which are usually lowercase. Notable key strokes are:

     Keystroke   Action
     F10         Menu
     ?           Help for keystroke (complete listing)
     u           Update package archive information
     +           Mark the package to be upgraded or newly installed
     -           Mark the package to be removed (keep config)
     _           Mark the package to be purged (remove config)
     =           Place the package on hold
     U           Mark all upgradable packages to be upgraded
     g           Download and install selected packages
     q           Quit current screen and save changes
     x           Quit current screen and discard changes
     Enter       View information about a package
     C           View a package's changelog
     l           Change the limit for the displayed packages
     /           Search for the first match
     \           Repeat the last search

Like apt-get, aptitude installs packages upon which a selected package Depends. aptitude also offers the option to pull in packages that a to-be-installed package Recommends or Suggests. You can change the default behavior by choosing F10 -> Options -> Dependency handling in its menu.

Other advantages of aptitude are:

    * aptitude offers access to all versions of a package.
    * aptitude logs its actions in /var/log/aptitude.
    * aptitude makes it easy to keep track of obsolete software by listing under "Obsolete and Locally Created Packages".
    * aptitude includes a fairly powerful system for searching particular packages and limiting the package display. Users familiar with mutt will pick up quickly, as mutt was the inspiration for the expression syntax. See "SEARCHING, LIMITING, AND EXPRESSIONS" in /usr/share/doc/aptitude/README.
    * aptitude in full screen mode has su functionality embedded and can be run from normal user until you really need administrative privileges.

I really like the logging feature. I'll be reinstalling soon (gotta make room for freebsd 6.1) and I'll stick with aptitude this time and see how it goes.

Yanik

Thanks for reply yanik agian. Good to know that I am not the only one who is curious to know about this. Does anyone had a similar experience with apt-get and aptitude?
 
Old 05-05-2006, 03:27 AM   #9
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Quote:
Now why aptitude wants to remove the package openoffice.org and lib64gcc1 while apt-get does not??
Well, my understanding is that aptitude always tries to remove any packages that are not explicitly told to be installed and that are not used by other packages anymore. This is a feature in aptitude and apt-get doesn't have a similar feature. Aptitude tries to help you to keep a cleaner system.

However, aptitude has no way of knowing what you've asked some other APT frontend (like apt-get or synaptic) to install, so aptitude sees that lib64gcc1 and openoffice.org (the meta-package) are no longer needed by any other package and so it thinks that these packages can now be removed.

If aptitude wants to remove a package that you want to keep, you can explicitly tell aptitude that you don't want this package to be removed. Aptitude will remember what you've told it and it won't try to remove a package that you've told it to keep.

I usually use the ncurses interface of aptitude and there it's just a matter of moving the highlighted cursor on the package name that's marked to be removed and pressing the "+" key. I assume that you can get the same effect from the command line by simply telling aptitude to install the packages you want to keep. If I'm correct, "aptitude install lib64gcc1 openoffice.org" should make aptitude remember that you've explicitly asked it to keep these packages.
 
Old 05-05-2006, 06:12 AM   #10
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
Quote:
Originally Posted by kushalkoolwal
yanik I understand what you are saying, but my question still remains is that why apt-get and aptitude are giving different results? Or is it because openoffice.org is a meta package and aptitude removes meta package?
Because as said aptitude also wants to remove useless packages so it does 2 actions in a row.
This should remove the behaviour:
Code:
Aptitude::Autoclean-After-Update to false in your ~/.aptitude/config
AFAIK aptitude and apt-get use a different database and different conflict resolution mechanism.
/var/lib/aptitude/ keeps track for aptitude
/var/lib/dpkg/ keeps track for dpkg/apt

It has always been adviced to not mix both, I don't know if its still relevant (I haven't had problems mixing both) and for aptitude, the ncurses was prefered (I see no difference at this time..).
 
Old 05-05-2006, 09:55 AM   #11
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
~/.aptitude/config is only read if you start aptitude as a normal user. But if you first "su" to become root before starting aptitude, then the file to edit is /root/.aptitude/config.

I have used aptitude with apt-get without any problems. However, if you switch from synaptic to aptitude (or vice versa), then you might be in for some surprises because aptitude and synaptic cannot read each other's configurations.
 
Old 05-05-2006, 04:02 PM   #12
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Thank you nx5000 and Dead Parrot. It is nice to see inputs from experienced people like you all.

So if I want to swtich from apt-get to aptitude on my existing system do I have to do anything special before I can start using aptitude?

Thanks once again.
 
Old 05-05-2006, 04:08 PM   #13
kushalkoolwal
Senior Member
 
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by nx5000
AFAIK aptitude and apt-get use a different database and different conflict resolution mechanism.
/var/lib/aptitude/ keeps track for aptitude
/var/lib/dpkg/ keeps track for dpkg/apt
I just noticed that the debian doc says that following:
http://www.nl.debian.org/doc/manuals...ackage.en.html
Code:
APT uses /var/lib/apt/lists/* for tracking available packages
while dpkg uses /var/lib/dpkg/available. 
If you have installed packages using aptitude or other APT front ends and you want to use dselect to install packages then the first thing you should do is update /var/lib/dpkg/available by selecting [U]pdate from dselect's menu (or by running "dselect update").
so I guess apt-get must also be using /var/lib/apt/lists/* instead of /var/lib/dpkg/.


What do you guys think regarding this?

Note: Here I mean two different things when I say APT and apt-get.
 
Old 05-05-2006, 04:44 PM   #14
Dead Parrot
Senior Member
 
Registered: Mar 2004
Distribution: Debian GNU/kFreeBSD
Posts: 1,597

Rep: Reputation: 46
Quote:
So if I want to swtich from apt-get to aptitude on my existing system do I have to do anything special before I can start using aptitude?
No special adjustments are needed. Just take some time to view the configuration options in the ncurses interface to aptitude the first time you use it. After that, these settings will always apply regardless if you use the ncurses or the command line interface to aptitude.

I use mostly aptitude but apt-get can do some things that aptitude cannot, like "apt-get build-dep <package_name>" will install the necessary dependencies if you want to build your own binary packages from source .deb packages. And the good old dpkg can also become useful every now and then when you need to install individual packages.
 
Old 05-08-2006, 01:48 PM   #15
JackieBrown
Member
 
Registered: Dec 2004
Location: San Antonio, TX
Distribution: Debian-AMD64 Sid
Posts: 481

Rep: Reputation: 31
If you choose no it usually makes alternative suggestions
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure apt-get to install suggested packages? davidas Debian 20 02-25-2013 12:59 AM
using apt to install recommended packages? MaTrIx709 Linux - Software 2 08-12-2005 01:04 AM
Is there a parameter for apt-get to install all recommended / suggested packages? Akhran Debian 5 08-08-2005 02:42 AM
Apt-get with suggested packages shaggy007 Debian 6 09-21-2004 08:33 AM
Superkaramba - Recommended packages? HCLogo Linux - Software 2 05-05-2004 10:24 AM


All times are GMT -5. The time now is 11:05 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration