I want to update ubuntu 11.04 throught apt-get. So I added the following lines in apt.conf

export http_proxy=http://username:password@proxyserver.net:port/
export ftp_proxy=http://username:password@proxyserver.netport/

export http_proxy=http://deepak:Deepak@123@

My question is: how do I insert special characters to a username or password?

For instance: my password for proxy is Deepak@123 and it is getting an error.

  • 6
    Er... is that really your password? Oct 18, 2011 at 5:10
  • You can export proxy settings in .bashrc. In apt.conf you have to use this
    – Nemo
    Oct 18, 2011 at 5:16

4 Answers 4


You need to escape special characters. So place a \ in front of the @ like so:

export http_proxy=http://deepak:Deepak\@123@

Alernatively you can also use %40.


Click on

  1. Dash home
  2. Search for System Settings
  3. Select Network
  4. Select Network Proxy
  5. Select Manual method
  6. Set you proxy and port

Kudos You are Done if you set right


If your password or username contains @ you can percent-encode (also referred as URL encoding) it as %40 in the proxy url. For more special characters see here


Even more simple and Reliable!

General Syntax:

sudo {http,https,ftp}_proxy=http://<username>:<password>@<proxy_url/_proxyip>:<port>/ wget --timeout=5 --no-check-certificate http://<website_url>


[root@localhost ~]# sudo {http,https,ftp}_proxy=http://username:password-123@proxy.example.com:6050/ wget --timeout=5 --no-check-certificate http://google.com

{http,https,ftp}_proxy -> http, https, ftp urls. Seperated by comma.

--timeout=5 -> Connection to keep alive in seconds.

-no-check-certificate -> Ignore SSL / Certificate Verification.

--spider -> If you want to test the connectivity without downloading the file.


Online Converter:

Replace special characters with its equivalent hexadecimal unicode. For a list of unicodes refer the website https://unicode-table.com (or) http://unicodelookup.com

Local Converter using Python:

Reference: conversion of password "p@s#w:E" to unicode will be as follows,

@ = %40
$ = %24
# = %23
: = %3A
p@s#w:E = p%40s%23w%3AE


[root@localhost ~]# python -c "import sys, urllib as enc; print enc.quote_plus(sys.argv[1])" "p@s#w:E"



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.