Ubuntu – Ubuntu sits behind a corporate proxy/firewall — how can I install packages

aptfirewallnetworkingPROXY

I have a clean install of Ubuntu 16.04 LTS, but because my machine is running behind a corporate firewall/proxy I cant figure out how to overcome the obstacles. I know we have a corporate proxy, and I have the server/port/username/password to use it, but I dont know if that will solve my problem initially. I will likely still need to add the package source to our white listed IP address list.

to begin though, here is the error messages im getting when trying to install any packages.

sudo apt install software-center
[sudo] password for alilland:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package software-center is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source

E: Package 'software-center' has no installation candidates

where do I begin to untie my knot my company has made?

< —– Edit 1 —–>

When I sudo apt-get update i get the following errors…

alilland@TI-AronLilland:~$ sudo apt-get update
[sudo] password for alilland: 
. . . .
Reading package lists... Done
W: The repository 'http://security.ubuntu.com/ubuntu xenial-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://us.archive.ubuntu.com/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://us.archive.ubuntu.com/ubuntu xenial-updates Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://us.archive.ubuntu.com/ubuntu xenial-backports Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-i386/Packages  407  Authorization Required
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages  407  Authorization Required
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages  407  Authorization Required
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages  407  Authorization Required
E: Some index files failed to download. They have been ignored, or old ones used instead.

< —– Edit 2 —– >

after adding my proxy htttp://[username]:[password]@[ip address]:[port] Im now getting different error messsages, rather than getting 407 Authorization Required im now seeing 403 Forbidden

. . . . 
E: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/main/binary-i386/Packages  403  Forbidden
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial/main/binary-amd64/Packages  403  Forbidden
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-updates/main/binary-amd64/Packages  403  Forbidden
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/xenial-backports/main/binary-amd64/Packages  403  Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.

Best Answer

For temporary proxy setting..I mean only for the current session run below command:

export http_proxy=http://yourproxyaddress:proxyport

To add this proxy setting permanently edit apt.conf file

gksudo gedit /etc/apt/apt.conf

And add below line:

Acquire::http::Proxy "http://yourproxyaddress:proxyport";