Score:0

Broken apt sources list?

fo flag
Rad

I am trying to do boot-repair using try Ubuntu from live disc. I need to do apt commands, however I keep getting:

Media change: please insert the disc labeled
 'Ubuntu 21.04 _Hirsute Hippo_ - Release amd64 (20210420)'
in the drive '/cdrom/' and press [Enter]

I have seen a solution about removing cdrom entries from /etc/apt/sources.list, so I did. Now my lists are only 4 active entries, none is cdrom:

ubuntu@ubuntu:~$ grep ^ /etc/apt/sources.list /etc/apt/sources.list.d/*
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ hirsute main restricted
/etc/apt/sources.list:deb http://security.ubuntu.com/ubuntu/ hirsute-security main restricted
/etc/apt/sources.list:deb http://archive.ubuntu.com/ubuntu/ hirsute-updates main restricted
/etc/apt/sources.list.d/yannubuntu-ubuntu-boot-repair-hirsute.list:deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/ hirsute main
/etc/apt/sources.list.d/yannubuntu-ubuntu-boot-repair-hirsute.list:# deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu/ hirsute main

I have also checked UI to make sure that option to use CD is NOT selected and I have done sudo apt-get update multiple times, however I keep getting the same error. Do you know how to remove this error message? Or is it impossible to get rid of on live version?

The command I am trying to run is:

sudo chroot "/mnt/boot-sav/sdb5" apt-get purge --allow-remove-essential -y grub*-common shim-signed
mchid avatar
bo flag
Why would you run that command? You're going to remove many dependencies along with those packages. If you are going to purge and reinstall a package, you can use dpkg to purge instead and then use apt to reinstall. This way, it will not remove dependencies.
heynnema avatar
ru flag
You're confused. Editing sources.list on your Ubuntu Live DVD does no good. What does boot-repair have to do with running (dangerous) cli commands? What makes you want to run those commands anyway?
Rad avatar
fo flag
Rad
I have a problem with dual booting. I am trying to fix it using boot-repair. That's why it needs to remove grub from live cd and then install it again. There was a step where I should execute commands to remove grub manually.
N0rbert avatar
zw flag
Does this answer your question? [How can I avoid "please insert CD/DVD" error when updating Ubuntu?](https://askubuntu.com/questions/178437/how-can-i-avoid-please-insert-cd-dvd-error-when-updating-ubuntu)
Rad avatar
fo flag
Rad
@N0rbert No, I have tried unticking this option in UI and removing entry from `sources.list` (after which I did `apt update`), both did not work
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.