Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Added some repositories and screwed up grub...

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
WTRXGamer
Posts: 12
Joined: 2015-07-22 20:16

Added some repositories and screwed up grub...

#1 Post by WTRXGamer »

A while back I added the kali linux repositories to my /etc/apt/sources.list so that I could get that version of aircrack-ng. A few days later the system prompted me for updates via the package installer with software from kali.
After a reboot the debian grub bootloader was replaced with the one from kali, and as I don't actually have the kali OS, the boot hangs if I choose kali, but manages to boot if I select windows.
Using the debian install disk I have used the rescue mode and tried to reinstall grub with the command grub-install, and it appears to work. I have used the command on all three of my partitions which are:
-/dev/sda1 Something to do with the boot, it contains the files BOOTNXT, BOOTSECT.BAK, Boot, Recovery, System Volume Information, and bootmgr
-/dev/sda2 My windows partition
-/dev/sda3 My debian partition

On the debian partition in the /boot folder I found 8 files, a system map, config, initrd.img, and vmlinuz for both debian and kali. I have deleted the kali ones and after a reboot they are not recreated, but it still boots to the kali grub.

It might also be worth noting I have two files in the root directory labeled vmlinuz, and vmlinuz.old I have never installed any other linux distribution, nor have I upgraded debian from an older version, but when I tried to switch around the name, I got the error: "Bareword 'vmlinuz' not allowed while 'strict subs' in use at (user-supplied-code)."

Thank you so much for trying to help me. I know I'm going to feel stupid when I figure this out.

Edit #1: After removing the repositories from /etc/apt/sources.list and running apt-get update it downloaded a couple mebabytes, but after a reboot the kali bootloader is still there.

Edit #2: Just for grins I decided to boot to what grub was calling kali, and viola! My debian environment loaded as it normally does. After some tweaking with Grub Customizer, I reverted everything to my backup, and everything works as it used to. On both my desktop and laptop I have deleted the repository labeled kali/updates in hope that it won't do any distribution related updates, and I have commented out the other repository, so when I need software from it I will have to uncomment it, and apt-get update. Is there and easier way to do that, so that I can still use repositories from other distributions but not allow them to install anything distribution related?
Last edited by WTRXGamer on 2015-07-22 21:05, edited 1 time in total.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Added some repositories and screwed up grub...

#2 Post by Head_on_a_Stick »

Code: Select all

# grub-install --recheck /dev/sda
Do not use a partition number.
deadbang

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Added some repositories and screwed up grub...

#3 Post by dasein »

The problem is that you now have something that is neither Kali or Debian. That's what happens when you mix repos.

Depending on exactly what got updated, GRUB may be the least of your worries.

WTRXGamer
Posts: 12
Joined: 2015-07-22 20:16

Re: Added some repositories and screwed up grub...

#4 Post by WTRXGamer »

dasein wrote:The problem is that you now have something that is neither Kali or Debian. That's what happens when you mix repos.

Depending on exactly what got updated, GRUB may be the least of your worries.
Fortunately, after reinstalling grub, I believe the stock debian bootloader was installed, but config changes from the kali update made it appear as it it was the kali bootloader, as once I selected what grub was identifying as kali, it booted to my debian environment normally. Using Grub Customizer, I restored my backup and everything works as it used to. My question now is, how can I (safely) add repositories from other distributions while maintaining debian as the base system? For right now I have removed the kali/updates repository and commented out the main repository. When I want software from the kali one I must now go uncomment it, run apt-get update, install the software I want, comment it again, and run apt-get update.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Added some repositories and screwed up grub...

#5 Post by Head_on_a_Stick »

WTRXGamer wrote:
dasein wrote:how can I (safely) add repositories from other distributions while maintaining debian as the base system?
You can't.

Read the bottom link in my signature.

If you want to use Kali, install & run it from a live USB stick.
deadbang

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Added some repositories and screwed up grub...

#6 Post by dasein »

WTRXGamer wrote:...how can I (safely) add repositories from other distributions while maintaining debian as the base system?
http://forums.debian.net/viewtopic.php?&t=114130

WTRXGamer
Posts: 12
Joined: 2015-07-22 20:16

Re: Added some repositories and screwed up grub...

#7 Post by WTRXGamer »

dasein wrote:
WTRXGamer wrote:...how can I (safely) add repositories from other distributions while maintaining debian as the base system?
http://forums.debian.net/viewtopic.php?&t=114130
Thank you, that post was very helpful. I suppose I'm going on that post as one of the idiots that was dumb enough to mix distributions?

milomak
Posts: 2158
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: Added some repositories and screwed up grub...

#8 Post by milomak »

Head_on_a_Stick wrote:
WTRXGamer wrote:
dasein wrote:how can I (safely) add repositories from other distributions while maintaining debian as the base system?
You can't.

Read the bottom link in my signature.

If you want to use Kali, install & run it from a live USB stick.
i suppose it depends what safe is defined as. if safe is to keep the system as stable then yes i would agree. if safe is that it continues running but not necessarily as stable then yes it is possible.

but of course i would agree with what i think is your sentiment that unless you know what you are doing, you shouldn't veer away from stable.
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

spacex
Posts: 637
Joined: 2015-01-17 01:27

Re: Added some repositories and screwed up grub...

#9 Post by spacex »

WTRXGamer wrote: My question now is, how can I (safely) add repositories from other distributions while maintaining debian as the base system?
My answer is that if you have to ask, then you can't.

I know that I sometime tease a few about mixing sources, but the reality is that you need to really really know what you're doing if you are going to attempt something like that. You have to be able to evaluate every single little package you accept into your system, including all the dependencies that come with it. Some packages are fine to accept, some are a little risky, and others are a big no no. So unless you feel you are able to do that, don't attempt it. It's extreme-sport even for the very skilled ones.

