Pls help getting update error

amannscharlie

New Member
Joined
Oct 2, 2023
Messages
1
Reaction score
0
Credits
17
I have installed kali Linux or nethunter in termux. After watching video how to install it i finally installed it. Now I'm whenever run apt update or sudo apt update command I'm getting this error:

Temporary failure resolving 'http.kali.org' Err:2 http://http.kali.org/kali kali-bleeding-edge InRelease
Temporary failure resolving 'http.kali.org' Reading package lists... Done Building dependency tree... Done
Reading state information... Done All packages are up to date.
W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Temporary failure resolving 'http.kali.org'
W: Failed to fetch http://http.kali.org/kali/dists/kali-bleeding-edge/InRelease Temporary failure resolving 'http.kali.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
 

Attachments

  • Screenshot_2023-10-02-09-10-12-99_84d3000e3f4017145260f7618db1d683.jpg
    Screenshot_2023-10-02-09-10-12-99_84d3000e3f4017145260f7618db1d683.jpg
    571.9 KB · Views: 499


Temporary failure resolving 'http.kali.org' Err:2 http://http.kali.org/kali kali-bleeding-edge InRelease
That is going to be your main problem, you must expect to have problems with bleeding edge distributions they tend not to be very stable

W: Failed to fetch http://http.kali.org/kali/dists/kali-rolling/InRelease Temporary failure resolving 'http.kali.org'
it may be the servers were down due to nightly updates

Did you bother to read the Kali full documentation? It clearly states Kali is for experienced Linux users and not a beginners' distribution, Kali expect users to have enough Knowledge and experience [of Linux and the terminal commands] to find and fix their own problems.
 
The problem is it can't resolve dns names, that's a pretty straight forward error. If you can't figure that simple thing out you probably won't be able to figure out more complicated problems so you probably shouldn't be using Kali. So look in the direction of your network dns settings.
 
Kali isn't well liked here but what @f33dm3bits said is true. You should be able to solve this.
look at your network settings. Is IPV6 set to auto if so tell it to ignore it, for now.
 
In case someone else runs across this here, this is likely not a DNS issue. A simple ping shows that it resolves.

For Nethunter or Kali support, you're better off at forums.kali.org. Here's an actual solution though:

Open nethunter terminal

nano or vi /etc/passwd

find the line for
_apt:x:34:65534::............

change to
_apt:x:0:65534::............

Save and run:
apt clean
apt update
apt upgrade
apt dist-upgrade


Cheers.
 
In case someone else runs across this here, this is likely not a DNS issue. A simple ping shows that it resolves.

For Nethunter or Kali support, you're better off at forums.kali.org. Here's an actual solution though:

Open nethunter terminal

nano or vi /etc/passwd

find the line for
_apt:x:34:65534::............

change to
_apt:x:0:65534::............

Save and run:
apt clean
apt update
apt upgrade
apt dist-upgrade


Cheers.
The effect of this change of the user identification of _apt, is to convert apt's particular user's ID of 34 in this case, to root's ID which is 0.

This effectively escalates privilege to _apt, and hence broadens the security vulnerability, which is not the intended facility for _apt. The apt program's user _apt has it's own user ID so that it can function within it's own limits in a secure manner, and the particular user, _apt is actually the owner of the system files:
/var/cache/apt/archives/partial and /var/lib/apt/lists/partial, as distinct from root's ownership of other apt directories and files.

To check the ID of _apt as it's named in /etc/passwd, one can run:
Code:
[tom@min /etc]$ id --user _apt
42
Note on this machine, it's different to that in post #5.
And to check the ID:
Code:
[tom@min /etc]$ id --user -n 42
_apt

The problems of the OP in post #1 can be resolved in other ways rather than escalating privilege, in particular, the temporary failures mentioned are often the result of the distro's servers being offline or disturbed for an intermittent period, so users only need to wait a while until they come back online. I can't say whether this is the case in the OP's situation, but the basic point of resolving the matter without undue modifications of system file permissions in the first instance is the more secure and preferable approach.
 
Thank you for that excellent explanation.
The issue in the OPs approach is relatively common after doing apt upgrade with nethunter on various android devices. I myself have been troubleshooting this same issue on multiple devices for a few days. The surface level dns resolution error in my cases have not been the actual issue, as I suspect the same for other users with similar nethunter install methods.

No, modifying permissions for the apt user is not an ideal solution but it is a functional one in this case. Not recommended for typical linux distros and installations, but this type of setup does not fall in that category anyways.
 
I had not seen this thread when the OP asked the question, but now that I have, I'll put in my two cents.

IMO, the simplest cause and answer lies in asking the question

"Please show us the output of the command

Code:
cat /etc/apt/sources.list

# or if not found

cat /etc/apt/sources.list.d/sources.list

TIA"

Sure, we can see from his Post a couple of the repos he is sourcing from, but knowing the rest would be beneficial.

Kali have this

https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/

and from a link in there it will take you to read about branches

https://www.kali.org/docs/general-use/kali-branches/

IMO again, Users of Kali who have not had at least 5 years of experience with mainstream Linux Distros should just have this as that output

Code:
deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware

... and if not, and having problems, change it back and test it.

Works for me.

Wizard
 
And from my perspective.... The OP has not been seen or heard of since 2Oct 2023//....the day he posted.

He took one look at the answers received on that day, and likely decoded...too much for me, and exited left.

As all newcomers to Linux, especially of a young age, are told....Kali is not for the faint hearteduninitiated/those lacking experience

You really do need to walk before you can run.
 
I had not seen this thread when the OP asked the question, but now that I have, I'll put in my two cents.

IMO, the simplest cause and answer lies in asking the question

"Please show us the output of the command

Code:
cat /etc/apt/sources.list

# or if not found

cat /etc/apt/sources.list.d/sources.list

TIA"

Sure, we can see from his Post a couple of the repos he is sourcing from, but knowing the rest would be beneficial.

Kali have this

https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/

and from a link in there it will take you to read about branches

https://www.kali.org/docs/general-use/kali-branches/

IMO again, Users of Kali who have not had at least 5 years of experience with mainstream Linux Distros should just have this as that output

Code:
deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware

... and if not, and having problems, change it back and test it.

Works for me.

Wizard

Definitely all very good points to check. As a matter of saving someone some time who perhaps has already checked some of these items and will inevitably run across this thread with a similar issue where other solutions had no success, there's one that worked. This thread was among the top in my search results. I wasn't the first, I won't be the last. Thanks all.
 


Top