Rav-Singh Posted June 19, 2013 Posted June 19, 2013 Hello, We have recently had some Raspberry Pi delivered and I have been given the task of getting them ready in order to show ICT teachers what they can do. Unfortunately I am not able to download anything at all, I thought I'd start by installing Chrome for Raspberry Pi by running the "sudo apt-get install chromium" command but it failed with the following error "unable to connect to mirrordirector.raspbian.org:http:". I have attached a picture of the error. Please help Rav
Steve21 Posted June 19, 2013 Posted June 19, 2013 If you're doing this from within a school network did you set any of the proxies on the Pi? Else it wouldn't be able to connect through to the internet. Steve
mats Posted June 19, 2013 Posted June 19, 2013 Are you behind a proxy? If so, you'll need something like 'export http_proxy="http://proxyname:port" and search this forum for apt.conf which will also want a proxy setting which I can't remember off the top of my head. 1
Rav-Singh Posted June 20, 2013 Author Posted June 20, 2013 Hi Steve, Many thanks for getting back to me. I have set the proxy using the GUI interface (startx command) and am able to use the internet. Im assuming this should also work using the command line interface? or are there additional setting for this? Many Thanks Rav Singh
Rav-Singh Posted June 20, 2013 Author Posted June 20, 2013 Thanks Mat will try this and get back to you. Cheers Fella !
Rav-Singh Posted June 20, 2013 Author Posted June 20, 2013 Are you behind a proxy? If so, you'll need something like 'export http_proxy="http://proxyname:port" and search this forum for apt.conf which will also want a proxy setting which I can't remember off the top of my head. Hi Mats, Where would i add 'export http_proxy="http://proxynameport" ? Is this the right command 'export http_proxy="http://eduproxy.bgfl.org80"? ('eduproxy.bgfl.org' being our proxy and '80' being the port) also can you point me in the right direction of the apt.conf forum as I cant find it. Thanks Rav Singh
mats Posted June 20, 2013 Posted June 20, 2013 At the command line - export http_proxy="http://eduproxy.bgfl.org/" You don't need the port number if you're using port 80. That gets wget working. To get apt-get using the proxy, create /etc/apt/conf and add this line Acquire::http::Proxy "http://eduproxy.bgfl.org"; This worked on an ubuntu 12.04 machine - I think the RaspPi is also debian based so you're in with a chance. Failing that, have you tried the pi forums? 1
Rav-Singh Posted June 20, 2013 Author Posted June 20, 2013 (edited) At the command line - export http_proxy="http://eduproxy.bgfl.org/" You don't need the port number if you're using port 80. That gets wget working. To get apt-get using the proxy, create /etc/apt/conf and add this line Acquire::http::Proxy "http://eduproxy.bgfl.org"; This worked on an ubuntu 12.04 machine - I think the RaspPi is also debian based so you're in with a chance. Failing that, have you tried the pi forums?[/QUOT Hi Mats, Sorry I should have said Im new to Linux, were do I create ' /etc/apt/conf' as ive tried to run it at the command promt with no joy, I get an error '-bash: create: command not found' Thanks Rav Edited June 20, 2013 by Rav-Singh
Rav-Singh Posted June 20, 2013 Author Posted June 20, 2013 At the command line - export http_proxy="http://eduproxy.bgfl.org/" You don't need the port number if you're using port 80. That gets wget working. To get apt-get using the proxy, create /etc/apt/conf and add this line Acquire::http::Proxy "http://eduproxy.bgfl.org"; This worked on an ubuntu 12.04 machine - I think the RaspPi is also debian based so you're in with a chance. Failing that, have you tried the pi forums?[/QUOT Hi Mats, Sorry I should have said Im new to Linux, were do I create ' /etc/apt/conf' as ive tried to run it at the command promt with no joy, I get an error '-bash: create: command not found' Thanks Rav I Have now been able to get to "/etc/apt/" by using the "cd /etc/apt" command however cant work out how to create "conf", sorry to be a pain! Thanks Rav
caffrey Posted June 20, 2013 Posted June 20, 2013 (edited) you need to :- sudo nano /etc/apt/apt.conf In there you have Acquire::http::proxy "YOURPROXY/"; ctrl-x to escape then save Edited June 21, 2013 by plexer 2
Rav-Singh Posted June 21, 2013 Author Posted June 21, 2013 (edited) you need to :- sudo nano /etc/apt/apt.conf In there you have Acquire::http::proxy "YOURPROXY/"; ctrl-x to escape then save Hi Caffrey thank you for your reply, i have carried out the above but still had no joy, I think i may be doing something wrong. i have tried the commands as follows- acquire::http:proxy "eduproxy.bgfl.org/"; no joy acquire::http:proxy eduproxy.bgfl.org/; no joy Any ideas? Thanks Rav Edited June 21, 2013 by plexer
plexer Posted June 21, 2013 Posted June 21, 2013 Worked great for me to get apt working through a proxy for updates. Ben
mats Posted June 21, 2013 Posted June 21, 2013 Capitals matter in Unix-like operating systems. sudo nano /etc/apt/apt.conf < this starts the nano editor on file /etc/apt/apt.conf (some systems work with /etc/apt/conf) Insert this line Acquire::http::Proxy "http://eduproxy.bgfl.org:80"; Press ctrl x and save the file. Try apt-get update again 1
Rav-Singh Posted June 21, 2013 Author Posted June 21, 2013 Capitals matter in Unix-like operating systems. sudo nano /etc/apt/apt.conf < this starts the nano editor on file /etc/apt/apt.conf (some systems work with /etc/apt/conf) Insert this line Acquire::http::Proxy "http://eduproxy.bgfl.org:80"; Press ctrl x and save the file. Try apt-get update again Thanks Mats for your reply, I have entered the command and have managed to pull some files down but others have failed, is this normal? I have attached a picture please let me know what you think. Many Thanks Rav Singh
Rav-Singh Posted June 21, 2013 Author Posted June 21, 2013 Thanks Mats for your reply, I have entered the command and have managed to pull some files down but others have failed, is this normal? I have attached a picture please let me know what you think. Many Thanks Rav Singh P.S I got "apt-get update" working and is update now, I had to change user to root by using "sudo bash" command. Thanks again Mats
Rav-Singh Posted June 21, 2013 Author Posted June 21, 2013 P.S I got "apt-get update" working and is update now, I had to change user to root by using "sudo bash" command. Thanks again Mats Great Success !!!! Ive just installed Chromium !!! After running the "apt-get update" it installed the update with no errors! I then ran "sudo apt-get install chromium" and it to installed effectively !! Massive thank you to everyone ! Cheers Gents!!! Rav Singh
mats Posted June 21, 2013 Posted June 21, 2013 So, a quick explanation of what happened. When you run "apt-get update" as user pi (your normal login user), apt-get can't write the files it needs to write because it's just a normal user. When you run "sudo apt-get update", it runs the same program as the super-user aka root, who can write where it wants. Normal stuff - use the pi user. Admin stuff - sudo. When you type "sudo bash", it runs bash - the command line interpreter - as the super user, with its almighty powers. HTH, Mat 1
Rav-Singh Posted June 21, 2013 Author Posted June 21, 2013 So, a quick explanation of what happened. When you run "apt-get update" as user pi (your normal login user), apt-get can't write the files it needs to write because it's just a normal user. When you run "sudo apt-get update", it runs the same program as the super-user aka root, who can write where it wants. Normal stuff - use the pi user. Admin stuff - sudo. When you type "sudo bash", it runs bash - the command line interpreter - as the super user, with its almighty powers. HTH, Mat Got it ! Thanks again for all your support and advice Mats, it is greatly appreciated! Cheers Rav
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now