1

Here's what I try :

pi@raspberrypi ~ $ sudo apt-get update

W: Failed to fetch http://archive.raspberrypi.org/debian/dists/wheezy/main/binary-armhf/Packages  401  Unauthorized


pi@raspberrypi ~ $ sudo apt-get install lighttpd

Install these packages without verification [y/N]? y
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libfam0 armhf 2.7.0-17
  401  Unauthorized

I'm given just a couple of the problems I encounter. I'm not allowed more than 2 links and the error messages contain links.

Any help would be super.

Final goal is to be able to take a pic using my webcam while I'm on vacation..

  • Problem was that I was at work, where an arbitrary device cannot simple access the internet without authentication. I just realized this.. So, a test would be curl -D - <google http> which comes back with HTTP/1.0 302 Moved Location: x.y.z.a:15871/cgi-bin/authenticate.cgi?ws-session=2778187179 Pragma: no-cache Cache-Control: no-cache itle></head> <body bgcolor="#ffffff"> <center><h1><font color="#ff0000">HTTP Error 403 - Forbidden</font></h1> <b>You do not have permission to access the document or program you requested. </b></center> </body></html> – azpiuser Jun 9 '13 at 22:18
  • 1
    Then, you can do : curl -D - --basic -u user.name x.y.z.a:15871/cgi-bin/authenticate.cgi?ws-session=2778187179 Enter host password for user 'user.name' : HTTP/1.0 302 Moved Content-Length: 0 Location: <google> And then, all is good – azpiuser Jun 9 '13 at 22:19
  • use nginx instead. it is as lightweight but much more powerful than lighhtpd... apt-get install nginx – Piotr Kula Jun 10 '13 at 16:02
  • I have previously tried to use lighttpd but the configuration file kept deleting itself. I would recommend using thttpd if you want to keep it simple. Use apt-get install thttpd, make a folder called www in your home directory then use thttpd -d ~/www to start your server! Put make a file called index.html with some html code it to get started. Enter the ip of your pi into your brower to view the page. – Matthew Aug 10 '13 at 13:06
1

It looks like your internet connection work through a proxy device that requires authentication. You have to set up proxy credentials for connection. For apt you can set up the authentication just like this :

# Create a proxy config file for proxy if does not exist
sudo nano /etc/apt/apt.conf.d/01proxy

# Add the following line into 01proxy config file
Acquire::http::proxy "http://user:pass@host:port/";

Then try apt-get update; apt-get install lighttpd

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.