LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-10-2016, 09:35 PM   #1
DaveMcD
LQ Newbie
 
Registered: Nov 2016
Posts: 2

Rep: Reputation: Disabled
removing python3 hosed my install


I installed the python3 package tonight(apt-get install python3), realized I already had python3.5 and did a remove. apt-get remove python3. This caused like all of my packages to be removed. I have some questions about this:

a. why did all of these packages need to be removed along with python?

b. why wasn't I fully notified about all of the packages being removed? seriously, it was like 3/4 of my packages. I think I would have noticed that in the "are you sure? Y/N" message.

c. there are TWO other versions of python still installed, why not switch to one of those instead of removing everything? I didn't even remove one of the original python installs. If this was a depency thing, how did every package in my system become dependent on that python3 package in the 5 seconds that it was installed?
 
Old 11-11-2016, 02:11 AM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,613
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
First you must realise that python2 and python3 are regarded as two different programs. That means they can (and often do) exist side by side. However python3.5 is just a current version of python3. You can only have one python3 package installed at any given time, so your new python3 replaced your old one. Then, when you removed it, all software that depends on python3 disappeared along with it. That's called dependency.

You definitely were notified that that would happen. Apt-get always warns about dependent programs that will have to be removed. You were probably tired and didn't notice the warning. It's easy to make that mistake; I've done it myself.

There were not "two other versions of python installed"; there was only one, python2. Your other python3 had already been overwritten by the new one and all programs dependent on it had switched to the new version. But because python2 and python3 are completely different, programs dependent on python3 can't run with python2.

Python isn't the only program that does this. gtk2 and gtk3 are different as well.

Note: It's not a disaster. Linux is very resilient. Just reinstall python3, then reinstall any lost programs that you use regularly. The which command can tell you quickly if a program is still there or not. Over the next few weeks, install or reinstall whatever programs you need.

Last edited by hazel; 11-11-2016 at 02:42 AM. Reason: Advice on how to proceed.
 
1 members found this post helpful.
Old 11-11-2016, 06:37 AM   #3
DaveMcD
LQ Newbie
 
Registered: Nov 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks, Hazel. I'm sure it was my fault and I was being careless. So apt does remove all packages that have a dependency on the package being removed? I never realized python had become so integral to everything.

Seriously though: I wasn't reading closely, but apt only notified me about a handful of packages that would be removed. There must have been some kind of cascade effect from dependencies of dependencies or something. Literally 200 or 300 packages must have been removed. I don't have networking, apt is giving me errors, firefox is gone, what's left doesn't seem to work or be configured properly. Luckily this is just a vm and I can start over, but this really blindsided me.

Last edited by DaveMcD; 11-11-2016 at 07:10 AM. Reason: more whining
 
Old 11-11-2016, 06:49 AM   #4
goumba
Senior Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Fedora, OpenSUSE, FreeBSD, OpenBSD, macOS (hack). Past: Debian, Arch, RedHat (pre-RHEL).
Posts: 1,335
Blog Entries: 7

Rep: Reputation: 402Reputation: 402Reputation: 402Reputation: 402Reputation: 402
Quote:
Originally Posted by DaveMcD View Post
Thanks, Hazel. I'm sure it was my fault and I was being careless. So apt does remove all packages that have a dependency on the package being removed? I never realized python had become so integral to everything.
APT will remove all packages that depend on one being removed, yes. Otherwise, those packages would be broken, and you'd be complaining "program X doesn't work after I removed python."

APT certainly told you it was removing those packages, unless you passed -y, telling APT "just do what I said." There is no front end to APT that will remove packages without warning you first. Heck, there's no front end that will not warn you it will install packages, unless told not to do so.

Last edited by goumba; 11-11-2016 at 06:57 AM.
 
1 members found this post helpful.
Old 11-11-2016, 07:04 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,613
Blog Entries: 19

Rep: Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458Reputation: 4458
Try running the command apt-cache rdepends python3 and see what you get.
 
1 members found this post helpful.
  


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
After upgrade python3.4 to python3.5.1 , not able to install packages "request" though pip3 YOGESHAS87 Linux - Software 1 08-03-2016 10:38 PM
LXer: How to install Python3 on CentOS LXer Syndicated Linux News 0 12-29-2015 09:51 PM
I hosed my Python install... patdawg Linux - Newbie 7 06-26-2006 01:41 AM
Well,I hosed one MDK10.1 install... jolphil Mandriva 6 02-04-2005 01:17 PM
apt-get -f install - hosed up dhatcher2 Linux - Software 1 10-28-2004 02:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 06:19 AM.

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