LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-19-2017, 11:11 AM   #1
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 10
Post Remove a program completely.


Hello.
I'm using Debian 8.9 x64 and installed a program by "Synaptic" but when I remove it by "Synaptic" then dependencies not removed. For example, I installed "3cxpbx" and removed it but below dependencies are exist:
Code:
$ sudo apt-cache depends 3cxpbx
3cxpbx
  Depends: libc6
  Depends: libstdc++6
  Depends: postgresql
  Depends: nginx
    nginx-extras
    nginx-full
    nginx-light
  Depends: rsync
    rsync:i386
  Depends: libunwind8
  Depends: libcurl3
  Depends: libssl1.0.0
  Depends: sudo
    sudo-ldap
  Depends: libsystemd0
  Depends: psmisc
    psmisc:i386
  Depends: util-linux
    util-linux:i386
  Depends: libspandsp2
  Depends: unattended-upgrades
  Depends: dnsutils
    knot-dnsutils
  Depends: libgdiplus
  Depends: tcpdump
    tcpdump:i386
  Depends: virt-what
  Depends: libicu52
  Conflicts: libresiprocate-1.10
  Conflicts: libresiprocate-1.10:i386
  Conflicts: apache2
  Conflicts: apache2:i386
I know some of above dependencies are mandatory and used by other programs, But I never need "nginx".

Any idea?

Thank you.
 
Old 12-19-2017, 11:21 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137Reputation: 2137
apt has an "auto remove" keyword that will remove any packages deemed no longer necessary for reasons such as this. You should use it with caution though, for example it has no idea if you've built up a program from source that requires package A, and may subsequently toss package A because it doesn't think it's required anymore, breaking your compiled program.
 
Old 12-19-2017, 11:54 AM   #3
hazel
Senior Member
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware, OpenBSD
Posts: 4,050
Blog Entries: 11

Rep: Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236Reputation: 2236
There's also a useful command called deborphan, which will list libraries, etc that no longer have anything dependent on them.
 
Old 12-19-2017, 02:23 PM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,413
Blog Entries: 9

Rep: Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659Reputation: 3659
the best & safest solution is to ALWAYS use 'apt-get autoremove' after uninstalling or upgrading.
(and it will never remove packages that were explicitly installed, only as dependencies)
 
Old 12-19-2017, 03:16 PM   #5
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,305

Rep: Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069Reputation: 1069
Also you may want to use the --purge when removing and autoremoving to also get rid of config files to completely get rid of everything associated with it.
 
Old 12-19-2017, 07:34 PM   #6
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163Reputation: 1163
Code:
sudo apt-get –purge remove (name of program)
 
1 members found this post helpful.
Old 12-19-2017, 08:43 PM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
My usual uninstall command is:

Code:
sudo apt-get --purge autoremove packagename
This command, despite how it may appear, removes the package, purges its configuration files, and then autoremoves any auto-installed dependencies of not only that package but also any such dependencies that are marked as outstanding from previous package uninstallations (i.e. it is the equivalent of purging a package followed by issuing a general sudo apt-get autoremove).

This covers all bases except, of course, for the removal of any package-related personal configuration files (usually dot files) in your home directory, which is up to you to do if you so desire.
 
Old 12-20-2017, 06:29 PM   #8
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Every so often I run:
Code:
deborphan | dpkg --purge $1
Every once in a while it removes something I need, so I have to reinstall it.
 
Old 12-24-2017, 08:29 AM   #9
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 10
Thank you, But "sudo apt-get --purge autoremove packagename == Mark for Complete Removal" ? I guess it is not!!!
 
Old 12-24-2017, 08:36 AM   #10
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 3,197

Rep: Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384Reputation: 1384
Quote:
Originally Posted by hack3rcon View Post
Thank you, But "sudo apt-get --purge autoremove packagename == Mark for Complete Removal" ? I guess it is not!!!
The command given in the earlier post does not "mark" anything, it REMOVES the target, and pretty much totally.
Was that not what you wanted?
 
Old 12-24-2017, 10:48 AM   #11
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSUSE, Raspbian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,735

Rep: Reputation: 213Reputation: 213Reputation: 213
Quote:
Originally Posted by hack3rcon View Post
[snip]
For example, I installed "3cxpbx" and removed it but below dependencies are exist:
Code:
$ sudo apt-cache depends 3cxpbx
3cxpbx
  Depends: libc6
  Depends: libstdc++6
  Depends: postgresql   <==<< Careful!
  Depends: nginx
[snip]
Unless you are dead certain that you're the only user of the system, I'd be careful about automatically removing something like a database. Someone else may have begun using it and would surely be upset to find their data gone or inaccessible. (PostgreSQL is also one to be wary of automatically upgrading. Some upgrades require an export-all-databases/upgrade/import-all-databases process and you may not realize that without reading the release notes beforehand.)
 
Old 12-25-2017, 09:06 AM   #12
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by wpeckham View Post
The command given in the earlier post does not "mark" anything, it REMOVES the target, and pretty much totally.
Was that not what you wanted?
I installed the application and when I removed it then some dependencies existed. For example, I never installed "Nginx" and "3cxpbx" installed it but after removed it, "Nginx" existed.
 
Old 12-25-2017, 09:07 AM   #13
hack3rcon
Senior Member
 
Registered: Jan 2015
Posts: 1,432

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by rnturn View Post
Unless you are dead certain that you're the only user of the system, I'd be careful about automatically removing something like a database. Someone else may have begun using it and would surely be upset to find their data gone or inaccessible. (PostgreSQL is also one to be wary of automatically upgrading. Some upgrades require an export-all-databases/upgrade/import-all-databases process and you may not realize that without reading the release notes beforehand.)
"3cxpbx" installed "PostgreSQL". What does "upgrade" mean? Is you mean OS upgrade?
 
Old 12-25-2017, 09:27 AM   #14
_roman_
Member
 
Registered: Dec 2017
Location: _Austro_Bavaria_
Distribution: gentoo / linux mint
Posts: 433

Rep: Reputation: 29
Most likely the term upgrade means to install a newer version of a package with the distribution package manager.

stolen from the web:
Quote:
Linux Distribution Basics: Rolling Releases vs. Standard Releases. Linux distributions tend to use two different types of release cycles: standard releases and rolling releases. Some people swear by rolling releases to have the latest software, while others like standard releases for being more stable and tested.
Those standard releases just update every package at a certain point.

IT is a matter of discussion if you consider it an os upgrade although they just update every package than instead of updating the packages when they are available.
 
Old 12-25-2017, 06:35 PM   #15
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 19.1 MATE
Posts: 8,018
Blog Entries: 5

Rep: Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872Reputation: 2872
Quote:
Originally Posted by hack3rcon View Post
I installed the application and when I removed it then some dependencies existed. For example, I never installed "Nginx" and "3cxpbx" installed it but after removed it, "Nginx" existed.
Please run apt autoremove.

If any packages such as nginx exist after that then do not remove them unless you know *exactly* what you are doing, because the above command will have removed all automatically-installed dependencies that are no longer required by any other packages. Any remaining dependencies will probably be required.
 
  


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
On uninstall, does it make more sense to remove or remove completely? annadane Debian 6 01-30-2017 03:47 PM
How do I COMPLETELY remove a program in Mint6? Indy452 Linux Mint 16 04-16-2009 01:36 PM
command to completely remove a program? dr_zayus69 Linux - Software 1 12-18-2004 05:18 PM
completely remove all traces of a program?? wrat Linux - Newbie 3 07-31-2004 06:59 PM
completely remove a program edigital Linux - Software 3 02-21-2004 03:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration