Ubuntu 12.04: apt-get can't parse repository url if username contains @ ('at' sign)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Reporting a bug as suggested in https:/
I attached Vagrantfile that reproduces the problem in which I try to add the following repositories to apt:
deb https:/
deb https:/
---
For both URLs the error message on Ubuntu 12.04 is the same:
Failed to fetch https:/
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
$ apt-get --version
apt 0.8.16~
---
On Ubuntu 14.04 the URL is parsed correctly as in both cases the following error message is printed:
Failed to fetch https:/
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04.4 LTS
Release: 14.04
Codename: trusty
$ apt-get --version
apt 1.0.1ubuntu2 for amd64 compiled on Jan 12 2016 20:13:58
For security reasons I prefer not to disclose the real repository URL, but it works on Ubuntu 14.04 and doesn't work on 12.04.
Changed in apt (Ubuntu): | |
importance: | Undecided → Low |
With a quick test I can't reproduce this with %40 as encoding, but I will try some more later.
I would highly recommend to NOT write your authentication information in sources.list through. Beside the parsing problem you seem to encounter, you can't reasonably change the permission of the file (it has to be world-readable to have apt-based tools in a functional state).
Instead, create the file /etc/apt/auth.conf and and use the netrc(5) format to specify the authentication tokens. You can change the access permissions to this file to your liking (600 for example) as a bonus.
Example: echo 'machine example.org\nlogin star\npassword hunter2' > /etc/apt/auth.conf