[SOLVED] apt-get update not working on newly installed Debian 10
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
balenaEtcher just works, though there is always dd as hazel says. Etcher is easier with a GUI, dd is faster (maybe - can't say I notice the difference with modern hardware), but you gotta get the command line right.
I've recently had success making bootable USB from a 5.4 GB iso with Gnome Disks.
To get passed the 4 GB thing it lets you format to exFAT and does the copy for you.
Roken, balenaEtcher wouldn't install properly on my computer. When I ran it for the 1st time after install, I got a gray box that is completely non-functional; settings, back button, none of them work - when I click on settings, nothing happens at all. Rebooting, connecting to internet did nothing. Have you tried installing this lately? It just doesn't do anything.
So I guess I'll try win32 disk imager. Are there any other installers that forum members have actually successfully used themselves to install Debian 10?
It's probably not possible to try Gnome Disks on Windows, right?
Last edited by Trent29; 05-24-2020 at 04:30 PM.
Reason: Didn't see 2 new responses prior to my reply
win32diskimager didn't work either. It seems mainly to be for .img files, not .iso. win32diskimager installed itself and started OK (unlike balenaEtcher), but when I clicked on write, I got error message saying I didn't have permission to access the 32 GB USB, which was NTFS reformatted and completely empty.
Yep - you need to make sure the package manager you are using is actually used on the distro. Manjaro is Arch based, so uses pacman. Debian based distros use apt.
Actually, on second thoughts, I wouldn't recommend dd for a newbie. It's extremely powerful and therefore potentially dangerous. It copies exactly from a specified input file/device to a specified output one, and if you are using device files and get them the wrong way round, you could overwrite your root partition. Specialist software is safer.
Well, Ubuntu website recommends using Rufus to prepare a bootable USB stick. I suppose Debian installation media should be similar. And Debian CD FAQ mentionswin32diskimager.
But this differs from distro to distro. E.g. CentOS Wiki explicitly advises against using Rufus because you need to set right options for it to work. A remarkably simple tool I succesfully used to make installation media for CentOS 8 that they don't mention is ROSA ImageWriter.
That one allows you to choose desktop / server / or whatever intended use.
$ sudo dselect
That one works like apt, but with an ncurses style front-end. But those might not be installed yet. I normally use dselect to populate available, which has perks. The first menu in dselect lets you select a "source". Although you might need to know the URL to a source in the absence of optical media.
$ sudo dselect update
$ sudo dselect upgrade
My sources.list file:
Code:
deb http://security.debian.org stable/updates main contrib non-free
deb http://httpredir.debian.org/debian stable main contrib non-free
deb http://httpredir.debian.org/debian stable-updates main contrib non-free
deb-src http://httpredir.debian.org/debian stable main contrib non-free
deb-src http://httpredir.debian.org/debian stable-updates main contrib non-free
The last two replies are fine for Debian based distros. Turns out, the OP was NOT about a Debian base, and so are of no assistance at all.
I appreciate the willingness to help, but it's important to recognise that this is a Linux board, and not a Debian or derivatives board. What works on Debian will not, at a package manager base, work on other base distros (Arch, RedHat, Suse etc.)
@Shadow_7. IIRC, synaptic, aptitude, all the *-tasks metapackages and many other metapackages depend on tasksel, so chances are that it's installed already.
OTOH, dselect rarely gets installed nowadays. Don't get me wrong: I love it and believe it still has its uses, but I would never recommend dselect to a newbie.
Alone the difference between /var/lib/dpkg/available and /var/lib/apt/lists/*Packages is enough to drive anybody nuts. IIRC, apt-get update always leaves available untouched, but (at least some versions of) aptitude update made it a copy of apt-cache dumpavail, thus rendering all your selection work carefully laid via dselect and/or dpkg --merge-avail completely futile. The same is true for dselect update if apt is configured as dselect's access method (which it is, by default).
And using dselect on the whole Debian repository rather than on a carefully selected subset of packages is just insane. IMO, aptitude and synaptic can handle this much better.
First of all, Rufus worked great as the USB installer on the latest version of Windows 10. And for the record, using the .iso option inside Rufus worked; didn't need to try the dd option. Thanks shruggy.
So I did a complete reinstall of Debian 10, choosing the beginner default choices in the graphic installer with a great internet connection. I DEFINITELY chose a mirror during install. The first command I typed in was apt-get update. So now I'm back to my original problem - it still doesn't work. This is now a fresh install with no accidental newbie contamination. I tried apt-get update both as a regular user and as root.
So now I'm trying to apply the suggestions of shruggy, Quick Breakfast, HappyTux and hazel way back at the beginning of this thread to modify the sources.list file and Debian absolutely won't let me log in as root or give me root access, even though I set it up with a password during the install. Please take a look below and tell me what I'm doing wrong. What can I do to get access to the sources.list file as root? Please tell me there's a way for me to log in as root and modify the sources.list file via GUI and not CLI.
Also, a few questions:
Why doesn't Debian recognize user as a sudoer?
Why didn't Debian follow my usermod command to add user as a sudoer?
Why didn't Debian recognize my user iwconfig command?
Code:
user@debian:~$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
user@debian:~$ sudo apt-get update
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for user:
user is not in the sudoers file. This incident will be reported.
user@debian:~$ sudo su
[sudo] password for user:
user is not in the sudoers file. This incident will be reported.
user@debian:/$ su
Password:
root@debian:/# usermod -a -G sudo user
bash: usermod: command not found
root@debian:/# iwconfig
bash: iwconfig: command not found
root@debian:/# su user
user@debian:/$ iwconfig
bash: iwconfig: command not found
root@debian:/# sudo apt-get update
Ign:1 cdrom://[Debian GNU/Linux 10.4.0 _Buster_ - Official amd64 DVD Binary-1 20200509-10:26] buster InRelease
Err:2 cdrom://[Debian GNU/Linux 10.4.0 _Buster_ - Official amd64 DVD Binary-1 20200509-10:26] buster Release
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
Hit:3 http://deb.debian.org/debian buster InRelease
Hit:4 http://deb.debian.org/debian buster-updates InRelease
Hit:5 http://security.debian.org/debian-security buster/updates InRelease
Reading package lists... Done
E: The repository 'cdrom://[Debian GNU/Linux 10.4.0 _Buster_ - Official amd64 DVD Binary-1 20200509-10:26] buster Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
root@debian:/#
Note I am not a Debian user, so I can not be sure, but possibly because the distro uses su not sudo.
I hope you noticed that when you used su your electronic marvel accepted the command. Therefore I'd use su from now on.
Quote:
Why didn't Debian recognize my user iwconfig command?
Before trying to modify your net connection. Try pinging any address to see whether you're connected to the net.
Code:
ping -c3 www.gentoo.org
Your ectronic marvel will soon tell you how many packets have been received.
If there is zero percentage loss, your connected.
But the distro is looking for the updates in the wrong place for the upodates and it's telling you exactly that.
Code:
root@debian:/# sudo apt-get update
Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs
which you don't want.
Code:
E: The repository 'cdrom://[Debian GNU/Linux 10.4.0 _Buster_ - Official amd64 DVD Binary-1 20200509-10:26] buster Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Usermod doesn't directly put you into the sudoers file. What happens in Debian distros is that a sudo group is predefined in sudoers with full sudo rights, and you can use usermod to become a member of that group.
However, you need to understand that your group membership at any moment is the group membership you had when you logged in. It doesn't get automatically updated when you use usermod to add yourself to groups. So you need either to log out and log in again or to use su (your_name)- at a terminal to make the change effective. The minus sign in the command ensures that the new shell you create is a login shell.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.