UbuntuThis forum is for the discussion of Ubuntu Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.