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

 

 

 

[SOLVED] apt-get update doesn't work in safe mode

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

[SOLVED] apt-get update doesn't work in safe mode

#1 Post by Mephistopheles »

[EDIT] This problem is now solved thanks to the people who took time out of their day to help me out! I apologise for me ever seeming rude or making stupid mistakes. Thanks to everyone who helped.

I've recently just installed Debian 9, and after many problems trying to boot it (http://forums.debian.net/viewtopic.php?f=30&t=134445) I've finally managed to boot into safe mode to access a terminal and adjust sources.list to try and get

Code: Select all

apt-get update
to work, but whenever I attempt to use the command, it pastes this into the console:

Code: Select all

Err:1 http://ftp.uk.debian.org/debian stretch InRelease
  Could not resolve 'ftp.uk.debian.org'
Err:2 http://ftp.uk.debian.org/debian stretch InRelease
  Could not resolve 'ftp.uk.debian.org'
Err:3 http://ftp.uk.debian.org/debian stretch InRelease
  Could not resolve 'ftp.uk.debian.org'
Reading package list... Done
W: Failed to fetch http://ftp.uk.debian.org/debian/dists/stretch/InRelease Could not resolve 'ftp.uk.debian.org'
W: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/InRelease Could not resolve 'security.debian.org'
W: Failed to fetch http://ftp.uk.debian.org/debian/dists/stretch-updates/InRelease Could not resolve 'ftp.uk.debian.org'
W: Some index files failed to download. They have been ignored, or old ones used instead.
I've been told that I just need to get the network working, but I'm unsure as to how I should do that. I'm connected wirelessly to my router through a wifi booster
Last edited by Mephistopheles on 2017-08-27 20:07, edited 2 times in total.

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: apt-get update doesn't work in safe mode

#2 Post by pylkko »

In single user mode, network is disabled by default. You need to form a network connection first. I believe that root is mounted read only also, so in order to make changes you need to remount it
Last edited by pylkko on 2017-08-27 10:10, edited 1 time in total.

User avatar
dilberts_left_nut
Administrator
Administrator
Posts: 5346
Joined: 2009-10-05 07:54
Location: enzed
Has thanked: 12 times
Been thanked: 66 times

Re: apt-get update doesn't work in safe mode

#3 Post by dilberts_left_nut »

AdrianTM wrote:There's no hacker in my grandma...

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#4 Post by Mephistopheles »

pylkko wrote:In single user mode, network is disabled by default. You need to form a network connection first. I believe that root is mounted read only also, so in order to make changes you need to remount it
How would one go about remounting root?

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: apt-get update doesn't work in safe mode

#5 Post by kedaha »

First thing to do is to Indentify the device.
A command like lspci -nn will generate a lot of output, so it's better to narrow it down, assuming it's a PCI device, with a command like:

Code: Select all

$ lspci -nn -kk |grep -i network
The man pages will give you more information about such commands like:
lspci - list all PCI devices
-nn Show PCI vendor and device codes as both numbers and names.
-vv Be very verbose and display more details. This level includes everything deemed useful.
grep print lines matching a pattern
-i Ignore case
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: apt-get update doesn't work in safe mode

#6 Post by kedaha »

Mephistopheles wrote:How would one go about remounting root?
Check this out:

Code: Select all

mount -o ro,remount /
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#7 Post by Mephistopheles »

kedaha wrote:First thing to do is to Indentify the device.
A command like lspci -nn will generate a lot of output, so it's better to narrow it down, assuming it's a PCI device, with a command like:

Code: Select all

$ lspci -nn -kk |grep -i network
The man pages will give you more information about such commands like:
lspci - list all PCI devices
-nn Show PCI vendor and device codes as both numbers and names.
-vv Be very verbose and display more details. This level includes everything deemed useful.
grep print lines matching a pattern
-i Ignore case
I've tried typing out

Code: Select all

lspci -nn -kk | grep -i network
But it gives no output at all, I only get an output if I type

Code: Select all

lspci -nn -kk
or

Code: Select all

lspci -nn
I also get an output if I type

Code: Select all

lspci -nn -kk -i network
When I type the latter, the only output I get that's remotely related to internet is this:

Code: Select all

