Debian package management #2

If none of the more specific forums is the right place to ask

Debian package management #2

Postby sahko » 2011-02-20 02:35

Here is another situation i ran into after this one

I installed a package foo1 skipping its recommended dependency bar cause i didnt need it. At some later point i installed another package foo2 which depended directly on bar. Then i removed foo2.
Aptitude didnt remove bar cause it thinks its installed for foo1. I think its a left behind dependency of foo2.
How do i change APT's mind?
sahko
 
Posts: 8
Joined: 2011-02-11 08:20

Re: Debian package management #2

Postby smallchange » 2011-02-20 02:39

aptitude purge bar
smallchange
 
Posts: 1740
Joined: 2009-05-04 15:56

Re: Debian package management #2

Postby sahko » 2011-02-20 05:25

smallchange wrote:aptitude purge bar


Thats not what i had in mind. Keeping track of those packages is APT's/DPKG's job not mine.
sahko
 
Posts: 8
Joined: 2011-02-11 08:20

Re: Debian package management #2

Postby oOarthurOo » 2011-02-20 05:33

Rapheal Hertzog is doing a series of very interesting posts on this subject.

http://raphaelhertzog.com/2011/01/31/de ... ion-files/

http://raphaelhertzog.com/2011/02/07/de ... -packages/

You're obviously quite interested in learning about apt, which is great, I know I didn't have the same patience for yum and rpm packages which don't seem to have different levels of dependency, like depends recommends and suggests. Aside from the series above, the apt and aptitude man pages are a small course in an of themselves. It will take a while to understand it all and it can't be explained in a single post or even in a single thread. But I hope you'll keep at it and share what you learn with others.

And to answer your question somewhat, apt has kept track of it, it's just not sure what you want to do with it. On the other thread I think it's already been explained how to tell apt what you want to do with it.
oOarthurOo
 
Posts: 545
Joined: 2008-10-25 12:00
Location: Canada

Re: Debian package management #2

Postby bugsbunny » 2011-02-20 08:10

sahko wrote:
smallchange wrote:aptitude purge bar


Thats not what i had in mind. Keeping track of those packages is APT's/DPKG's job not mine.


OK. And apt(itude) et all ddid their job. You can change apt(itude) defaults so that it won't treat recommends as dependencies (at removal time), which would resolve this particular case for you. However, it would lead to complications in other situations.

Even though you don't install recommends by default, I'm sure that you do install them at times (if you haven't, you will). When you do you will probably want those treated as dependencies so that when you remove the parent package the recommends that you installed are also handled. The only other option is to always mark recommended packages as manually installed, which means that you would have to always manually uninstall them.

But, if you really want to go that way, /etc/apt/apt.conf (or the apt.conf.d directory)

Code: Select all
APT
{
  Install-Recommends "false";
  Install-Suggests "false";
  AutoRemove
        {
          SuggestsImportant "false";
          RecommendsImportant "false";
        };
};
User avatar
bugsbunny
 
Posts: 5355
Joined: 2008-07-06 17:04

Re: Debian package management #2

Postby edbarx » 2011-02-20 09:05

There is a local saying that goes something like this: a tradesman who blames his tools is not fit for the job. :wink:

Why on earth did you bother to come to Debian if you think its central feature is lagging behind what you used before?!

The secret of acquiring new skills and knowledge lie in Reading The Fabulous Manuals and Debian has lots of them.
Learning how to learn from the mistakes of others is far more efficient. It's also less painful. (dasein)
Debian = {freedom, reliability, stability, configurability, flexibility, security}
It's hard to get away from apt and the CLI tools!
User avatar
edbarx
 
Posts: 4554
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E

Re: Debian package management #2

Postby llivv » 2011-02-20 09:33

Now that you have read many suggestions in both threads ,
what are you expecting to get apt/aptitude to do for you?

http://forums.debian.net/viewtopic.php?f=10&t=60602#p353660
sahko wrote:Thanks for the detailed post. Your answer is enlightening and this is probably close or similar to what happened.
Although i havent used keep-all another command must've changed the flag.
The command that would purge the listed files
is aptitude install (without a package or with package(s)) either or...
in the kitchen with Julia ....
[...]
Get on the D bus to B Can ....
[...]
User avatar
llivv
 
Posts: 5582
Joined: 2007-02-14 18:10
Location: willo the tree

Re: Debian package management #2

Postby sahko » 2011-02-20 14:54

edbarx wrote:There is a local saying that goes something like this: a tradesman who blames his tools is not fit for the job. :wink:

Why on earth did you bother to come to Debian if you think its central feature is lagging behind what you used before?!


I didnt say that. In fact i said the exact opposite.

edbarx wrote:The secret of acquiring new skills and knowledge lie in Reading The Fabulous Manuals and Debian has lots of them.


Indeed, but when you're not used to having split packages for documentation neglecting to install them is really easy.
sahko
 
Posts: 8
Joined: 2011-02-11 08:20

Re: Debian package management #2

Postby emariz » 2011-02-20 18:25

From /usr/share/doc/aptitude/README, section "Managing automatically installed packages" and footnotes:
It works like this: when you install a package, aptitude will automatically install any other packages on which it depends. These packages are marked as having been ``automatically installed''; aptitude will monitor them and remove them when they are no longer depended upon by any manually installed package ^[10] . They will appear in the preview as ``packages being removed because they are no longer used.''

^[10] More precisely: they will be removed when there is no path via Depends, PreDepends, or Recommends to them from a manually installed package.


One could override that behaviour with the following preference in /etc/apt/apt.conf (as described in section "Available configuration options" of /usr/share/doc/aptitude/README):
Option: Apt::AutoRemove::RecommendsImportant
Default: true
Description: If this option is true, then aptitude will not consider packages to be unused (and thus will not automatically remove them) as long as any installed package recommends them, even if Apt::Install-Recommends is false. For more information, see the section called ``Managing automatically installed packages''.

Most likely, it will not be a viable solution because Aptitude will mark all installed recommendations for removal. An it makes sense; the algorithm knows that a package was installed as a recommendation but cannot tell which package marked it as such, thus it suffices that one installed package recommends it to cancel its auto removal. In such cases, one must check the installation logs to delete these unwanted packages.
emariz
 
Posts: 2641
Joined: 2008-10-17 07:59

Re: Debian package management #2

Postby craigevil » 2011-02-20 23:37

I run deborphan | xargs apt-get -y remove --purge a couple times a month or at least I did when I was running sid.

My apt.conf

$ cat /etc/apt/apt.conf
APT::Default-Release "stable";

// auto-remove breaks on meta packages
APT::Get::AutomaticRemove "0";
APT::Get::HideAutoRemove "1";

// Recommends are as of now still abused in many packages
APT::Install-Recommends "0";
APT::Install-Suggests "0";
Debug::pkgAutoRemove "0";

// PDiffs reduce the required download for apt-get update, but increase the
// CPU requirements and quite often fail.
// Acquire::PDiffs "0";
Debian Sid KDE Kernel 3.17 Thinkpad R40 Intel M 1.3 CPU 2GB RAM Radeon Mobility 7500
Debian - "If you can't apt-get something, it isn't useful or doesn't exist"
Debian upgrade script smxi | sysinfo script inxi
User avatar
craigevil
 
Posts: 5161
Joined: 2006-09-17 03:17
Location: Oz


Return to General Questions

Who is online

Users browsing this forum: No registered users and 16 guests

fashionable