LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-18-2019, 11:13 PM   #1
CajunCoder
LQ Newbie
 
Registered: May 2017
Distribution: Debian, Ubuntu
Posts: 10

Rep: Reputation: Disabled
Apt Decided to Uninstall 95% of My System -- Why?


Hi guys.

I've been using Debian, and using the Debian CDROM/DVD .iso's as offline repositories for a system that has only intermittent internet access.

I want to install packages from the local .iso images when offline, and from the official online repositories when online. But, I encountered what appears to be a bug, or user error, but in either case, a very dangerous one:

So, I start off by installing my system from the Debian DVD.iso images, and install additional software this way.

Then, I need a package which is not on the small number of DVD iso's that I've downloaded, so I add an internet repository, run apt update, and while I'm at it, apt-upgrade.

Then later, I comment out the online repository or the DVD repositories, depending on whether I'm online or offline, run apt-get update and install something. This is where the problem happens!

Not always, but sometimes, apt decides that it should remove a whole ton of packages after I comment out a repository. I don't get this. I'm not mixing Stable and Unstable or anything, I'm just switching out repositories. Of course, the online repository is more up-to-date, but... Does using the .iso images mean that once you update from the online repositories, you can't go back? That means that once you do either have to rely on one or the other repository, and that if you ever switch your sources.list to a slightly out of date repo, apt will decide to uninstall your entire system? Am I missing something? This seems a bit extreme. Why can't apt just fall back on older packages for newer installations and keep the installed stuff installed? Why does it go "Oh geez, I don't know where this new version of this thing which is installed (who's older version I know about) came from, so I'm just going to delete it", or at least give me some kind of error before deciding to uninstall 100's or 1000's of packages without my explicit instructions?

How can I do this or something similar without bricking my system again? I'm now deathly afraid of even switching online repositories now for fear that one might be slightly out of date and prompt apt to brick my system.
 
Old 02-18-2019, 11:18 PM   #2
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
http://forums.debian.net/viewtopic.php?f=16&t=104157
 
1 members found this post helpful.
Old 02-18-2019, 11:24 PM   #3
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
Can you please paste your software sources list here.

Do note also that you can run apt-get with the -s switch to simulate an upgrade command without actually doing it.
 
1 members found this post helpful.
Old 02-18-2019, 11:33 PM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Also, a specific example with apt output would help shed light - it's very difficult to give any type of answer based on your description.
Quote:
Originally Posted by CajunCoder View Post
or at least give me some kind of error before deciding to uninstall 100's or 1000's of packages without my explicit instructions?
apt will never remove packages without telling you what it's about to do and asking for confirmation.
 
1 members found this post helpful.
Old 02-19-2019, 06:17 PM   #5
CajunCoder
LQ Newbie
 
Registered: May 2017
Distribution: Debian, Ubuntu
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by descendant_command View Post

Thanks! That's really helpful. I didn't realize that meta-packages worked that way.

I still don't get why removing anything from my sources.list would make apt uninstall things, though. Is that how it's supposed to work? I tried commenting out my repos in s virtual machine such that I have no sources, and I couldn't seem to replicate that behaviour.
 
Old 02-19-2019, 06:23 PM   #6
CajunCoder
LQ Newbie
 
Registered: May 2017
Distribution: Debian, Ubuntu
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by descendant_command View Post
Also, a specific example with apt output would help shed light - it's very difficult to give any type of answer based on your description.
apt will never remove packages without telling you what it's about to do and asking for confirmation.
I think this was due to me running an install script. Even when a script is from a trusted source, they often contain apt commands with the "-y" flag, so while in theory you should always have the chance to review what apt is doing, it's pretty common-place to find scripts with this sort of behaviour.

I do usually glance over scripts before I run them, but it's easy to miss things like that -- and easy to accidentally just press enter and nuke your system if you're not paying attention.

...Yeah, I think I have a new found hatred of meta-packages.
 
Old 02-19-2019, 11:45 PM   #7
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Well by running apt commands with -y you have explicitly given it permission to do whatever it’s algorithm deems necessary to achieve your request, without further confirmation.
IMHO this is always a bad idea.

“Install scripts” use it to avoid unwanted ‘interaction’ that their target audience isn’t usually equipped to deal with.
You also have to be aware that the script may not have been designed with your particular system configuration in mind.

Again, by running such scripts, you have given explicit permission for the writer of said script to hose your system for you.

Glad you found that thread helpful - understanding the mechanism is step 1 in the process of making it do exactly what you want.

Metapackages do serve a very useful purpose and remove a lot of tedium tracking down individual packages that you may not even know you need, to supply “expected” functionality.
Once you’re aware of how they work and why, you can easily adjust your system to suit your needs, once you knw exactly what want and don’t want.
 
1 members found this post helpful.
Old 02-21-2019, 06:07 AM   #8
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by CajunCoder View Post
I've been using Debian, and using the Debian CDROM/DVD .iso's as offline repositories for a system that has only intermittent internet access.

...

How can I do this or something similar without bricking my system again? I'm now deathly afraid of even switching online repositories now for fear that one might be slightly out of date and prompt apt to brick my system.
isn't it rather the other way round - the debian .iso is out of date and if ti's the only source for repositories, apt gets confused.
it should really downgrade all these packages back to the original state of your debian .iso, but afaik apt does not have a concept of downgrading, so it just wants to remove lots of stuff.

i know it's possible to configure debian to use offline repositories, and i guess it's possible to configure it in a way that it doesn't break when you upgrade online - but maybe you're doing it wrong?
 
  


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
How the virtual address was decided(allocated) when the system start(fork) a new process? Yuc Linux - Newbie 4 02-18-2019 09:08 PM
LXer: Why one photographer decided to fight a patent on online contests LXer Syndicated Linux News 0 02-21-2015 10:22 AM
System bootup has decided to take forever... irgunII Slackware 31 12-01-2013 11:33 PM
How is the minimum file system free space decided? catkin Linux - General 8 08-06-2013 08:34 AM
Ok, I decided to make Linux my main system... now please help me in the transition! RobertoBech Mandriva 11 03-09-2004 08:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:30 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