Ethernet controller [0200]: Qualcomm Atheros Killer E220x Gigabit Ethernet Controller [1969:e091 (rev 10)
Subsystem: Gigabit Technology Co., Ltd Killer E220x Gigabit Ethernet Controller [1458:e000]
Kernel driver in use: alx
Kernel modules: alx
I think the reason it classes it as an Ethernet connection is because I'm connected to the wifi booster via an ethernet cable, but the connection is still wireless.
kedaha wrote:
Mephistopheles wrote:How would one go about remounting root?
Check this out:

Code: Select all

mount -o ro,remount /
I've typed this in and the output read

Code: Select all

[ 7123.543070 EXT4-fs (sda3): re-mounted. 0pts: errors=remount-ro

User avatar
Lysander
Posts: 643
Joined: 2017-02-23 10:07
Location: London
Been thanked: 1 time

Re: apt-get update doesn't work in safe mode

#8 Post by Lysander »

OP, have you actually read through - thoroughly - the links that d_l_n pointed you to? You didn't respond to his post and you're getting into dropping-sequential-Qs-into-your-thread mode.

I get the impression you're getting frustrated. I would take some time to read around and build yourself a knowledge base through the Debian Wiki. That should always be your first port of call before posting. Take a step back from the forums.

By the way, in the time you have taken to install [or to attempt to install] Debian and post here repeatedly over the last few days, you could have had Ubuntu up and running. Just a thought. Second thought: installing an easier OS is also a way of generating a knowledge-base. Third thought: don't waste your whole bank holiday weekend on this.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#9 Post by Mephistopheles »

Lysander wrote:OP, have you actually read through - thoroughly - the links that d_l_n pointed you to? You didn't respond to his post and you're getting into dropping-sequential-Qs-into-your-thread mode.
I'm in the process of reading through them, though most of the commands I come across don't seem to exist, as when I type things in such as iwconfig it displays an output that states no such command exists. In the meantime of reading through the links he gave me and attempting mostly non-existent commands I thought I'd continue trying to find as many other solutions as I can and trying them out alongside everything else.
Lysander wrote: By the way, in the time you have taken to install [or to attempt to install] Debian and post here repeatedly over the last few days, you could have had Ubuntu up and running. Just a thought..
I've already tried installing Ubuntu LTS and Ubuntu, neither of them will even install, I press the install button and both of them just display a black screen in which I can't type anything, I've left them like this for hours but to no avail, and I've researched into it and nothing people have suggested has worked so I just left Debian on my system, and whist it was there I thought I might as well put as much effort into solving my problem as I can.

User avatar
Lysander
Posts: 643
Joined: 2017-02-23 10:07
Location: London
Been thanked: 1 time

Re: apt-get update doesn't work in safe mode

#10 Post by Lysander »

Mephistopheles wrote:I press the install button and both of them just display a black screen in which I can't type anything
How are you testing these OSs, is it through a live USB? Are you able to boot into the live environment and test the OS?

Here's something I got from a quick Google. Have you tried using integrated graphics to install the OS?

https://askubuntu.com/questions/469377/ ... gtx-750-ti
https://askubuntu.com/questions/795547/ ... h-gtx-1080

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#11 Post by Mephistopheles »

In the first link it mentions "wireless-tools", which I do not believe my system has. So I typed

Code: Select all

apt-get install wireless-tools
into the console, after detecting 2 new files to install, it prints errors to the console that state it failed to fetch certain archives. If I add "--fix-missing" at the end of the "apt-get install" command, it fails to fetch the archives again but this time it aborts the installation as stated by the console's output.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#12 Post by Mephistopheles »

Lysander wrote:
Mephistopheles wrote:I press the install button and both of them just display a black screen in which I can't type anything
How are you testing these OSs, is it through a live USB? Are you able to boot into the live environment and test the OS?

Here's something I got from a quick Google. Have you tried using integrated graphics to install the OS?

https://askubuntu.com/questions/469377/ ... gtx-750-ti
https://askubuntu.com/questions/795547/ ... h-gtx-1080
I can't boot into a live environment as I get the same issue, and if I try using integrated graphics it leads me to a log with a lot of errors printed in it.

[EDIT] After reading the first link and setting my primary graphics driver to the Intel On-Board Graphics, I rebooted into Debian and it booted properly.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: apt-get update doesn't work in safe mode

#13 Post by kedaha »

In single-user mode some programs don't work.
The good news is that your wireless network card driver is included in the kernel so it must work.
Are you able to ping?
$ ping google.com
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#14 Post by Mephistopheles »

kedaha wrote:In single-user mode some programs don't work.
The good news is that your wireless network card driver is included in the kernel so it must work.
Are you able to ping?
$ ping google.com
Since I've finally managed to boot into Debian and log into my account, I'm able to ping, but I did try to ping google in single-user mode and it didn't seem to work, but I may have typed the address in wrong.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: apt-get update doesn't work in safe mode

#15 Post by kedaha »

OK, as root run this:

Code: Select all

# dhclient
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#16 Post by Mephistopheles »

kedaha wrote:OK, as root run this:

Code: Select all

# dhclient
After running said command, the terminal outputs this:

Code: Select all

RTNETLINK answers: File exists

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: apt-get update doesn't work in safe mode

#17 Post by kedaha »

How about:

Code: Select all

iwlist scan
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#18 Post by Mephistopheles »

kedaha wrote:How about:

Code: Select all

iwlist scan
The output reads

Code: Select all

bash: iwlist: command not found
Last edited by Mephistopheles on 2017-08-27 11:51, edited 1 time in total.

kedaha
Posts: 3521
Joined: 2008-05-24 12:26
Has thanked: 33 times
Been thanked: 77 times

Re: apt-get update doesn't work in safe mode

#19 Post by kedaha »

Assuming you've already read wiki.debian.org/WiFi/HowToUse#Command_Line
DebianStable

Code: Select all

$ vrms

No non-free or contrib packages installed on debian!  rms would be proud.

Mephistopheles
Posts: 20
Joined: 2017-08-25 07:13

Re: apt-get update doesn't work in safe mode

#20 Post by Mephistopheles »

kedaha wrote:Assuming you've already read wiki.debian.org/WiFi/HowToUse#Command_Line
I get the same error when typing iwconfig, and I've installed connman but can't seem to access it from the terminal.

Post Reply