LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-12-2019, 11:47 PM   #1
LMINTUSER
LQ Newbie
 
Registered: Apr 2019
Posts: 14

Rep: Reputation: Disabled
I have a question about apt in mint


Hi everybody,

I've installed and uninstalled many packages in Mint for a long time, but I NEVER though about this situation.

If I uninstall a package, will it also uninstall it's dependencies as well? Thanks
 
Old 06-13-2019, 02:37 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Usually it will. If you want to cleanup all packages that are installed though they are no longer needed:
sudo apt-get autoremove
 
Old 06-13-2019, 04:23 AM   #3
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
As far as I am aware, it will uninstall those dependencies if they are no longer needed by other packages.

This will help

https://askubuntu.com/a/151943
 
Old 06-13-2019, 09:27 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
It depends how the dependencies were installed. If you installed them explicitly (including via a distro installation script), they will remain. If they came over as dependencies, they will be removed.
 
Old 06-13-2019, 07:17 PM   #5
LMINTUSER
LQ Newbie
 
Registered: Apr 2019
Posts: 14

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by j-ray View Post
Usually it will. If you want to cleanup all packages that are installed though they are no longer needed:
sudo apt-get autoremove
Quote:
Originally Posted by Lysander666 View Post
As far as I am aware, it will uninstall those dependencies if they are no longer needed by other packages.

This will help

https://askubuntu.com/a/151943
Quote:
Originally Posted by hazel View Post
It depends how the dependencies were installed. If you installed them explicitly (including via a distro installation script), they will remain. If they came over as dependencies, they will be removed.
Thanks to all for the replies and links
 
Old 06-14-2019, 09:20 AM   #6
wvermin
Member
 
Registered: Jun 2019
Posts: 34

Rep: Reputation: Disabled
Looking at the answers, I think that the word 'dependency' is somewhat ambiguous.

Example: package xyz needs package abc. Then
apt install xyz
will also install abc (of course!)

Uninstalling xyz:
apt remove xyz
will not remove abc, but you can remove it with
apt autoremove (as stated before)
or
apt remove abc
If you want abc to remain:
apt install abc

Uninstalling abc:
apt remove abc
will also remove xyz, logical because xyz cannot function without abc.
You get the change to answer no, if you want xyz to remain.
 
Old 06-14-2019, 09:22 AM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Yes, and no.

When you remove/purge a package, all those packages which were automatically installed as dependencies of that package, if they are no longer also dependencies of other packages, will be placed in a list of "packages to be autoremoved" which you can remove with sudo apt autoremove.

However, the package manager is cautious. When a package is uninstalled, any "unused dependencies" of that package which are recommended packages of other still-installed packages will not be added to the autoremove list.

This is my experience anyway, and leads to the occasional behaviour where, in a system where APT is not configured to install both dependencies and recommended packages for a given package, you install a package and it pulls in dependencies, only to uninstall it later and find that not all those dependencies are added to the autoremove list.

Last edited by hydrurga; 06-14-2019 at 09:24 AM.
 
Old 06-14-2019, 09:41 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
But if you use synaptic rather than apt, the left-over dependencies are removed. A lot of people get themselves into a bind as follows:

1) Install a particular desktop. These desktops are "metapackages", empty packages that bring over a load of applications and libraries as dependencies.
2) Try to get rid of an application you don't want. You get a huge list of other packages that will disappear along with it, including a lot of stuff that you actually want to keep.

What has happened? The application you want to remove is a dependency of the desktop package, so that will be removed too. But all the rest of the desktop apps came onto your machine as dependencies of the desktop, so they are also marked for removal.

At this point you have a choice. Either you abort the whole thing, or you must make a list on paper of the apps you want to keep and reinstall them explicitly.
 
  


Reply



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
I have an ext4 partition with a broken Mint Mate OS on it, have a grub related question HannemanThrashKing Linux - General 7 01-06-2019 02:50 PM
Hello, this is my first post! Seems I have a fix for MobaXterm's apt-cyg/apt-get cpqlinux LinuxQuestions.org Member Intro 2 05-10-2018 11:11 AM
sudo apt-get ::top/funnest apt-gets you have ever done hansolo669 Linux - General 0 04-01-2009 07:49 PM
apt pinning /etc/apt/apt.conf parent's_basement Debian 5 10-26-2008 05:50 PM

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

All times are GMT -5. The time now is 04:02 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
Open Source Consulting | Domain Registration