1

I just downloaded Debian 9.6.0 from osboxes to run it on a VM. However, I ran into a few problems.
I can't sudo. Ok, you have to install it first. No problems... I thought. Turns out, there are a few indeed for me. After looking up google I found:

apt-get install sudo -y

which ends up in Could not get lock /var/lib/dpkg/lock - open (11: Resoruce temporarily unavailable as well as Unable to lock the admin directory /var/lib/dpkg/, is another process using it?. Bear in mind I was logged in as the default osboxes.org account and used su before.

The answer from GDA3R resolved the lock issue. However when I try to apt-get install sudo I get please insert the disc labeled Debian GNU/Linux 9.5.0 _Stretch_ which can be resolved by commenting out the line in services.list. However, this file is read only and I cant edit it.

the sources.list is as follows

# deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 DVD Binary-1 20180714-10:25]/ stretch contrib main

deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 DVD Binary-1 20180714-10:25]/ stretch contrib main

deb http://security.debian.org/debian-security stretch/updates main contrib
deb-src http://security.debian.org/debian-security stretch/updates main contrib

# stretch-updates, previously known as 'volatile'
# A network mirror was not selected during install.  The following entries
# are provided as examples, but you should amend them as appropriate
# for your mirror of choice.
#
# deb http://deb.debian.org/debian/ stretch-updates main contrib
# deb-src http://deb.debian.org/debian/ stretch-updates main contrib

I think I should outcomment the second deb cdrom. I can open the file in the terminal. However, trying to insert a # results in cursor jumping to first deb and returning ?\<deb\> in last line

  • Do you have another package manager operation in progress? Check backgrounded jobs etc. – Kusalananda Jan 8 at 11:03
1

You should wait for the auto-update to be accomplished through the apt-daily.service service ( in background ).

Or you can stop the apt-daily.service and the running apt instance , then run the aborted task manually (as root):

systemctl stop apt-daily.service
pkill apt
dpkg-configure -a
apt update
apt install sudo

To solve the error:

please insert the disc labeled Debian GNU/Linux 9.5.0 _Stretch_...

As root , comment or remove the cdrom repository from your sources.list.

This is an example of /etc/apt/sources.list file from Debian Wiki :Sources- List

deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main

deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main

deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main

If you also want the contrib and non-free components, add contrib non-free after main:

deb http://deb.debian.org/debian stretch main contrib non-free
deb-src http://deb.debian.org/debian stretch main contrib non-free

deb http://deb.debian.org/debian-security/ stretch/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ stretch/updates main contrib non-free

deb http://deb.debian.org/debian stretch-updates main contrib non-free
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.