Posts: 30
hesedyahu
Joined: 21 Apr 2014
#1
Hi all,

I've been using synaptic to install or add applications. When it installs these applications, it looks for needed libraries to add. But when I decide to uninstall these applications, even if I asked to have it complete removed using synaptic, it only removes that singular application but not the libraries that we installed as well.

How do you do a total reversal of what synaptic does when it installs an application, i.e., just as synaptic will install a program with associated applications and libraries, it will remove the program and the associated libraries that came with it.

Thanks
Posts: 850
fatmac
Joined: 26 Jul 2012
#2
I don't use synaptic, but apt, which is used by synaptic, & to get rid of all of a program, use purge.

So, using apt-get autoremove after apt-get purge <pkgname>, should do what you want

SYNOPSIS
apt-get [-asqdyfmubV] [-o=config_string] [-c=config_file]
[-t=target_release] [-a=architecture] {update | upgrade |
dselect-upgrade | dist-upgrade |
install pkg [{=pkg_version_number | /target_release}]... |
remove pkg... | purge pkg... |
source pkg [{=pkg_version_number | /target_release}]... |
build-dep pkg [{=pkg_version_number | /target_release}]... |
download pkg [{=pkg_version_number | /target_release}]... |
check | clean | autoclean | autoremove | {-v | --version} |
{-h | --help}}


autoremove
autoremove is used to remove packages that were automatically
installed to satisfy dependencies for other packages and are now no
longer needed.
Posts: 30
hesedyahu
Joined: 21 Apr 2014
#3
Thanks for that great answer. It's prompts me to ask a separate question so I'll put that on a new thread.
Posts: 30
hesedyahu
Joined: 21 Apr 2014
#4
Reading that again, I realise I have absolutely no idea how to actually do what you're suggesting. i look at what you've typed and I don't know how to make that practical, how to actually use it. Is it possible that you could give an example of using the commands you stated.

Right now, I'm wanting to get rid of Citrix Receiver which I installed using GDebi using a .deb file from
========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://www.citrix.com"
linktext was:"www.citrix.com"
====================================
. I don't know what the package name is, meaning that I've tried using all sorts of commands in Terminal to open it but I don't know the right now. Typing"Citrix Receiver" doesn't work. Typing icaclient doesn't work.
So I'm still at a loss.
Posts: 850
fatmac
Joined: 26 Jul 2012
#5
In a terminal try

Code: Select all

sudo apt-cache search receiver
to see if you can find it (Citrix Receiver).
If found, use

Code: Select all

sudo apt-get purge receiver
Followed by

Code: Select all

sudo apt-get autoremove
Hopefully that should do it.
Posts: 325
male
Joined: 04 Nov 2011
#6
the search command is imprecise and involves the risk that system then with"purge" to destroy!
Example:

Code: Select all

$ apt-cache search leafpad
leafpad - Auf GTK+ basierender einfacher Text-Editor
mousepad - Einfacher Xfce angepasster Texteditor
lxde - LXDE metapackage
therefore use"policy"

Code: Select all

$ apt-cache policy leafpad
leafpad:
  Installiert:           0.8.18.1-4
  Installationskandidat: 0.8.18.1-4
  Versionstabelle:
 *** 0.8.18.1-4 0
        500 http://ftp.de.debian.org/debian/ testing/main i386 Packages
        100 /var/lib/dpkg/status
with"remove" the installations files remain for future refurbishment obtained and can be used immediately

Code: Select all

# apt-get remove leafpad
"purge" removes all

Code: Select all

# apt-get purge leafpad

========= SCRAPER REMOVED AN EMBEDDED LINK HERE ===========
url was:"http://manual.siduction.org/sys-admin-apt#apt-delete"
linktext was:"http://manual.siduction.org/sys-admin-apt#apt-delete"
====================================
Posts: 850
fatmac
Joined: 26 Jul 2012
#7
Basically my 'apt-cache search' was to see if that is what the program is actually called, (before using apt-get on it). Maybe using 'policy' is better.
Posts: 30
hesedyahu
Joined: 21 Apr 2014
#8
Hi fatmac,

Firstly, thank you for the excellent clarification. It totally cleaned out the useless installations I had.

Secondly, thank you for including the link to more terminal commands. That helps my tuition in this new world of Linux.

You're very helpful. Thank you.
Posts: 30
hesedyahu
Joined: 21 Apr 2014
#9
Hi again. Just to let you know, the process didn't work. I installed evince which included many other libraries. When I then used the above process to get rid of evince with all the additional libraries and packages it installed, it only got rid of the main program,"evince", and not the other additional libraries.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#10
Surely purge"worked", it just did not work as you had expected.
To check what remainders are eligible for cleanup... use google search, read about using"deborphan" and /or"gtkorphan".
Posts: 30
hesedyahu
Joined: 21 Apr 2014
#11
You said that much better than me, skidoo. Coming from windows, I hope you'll accept a little lazy thinking on my part. I hope my response before wasn't insulting. If it was, sorry. I'll check out that deborphan.
Posts: 667
jdmeaux1952
Joined: 01 Nov 2013
#12
Lazy man's way:

In Synaptic, choose your program, right-click, and select Mark for Complete removal. That should remove the program and dependencies, I think. If not, you can go into Terminal as SU and

Code: Select all

apt-get autoremove
and this should remove orphaned dependencies. i think.
Posts: 1,445
skidoo
Joined: 09 Feb 2012
#13
hesedyahu, I too am a daily WinXP user.
I advised"read about" because we dare not remove every package suggested by deborphan.
It basically just scans the dpkg database and outputs a list of packages which are not shown as a dependency of anything currently installed
(so, it'll likely suggest removing fonts packages, etc. which you'd probably wish to keep)
Similarly, within synaptic, we can filter to view Status-}"manually installed and obsolete" but we dare not remove everything listed in that filtered view.

If you perfomed the citrix__receiver install via synaptic, a transaction log should exist.
Check the /root/.synaptic directory. IIRC that's where the logfiles (one for each synaptic session) are written.
The point of referring to these logs: along with the citrix install transaction, you'll find a play-by-play record of the other packages which were installed (pulled in as dependencies) along with it.

apt-get autoremove
is a bit less brutal than removing everything suggested by deborphan
but (here, in the case of citrix_receiver) it's not perfect.

evince.
Ouch. Undoing all the changed (installed, updated) packages related to its install might be quite a PITA.
I might be tempted to start over, from scratch, rather than wrestling with that chore.
Posts: 1,062
Dave
Joined: 20 Jan 2010
#14
You can look at /var/log/apt/apt-history.log (I think that is the name) to see what was installed at that instant. You can then select and copy the list and paste it after apt-get purge to purge all the packages that where installed.