Sunday, 8 February 2015

Learning APT: Orphans and Autoremove topic






I just did a fresh install of Xubuntu 14.04 on VirtualBox. I'm well experienced in Linux but I mostly use Arch Linux (which is hosting my Xubuntu VM.) Anyway I'm trying to get more familiar with APT. I know the basics of how to install, uninstall, search, and a little bit of dpkg but I'm a little stumped at how APT handles orphans. To test this I installed synaptic. Looking back at /var/log/apt/history.log:


Code:


Start-Date: 2015-02-08  00:46:20
Commandline: apt-get install synaptic
Install: libept1.4.12:amd64 (1.0.12, automatic), rarian-compat:amd64 (0.8.1-5ubuntu1, automatic), sgml-data:amd64 (2.0.9-1, automatic), docbook-xml:amd64 (4.5-7.2, automatic), librarian0:amd64 (0.8.1-5ubuntu1, automatic), synaptic:amd64 (0.81.1ubuntu1)
End-Date: 2015-02-08  00:46:33


OK so far so good. It installed synaptic and marked its dependencies as "automatic." Now to test out removing it.


Code:


Start-Date: 2015-02-08  05:11:09
Commandline: apt-get purge synaptic
Purge: synaptic:amd64 (0.81.1ubuntu1)
End-Date: 2015-02-08  05:11:11


After I did that APT was prompting me that it had un-needed packages I could remove with apt-get autoremove so I do.


Code:


Start-Date: 2015-02-08  05:13:13
Commandline: apt-get autoremove --purge
Purge: libept1.4.12:amd64 (1.0.12)
End-Date: 2015-02-08  05:13:14


But it only removed the very first dependency and left the others in place. In between the Install and remove I only did one other APT transaction which updated three totally unrelated packages. I didn't install anything else that would have depended on those packages that synaptic required.


Code:


Start-Date: 2015-02-08  04:48:59
Commandline: apt-get upgrade
Upgrade: mugshot:amd64 (0.2.3-1, 0.2.5-0ubuntu0.1), xfdesktop4-data:amd64 (4.11.6-1ubuntu1, 4.11.8-0ubuntu0.1), xfdesktop4:amd64 (4.11.6-1ubuntu1, 4.11.8-0ubuntu0.1)
End-Date: 2015-02-08  04:49:06


So yea this is my first stumping block in trying to learn APT. In Arch and its package manager Pacman, every package is either "Explicity Installed" or "Installed as a dependency" and a standard query will tell you which it is. If a package was installed as a dependency but is no longer required by anything it's listed as an orphan (there is no autoremove function in Pacman but there is a command to list all orphans and then uninstall from that list.) Is that at all similar to how APT handles this?






No comments:

Post a Comment