LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   E: Unable to locate package openvpn (https://www.linuxquestions.org/questions/linux-newbie-8/e-unable-to-locate-package-openvpn-4175511817/)

CrypticUser 07-21-2014 02:42 PM

E: Unable to locate package openvpn
 
So I am trying to install openvpn on Debian 7.5.0. However when I do
Code:

apt-get install openvpn
as the root user this comes up:

Code:

Reading package lists...Done
building dependency tree
Reading state information...Done
E: Unable to locate package openvpn

Tanks in advance for the help :)

273 07-21-2014 03:04 PM

Is your computer connected to the internet and have you run "apt-get update" and what is in your sources.list?
A quick look at the Debian Packages site shows openvpn should be available for Wheezy (and Jessie and Sid).
https://packages.debian.org/wheezy/openvpn

CrypticUser 07-21-2014 03:07 PM

Im pretty new with linux, so I dont know how to view contents of sources.list. Yes, I have tried apt-get update

CrypticUser 07-21-2014 03:22 PM

Quote:

Originally Posted by 273 (Post 5207494)
Is your computer connected to the internet and have you run "apt-get update" and what is in your sources.list?
A quick look at the Debian Packages site shows openvpn should be available for Wheezy (and Jessie and Sid).
https://packages.debian.org/wheezy/openvpn

Contents of sources.list was:

deb cdrom:[Debian GNU/Linux 7 _Wheezy_ - Official Snapshot i386 LIVE/INSTALL Binary 20140505-05:08]/ wheezy main

273 07-21-2014 03:29 PM

How did you install Debian? It seems that apt is only looking at the CDROM for packages so if the packages is not on the CDROM (and many are not) you won't be able to install it at all.
The file /etc/apt/sources.list tells apt where to look for packages on the internet:
https://wiki.debian.org/SourcesList
If you don't have your machine connected to the internet (you didn't answer that question) you will have to find some other way of downloading packages.

CrypticUser 07-21-2014 03:31 PM

My machine is connected to the internet and I installed Debian from a CD. Even if I remove the CD the package is unlocatable

273 07-21-2014 03:49 PM

Your sources.list doesn't contain any software sources, so apt doesn't know where to look for software. It should look something like the following:
https://wiki.debian.org/SourcesList#...7_.22Wheezy.22
Ideally you would point to Debian mirrors nearer to you but that should at least allow you to install software.

CrypticUser 07-21-2014 03:59 PM

Quote:

Originally Posted by 273 (Post 5207515)
Your sources.list doesn't contain any software sources, so apt doesn't know where to look for software. It should look something like the following:
https://wiki.debian.org/SourcesList#...7_.22Wheezy.22
Ideally you would point to Debian mirrors nearer to you but that should at least allow you to install software.

How do I do that?

273 07-21-2014 04:07 PM

You edit the file /etc/apt/sources.list to contain those lines then run apt-get update. I tend to comment out the line for the CDROM, but you don't have to, by adding "#" (without the quotes) at the beginning of the line.
You can edit the file with any editor you like but it must be done as root.

CrypticUser 07-21-2014 04:32 PM

Quote:

Originally Posted by 273 (Post 5207518)
You edit the file /etc/apt/sources.list to contain those lines then run apt-get update. I tend to comment out the line for the CDROM, but you don't have to, by adding "#" (without the quotes) at the beginning of the line.
You can edit the file with any editor you like but it must be done as root.

Ok thanks a lot I will try this asap.

CrypticUser 07-22-2014 01:32 PM

Quote:

Originally Posted by 273 (Post 5207518)
You edit the file /etc/apt/sources.list to contain those lines then run apt-get update. I tend to comment out the line for the CDROM, but you don't have to, by adding "#" (without the quotes) at the beginning of the line.
You can edit the file with any editor you like but it must be done as root.

So I just finished editing the file to contain those lines and I commented the cdrom line with a "#" however than it says that those lines were commented because they couldnt be veryfied. Did my research and it turns out that that happens because I did not configure the network while installing debian. So I found a site that generated the "sources.list" file for canadians tried that and the same error comes again

Code:

E: Unable to locate package openvpn

273 07-22-2014 01:38 PM

Once you have edited the file you should run "apt-get update" to make sure that apt knows which packages are available (this may take a while first time it is run) then run "apt-get upgrade" to ensure that you install any bugfixes and security updates (this, again, may take a while). If both those commands work you should be good to go installing openvpn. If those commands return any errors then let use know here.

CrypticUser 07-22-2014 02:13 PM

Quote:

Originally Posted by 273 (Post 5207962)
Once you have edited the file you should run "apt-get update" to make sure that apt knows which packages are available (this may take a while first time it is run) then run "apt-get upgrade" to ensure that you install any bugfixes and security updates (this, again, may take a while). If both those commands work you should be good to go installing openvpn. If those commands return any errors then let use know here.

Ran "apt-get update" still didnt work. I returned to the website that generated the "sources.list" file and added security and updates. Then I ran "apt-get update" and it worked so after that I was able to do "apt-get openvpn" without any further problems.

Thank you very much for your help it was much apreciated :)

273 07-22-2014 02:22 PM

Glad to hear you got it working and thanks -- I'll have to remember this needs doing if the install is done without setting up network.
Remember to mark the thread solved also, by clicking the link towards the top of the page.

CrypticUser 07-22-2014 03:29 PM

Quote:

Originally Posted by 273 (Post 5207979)
Glad to hear you got it working and thanks -- I'll have to remember this needs doing if the install is done without setting up network.
Remember to mark the thread solved also, by clicking the link towards the top of the page.

No problem also here is the link to the "sources.list" file. http://debgen.simplylinux.ch/ Have a great day :)


All times are GMT -5. The time now is 11:17 AM.