I typed the command
sudo gedit /etc/bash.bashrc
And typed the export statement as
export http_proxy="username: password@proxyhost:port"
But after saving it gave a warning message as
set document meta data failed
gedit spell language not supported
gedit encoding not supported
gedit position not supported
When I try apt-get update it still shows proxy authentication error