WTRXGamer
Posts: 12
Joined: 2015-07-22 20:16

Re: Added some repositories and screwed up grub...

#10 Post by WTRXGamer »

spacex wrote:
WTRXGamer wrote: My question now is, how can I (safely) add repositories from other distributions while maintaining debian as the base system?
My answer is that if you have to ask, then you can't.

I know that I sometime tease a few about mixing sources, but the reality is that you need to really really know what you're doing if you are going to attempt something like that. You have to be able to evaluate every single little package you accept into your system, including all the dependencies that come with it. Some packages are fine to accept, some are a little risky, and others are a big no no. So unless you feel you are able to do that, don't attempt it. It's extreme-sport even for the very skilled ones.
For now, I've sort of made a hacky way around it. I've made a script that uncomments the kali repositories when I need them, but will then recomment them after I'm done. Theoretically, if I'm diligent about commenting them off as soon as I don't need them, and running apt-get update, the software installer shouldn't even know about the kali repositories.

Randicus
Posts: 2663
Joined: 2011-05-08 09:11

Re: Added some repositories and screwed up grub...

#11 Post by Randicus »

The question still remains. Why?

What are the packages you want to bring over?
Are versions of those packages in Debian's repository?
Do you need or want those packages?
If you really need those packages (I do not know why, since Kali is for security industry professionals.), why not use Kali as a live system from USB or disc like it is meant to be used?

User avatar
dasein
Posts: 7680
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Added some repositories and screwed up grub...

#12 Post by dasein »

WTRXGamer wrote:For now, I've sort of made a hacky way around it. I've made a script that uncomments the kali repositories when I need them, but will then recomment them after I'm done. Theoretically, if I'm diligent about commenting them off as soon as I don't need them, and running apt-get update, the software installer shouldn't even know about the kali repositories.
Your "solution" doesn't afford you anything like the protection you imagine it does. And your "theoretical" prediction is based on ignorance, not actual theory.

As has already been pointed out to you, the degree of damage is package-dependent and therefore unpredictable. It only takes one to render your system unusable.

It seems clear that you're determined to break your system. Fine and dandy: after all, it's your machine to break however you want. Just don't come here asking for help when you do. (And keep a recent backup of your personal data at all times. You will need it; the only question is when.)

WTRXGamer
Posts: 12
Joined: 2015-07-22 20:16

Re: Added some repositories and screwed up grub...

#13 Post by WTRXGamer »

Randicus wrote:The question still remains. Why?

What are the packages you want to bring over?
Are versions of those packages in Debian's repository?
Do you need or want those packages?
If you really need those packages (I do not know why, since Kali is for security industry professionals.), why not use Kali as a live system from USB or disc like it is meant to be used?
Honestly, it's completely out of convenience. I'm sure all of the software on the kali repos could be installed manually, but I prefer the apt-get method. I was using kali on a live disc to test various things on my server, but as I learned the software more and more, it got annoying to switch from debian to the live cd every time I wanted to test something.

Specifically, the package I was using was Johnny (the GUI version of John the Ripper), to test the strength of certain passwords with different hash algorithms, but I also used aircrack-ng a couple times to test my phone's hotspot. (I know that aircrack-ng is in the debian repos, but the kali one also includes airodump-ng, where debian's did not.)

WTRXGamer
Posts: 12
Joined: 2015-07-22 20:16

Re: Added some repositories and screwed up grub...

#14 Post by WTRXGamer »

dasein wrote: Your "solution" doesn't afford you anything like the protection you imagine it does. And your "theoretical" prediction is based on ignorance, not actual theory.
While I would agree with you that my "solution" certainly isn't a guarantee, it has worked thus far (Before my laptop updated, I made the changes), and so long as all data is backed up, no harm can be done.
dasein wrote: As has already been pointed out to you, the degree of damage is package-dependent and therefore unpredictable. It only takes one to render your system unusable.

It seems clear that you're determined to break your system. Fine and dandy: after all, it's your machine to break however you want. Just don't come here asking for help when you do. (And keep a recent backup of your personal data at all times. You will need it; the only question is when.)
I suppose you're right. I really don't know what every single package could do, but I do keep regular backups following the 3-2-1 rule, so worst case scenario I'm out a few hours re-installing the OS and my software. As far as breaking my machine, I understand that this is a very real possibility when I mess with stuff like this, but tinkering with stuff like this is what the community does. Why would open source even matter if making changes were discouraged?

milomak
Posts: 2158
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: Added some repositories and screwed up grub...

#15 Post by milomak »

have you tried building from the kali source?
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: Added some repositories and screwed up grub...

#16 Post by GarryRicketson »

Why would open source even matter if making changes were discouraged?
Not so much that "making changes" are discouraged, but when the person ignores the advice
given by more experienced persons, trying to tell them not to try making certain changes
because it all ready is known that those changes do not work, or cause damage,...
If you want to waste your time experimenting and crashing your system , that is fine, seems
pointless to me, but each to their own. What is discouraged, is that then, after being warned, and ignoring the advise, they return, crying, "oh know, how do I fix it now? " and that is wasting other peoples time, and energy, especially when the questioneer ignores the answers.
Any way , it does not take long to see, it is pointless to try to explain things to a person that
refuses to listen. Do your own research, do what you want, change and modify all the source code in your system, ...unless you know enough about codeing,programming, and how depenencies and libraries work, it will usually result in something that does not work, so
you then have to re-install, down load new ,original source, etc. But anyway do what you want, enjoy your self.

milomak
Posts: 2158
Joined: 2009-06-09 22:20
Been thanked: 1 time

Re: Added some repositories and screwed up grub...

#17 Post by milomak »

have to agree with garry
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

Post Reply