LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-30-2017, 11:00 PM   #1
alberg
Member
 
Registered: Jun 2016
Distribution: Arch, Slackware
Posts: 47

Rep: Reputation: Disabled
"Error: apt-get not found" during installing Debian


Hello,

I'm trying to install Debian 8.7 (amd64) from an existing Linux installation (Arch Linux), following the official instructions on the website:

https://www.debian.org/releases/stab...en#idp73163696

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
The PATH is the following:

Quote:
/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
No directories in the PATH contains apt-get.

Could someone advise why the warnings and the error happened?

Thanks.

Last edited by alberg; 04-01-2017 at 06:26 PM. Reason: solved
 
Old 03-31-2017, 10:17 AM   #2
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,124
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Try adding /sbin in your PATH variable:

Code:
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 
Old 03-31-2017, 10:37 AM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Quote:
Originally Posted by replica9000 View Post
Try adding /sbin in your PATH variable:

Code:
# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
Code:
~$ locate apt-get
/usr/bin/apt-get
Doubt it since it is located in /usr/bin and I for one am failing to see why using an installer to get it on the machine is not an option.
 
Old 03-31-2017, 10:57 AM   #4
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,124
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by HappyTux View Post
Code:
~$ locate apt-get
/usr/bin/apt-get
Doubt it since it is located in /usr/bin and I for one am failing to see why using an installer to get it on the machine is not an option.
I've seen debootstrap fail before when /sbin is not in the PATH.

I personally prefer to use debootstrap to install Debian on my machines instead of using an installer.
 
Old 03-31-2017, 12:44 PM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
archlinux doesn't use /sbin and /bin anymore, everything's in /usr/bin and /sbin and /bin are just symlinks to /usr/bin.
 
Old 03-31-2017, 11:39 PM   #6
alberg
Member
 
Registered: Jun 2016
Distribution: Arch, Slackware
Posts: 47

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by HappyTux View Post
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.
 
Old 04-01-2017, 04:35 PM   #7
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,124
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
Quote:
Originally Posted by alberg View Post
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.
 
Old 04-01-2017, 05:24 PM   #8
alberg
Member
 
Registered: Jun 2016
Distribution: Arch, Slackware
Posts: 47

Original Poster
Rep: Reputation: Disabled
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?
 
Old 04-01-2017, 06:13 PM   #9
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
It should be in /usr/bin. Did the "/...skipped output.../" portion of the output that you omitted mention that it had retrieved apt?
 
1 members found this post helpful.
Old 04-01-2017, 06:25 PM   #10
alberg
Member
 
Registered: Jun 2016
Distribution: Arch, Slackware
Posts: 47

Original Poster
Rep: Reputation: Disabled
@hydrurga

Thanks! Will recheck what could have been done incorrectly more attentevely.
 
Old 04-03-2017, 04:31 PM   #11
replica9000
Senior Member
 
Registered: Jul 2006
Distribution: Debian Unstable
Posts: 1,124
Blog Entries: 2

Rep: Reputation: 260Reputation: 260Reputation: 260
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:
Code:
export PATH="$PATH:/bin:/sbin:/usr/sbin"
 
Old 04-03-2017, 07:01 PM   #12
alberg
Member
 
Registered: Jun 2016
Distribution: Arch, Slackware
Posts: 47

Original Poster
Rep: Reputation: Disabled
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!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] X: "loading extension glx" "no screens found" "fatal server error" (w/ nvidia driver) Geremia Slackware 7 12-29-2014 11:00 AM
Installing Debian etch with usb pen - "ethernet card not found" alfmarius Linux - Networking 3 06-24-2008 09:51 AM
Help installing progs in DEBIAN (Mepis) using "apt-get" or other suitable prog craftybytes Linux - Newbie 8 03-26-2006 07:46 PM
"Skin not found" problem from installing Mplayer in Debian/Sarge !!! Blue Jacket Linux - Software 2 10-05-2005 01:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration