[SOLVED] "Error: apt-get not found" during installing Debian
DebianThis forum is for the discussion of Debian Linux.
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.
I downloaded and extracted debootstrap and run it. It produced some warnings in the end:
Code:
[root /]# /usr/sbin/debootstrap --arch amd64 jessie /mnt/deb http://ftp.us.debian.org/debian
W: Cannot check Release signature; keyring file not available /usr/share/keyrings/debian-archive-keyring.gpg
I: Retrieving InRelease
I: Retrieving Release
I: Retrieving Packages
I: Validating Packages
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: acl adduser dmsetup insserv libaudit-common libaudit1 libbz2-1.0 libcap2 libcap2-bin libcryptsetup4 libdb5.3 libdebconfclient0 libdevmapper1.02.1 libgcrypt20 libgpg-error0 libkmod2 libncursesw5 libprocps3 libsemanage-common libsemanage1 libslang2 libsystemd0 libudev1 libustr-1.0-1 procps systemd systemd-sysv udev
I: Found additional base dependencies: libdns-export100 libffi6 libgmp10 libgnutls-deb0-28 libgnutls-openssl27 libhogweed2 libicu52 libidn11 libirs-export91 libisc-export95 libisccfg-export90 libmnl0 libnetfilter-acct1 libnettle4 libnfnetlink0 libp11-kit0 libpsl0 libtasn1-6
I: Checking component main on http://ftp.us.debian.org/debian...
I: Retrieving acl 2.2.52-2
I: Validating acl 2.2.52-2
/...skipped output.../
I: Extracting liblzma5...
I: Extracting zlib1g...
W: Failure trying to run: chroot /mnt/deb dpkg-deb -f /var/cache/apt/archives/dpkg_1.17.27_amd64.deb Version
W: See /mnt/deb/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /mnt/deb mount -t proc proc /proc
W: See /mnt/deb/debootstrap/debootstrap.log for details
The debootstrap.log file contains the following:
Quote:
dpkg-deb (subprocess): unable to execute tar (tar): No such file or directory
dpkg-deb: error: subprocess tar returned error exit status 2
dpkg-deb (subprocess): unable to execute rm command for cleanup (rm): No such file or directory
dpkg-deb: error while cleaning up:
subprocess rm command for cleanup returned error exit status 2
chroot: failed to run command 'mount': No such file or directory
After that I followed the next instruction (3.4.1): chrooted and tried to install makedev, which produced the following error:
Code:
[root /]# LANG=C.UTF-8 chroot /mnt/deb /bin/bash
I have no name!@duo:/# apt-get
bash: apt-get: command not found
I for one am failing to see why using an installer to get it on the machine is not an option.
Well, the debootstrap way of installing is in the official manual and I assumed that it would be much easier: download deboostrap, unpack it, copy with it the initial system, do basic configuration and voila. But as I was told on another forum by a knowledgeable Debian user, this way seems to work only when the "existing Linux distribution" is Debian itself. He tried to use deboostrap under CentOS, and it's failed as well.
Well, the debootstrap way of installing is in the official manual and I assumed that it would be much easier: download deboostrap, unpack it, copy with it the initial system, do basic configuration and voila. But as I was told on another forum by a knowledgeable Debian user, this way seems to work only when the "existing Linux distribution" is Debian itself. He tried to use deboostrap under CentOS, and it's failed as well.
I've successfully done it with Fedora. If /sbin isn't the issue, than maybe there is something missing for debootstrap to do it's thing. I think these are pretty standard in any Linux distro, but you check that these programs are installed: binutils, perl, tar, wget.
The original problem was that apt-get, mentioned in the official manual, is not present in any folder (including /bin, /sbin, /usr/bin, /usr/sbin) after debootstrap has copied the initial system. Whereas dpkg and derivates (dpkg-query etc.) and all other base Linux binaries are present. Is this an incorrect manual or have I done something incorrectly and apt-get should be present on the debootstrapped system?
I've successfully installed Debian with Arch's debootstrap package.
Seems the problem is when you enter chroot, the PATH variable is inherited from Arch. Unlike Arch, Debian needs more entries in the PATH variable. Before debootstrap is run, you should run this command:
Ah, this seems to be the cause of the problem. Reviewing my original post, where I cited the $PATH of the chrooted environment, I see that it doesn't contain /bin, /sbin and /usr/sbin. Thanks, for the hint!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.