LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-19-2017, 11:35 AM   #1
travis82
Member
 
Registered: Feb 2014
Distribution: Bedrock
Posts: 437

Rep: Reputation: 231Reputation: 231Reputation: 231
Problem with chroot


Hi

I'm trying to upgrade Debian sid from Slackware using chroot. Here is the set of commands that I use:
Code:
mount /sid
mount --bind /proc /sid/proc
mount --bind /sys /sid/sys
mount --bind /dev /sid/dev
mount --bind /dev/pts /sid/dev/pts
chroot /sid
It seems that doesn't have access to my internet connection. Here is the output:
Code:
Err:1 http://debian.asis.io/debian sid InRelease
  Temporary failure resolving 'debian.asis.io'
Reading package lists... Done                                      
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
W: Failed to fetch http://debian.asis.io/debian/dists/sid/InRelease  Temporary failure resolving 'debian.asis.io'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Is there any other directory that should be mounted before chroot command?
 
Old 12-19-2017, 11:48 AM   #2
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,263

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by travis82 View Post
Hi

I'm trying to upgrade Debian sid from Slackware using chroot. Here is the set of commands that I use:
Code:
mount /sid
mount --bind /proc /sid/proc
mount --bind /sys /sid/sys
mount --bind /dev /sid/dev
mount --bind /dev/pts /sid/dev/pts
chroot /sid
It seems that doesn't have access to my internet connection. Here is the output:
Code:
Err:1 http://debian.asis.io/debian sid InRelease
  Temporary failure resolving 'debian.asis.io'
Reading package lists... Done                                      
Building dependency tree       
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.
W: Failed to fetch http://debian.asis.io/debian/dists/sid/InRelease  Temporary failure resolving 'debian.asis.io'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Is there any other directory that should be mounted before chroot command?
Copy your /etc/resolv.conf into your /sid/etc/ directory. That's what I do for my Slackware boxes.
 
1 members found this post helpful.
Old 12-19-2017, 11:54 AM   #3
travis82
Member
 
Registered: Feb 2014
Distribution: Bedrock
Posts: 437

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by stormtracknole View Post
Copy your /etc/resolv.conf into your /sid/etc/ directory. That's what I do for my Slackware boxes.
Worked, many thanks. Is this work for Slackware when I am on Debian too?
 
Old 12-19-2017, 12:20 PM   #4
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,263

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by travis82 View Post
Worked, many thanks. Is this work for Slackware when I am on Debian too?
Correct! It will work. However, I wrote this script because Slackware expects for certain things to run at boot, which obviously don't occur when using chroot. From the bits and pieces of things that I have found online, I came up with something like this:

Code:
#!/bin/bash

# These GTK+/pango files need to be kept up to date for
# proper input method, pixbuf loaders, and font support.
if [ -x /usr/bin/update-gtk-immodules ]; then
  echo "Updating gtk.immodules:"
  echo "  /usr/bin/update-gtk-immodules &"
  /usr/bin/update-gtk-immodules > /dev/null 2>&1 &
fi
if [ -x /usr/bin/update-gdk-pixbuf-loaders ]; then
  echo "Updating gdk-pixbuf.loaders:"
  echo "  /usr/bin/update-gdk-pixbuf-loaders &"
  /usr/bin/update-gdk-pixbuf-loaders > /dev/null 2>&1 &
fi
if [ -x /usr/bin/update-pango-querymodules ]; then
  echo "Updating pango.modules:"
  echo "  /usr/bin/update-pango-querymodules &"
  /usr/bin/update-pango-querymodules > /dev/null 2>&1 &
fi
if [ -x /usr/bin/glib-compile-schemas ]; then
  echo "Compiling GSettings XML schema files:"
  echo "  /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas &"
  /usr/bin/glib-compile-schemas /usr/share/glib-2.0/schemas >/dev/null 2>&1 &
fi

update-ca-certificates -f

ldconfig
I run that script as soon as I chroot.sh into my environment as root. I know that for sure you need to run update-ca-certificates -f because otherwise, wget will complain about https certificates. An annoying problem if you are building packages inside your chroot.

Last edited by stormtracknole; 12-19-2017 at 12:21 PM. Reason: spelling
 
1 members found this post helpful.
Old 12-19-2017, 01:33 PM   #5
travis82
Member
 
Registered: Feb 2014
Distribution: Bedrock
Posts: 437

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
No, it didn't work for Slackware. I tried your script too. Slackware couldn't access to internet from Debian.
 
Old 12-19-2017, 01:44 PM   #6
stormtracknole
Senior Member
 
Registered: Aug 2005
Distribution: Slackware, RHEL
Posts: 1,263

Rep: Reputation: 231Reputation: 231Reputation: 231
Quote:
Originally Posted by travis82 View Post
No, it didn't work for Slackware. I tried your script too. Slackware couldn't access to internet from Debian.
Wait, so the host is Debian or Slackware? Something that I have different from you, but not sure that it matters is:
Code:
mount -t proc /proc /sid/proc
Did you make sure that /etc/resolv.conf was copied correctly? You can manually edit it to test things around. I have to say that I have never tested my chroot setup under a different OS other than Slackware. So, quite possibly, Debian could be doing something different with networking.
 
Old 12-19-2017, 02:10 PM   #7
travis82
Member
 
Registered: Feb 2014
Distribution: Bedrock
Posts: 437

Original Poster
Rep: Reputation: 231Reputation: 231Reputation: 231
It works for chrooting to Debian but not vice versa. However, I barely touch that Debian partition, so by your instruction I can upgrade it from Slackware. Thanks again.
 
  


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
chroot install of arch fails, no mounted / in a chroot. Shadow_7 Arch 2 04-20-2015 04:33 PM
Chroot in shell scripts: Ensuring that subsequent commands execute within the chroot Kenny_Strawn Programming 2 05-21-2012 12:25 PM
[SOLVED] in chroot compiled programs do not work in chroot graphit Linux From Scratch 2 04-11-2010 03:04 AM
problem with chroot ef_ Linux - Security 6 10-14-2004 06:46 AM
I have a problem with chroot. vintermann Linux - Software 2 01-31-2004 07:57 AM

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

All times are GMT -5. The time now is 07:47 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