Tuesday, March 20, 2012

Setting up apt-get to use a http-proxy

This is a temporary method that you can manually use each time you want to use apt-get through a http-proxy. This method is useful if you only want to temporarily use a http-proxy. 

Enter this line in the terminal prior to using apt-get (substitute your details for yourproxyaddress and proxyport).
 
export http_proxy=http://yourproxyaddress:proxyport
 
 
Done!!! 
 
 
Option 2:
 
Type in Terminal

gedit /etc/apt/apt.conf


(root authentication is required)

Now type this two lines in the text file:

Acquire::http::Proxy "http://username:password@proxyaddress:port";
Acquire::ftp::Proxy "ftp://username:password@proxyproxyaddress:port";

Save and Done!

Try this in terminal now, 

sudo apt-get update


You will see your ubuntu getting updated!
 

Thursday, March 8, 2012

Error: Failed to fetch in Linux


Error:

Failed to fetch

Example:

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/oneiric/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.170 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/oneiric-updates/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.170 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/oneiric-backports/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.170 80]

W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/oneiric-security/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.170 80]

W: Some index files failed to download. They have been ignored, or old ones used instead.


Solution:

Goto --> Setting --> Software Resources --> Under Ubuntu Software tab ---> Choose a Download Server --> Click on Select Best Server --> Wait for system to search for a best server  --> Click ok.

Check this in terminal:


sudo apt-get update


Done!!!

Running Ubuntu as Root


In Linux (and Unix in general), there is a SuperUser named Root. The Windows equivalent of Root is Administrators group. The SuperUser can do anything and everything, and thus doing daily work as the SuperUser can be dangerous. You could type a command incorrectly and destroy the system. Ideally, you run as a user that has only the privileges needed for the task at hand. In some cases, this is necessarily Root, but most of the time it is a regular user. 

By default, the Root account password is locked in Ubuntu. This means that you cannot login as Root directly or use the su command to become the Root user. 


To simulate yourself as root, use:

sudo -i
 

To enable the Root account (i.e. set a password) use:
 
sudo passwd root