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

 

 

 

Debian package management #2

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
sahko
Posts: 8
Joined: 2011-02-11 08:20

Debian package management #2

#1 Post by sahko »

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?

smallchange
Posts: 1740
Joined: 2009-05-04 15:56
Been thanked: 1 time

Re: Debian package management #2

#2 Post by smallchange »

aptitude purge bar

sahko
Posts: 8
Joined: 2011-02-11 08:20

Re: Debian package management #2

#3 Post by sahko »

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.

oOarthurOo
Posts: 544
Joined: 2008-10-25 12:00
Location: Canada

Re: Debian package management #2

#4 Post by oOarthurOo »

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.

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

Re: Debian package management #2

#5 Post by bugsbunny »

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
edbarx
Posts: 5401
Joined: 2007-07-18 06:19
Location: 35° 50 N, 14 º 35 E
Been thanked: 2 times

Re: Debian package management #2

#6 Post by edbarx »

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.
Debian == { > 30, 000 packages }; Debian != systemd
The worst infection of all, is a false sense of security!
It is hard to get away from CLI tools.

User avatar
llivv
Posts: 5340
Joined: 2007-02-14 18:10
Location: cold storage

Re: Debian package management #2

#7 Post by llivv »

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? ... 02#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 memory of Ian Ashley Murdock (1973 - 2015) founder of the Debian project.

sahko
Posts: 8
Joined: 2011-02-11 08:20

Re: Debian package management #2

#8 Post by sahko »

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.

emariz
Posts: 2901
Joined: 2008-10-17 07:59

Re: Debian package management #2

#9 Post by emariz »

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.

User avatar
craigevil
Posts: 5391
Joined: 2006-09-17 03:17
Location: heaven
Has thanked: 28 times
Been thanked: 39 times

Re: Debian package management #2

#10 Post by craigevil »

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";
Raspberry PI 400 Distro: Raspberry Pi OS Base: Debian Sid Kernel: 5.15.69-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"
My Giant Sources.list

Post Reply