LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-17-2008, 11:35 PM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Rep: Reputation: 78
apt-get can't install ANYTHING


Something appears to have gone awry on my dev server here on my home network. No matter what I try to install, apt-get always fails:
Code:
debian2:/home# apt-get install netselect
Reading package lists... Done
Building dependency tree... Done
Package netselect 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 netselect has no installation candidate
debian2:/home# apt-get install php5
Reading package lists... Done
Building dependency tree... Done
Package php5 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 php5 has no installation candidate
It doesn't matter what it is that I try to install, NOTHING will install. I had originally used this tutorial to do the 'perfect etch setup'. It has been working fine for months now and I had some problems today trying to get some PHP stuff to run so I uninstalled apache and php and was trying to reinstall.

I have Debian etch installed:
Code:
debian2:/home# uname -a
Linux debian2.home.jaith.net 2.6.18-6-486 #1 Tue Jun 17 20:57:16 UTC 2008 i686 GNU/Linux
I figured something might be wrong with my sources.list file so here it is:
Code:
#
# deb cdrom:[Debian GNU/Linux 4.0 r2 _etch_ - Official i386 NETINST Binary-1 20080103-00:44]/ lenny contrib main

#deb cdrom:[Debian GNU/Linux 4.0 r2 _etch_ - Official i386 NETINST Binary-1 20080103-00:44]/ lenny contrib main

deb http://ftp.us.debian.org/debian/ etch main
deb-src http://ftp.us.debian.org/debian/ etch main

deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib
I have even tried changing my sources.list to reference lenny instead of etch but it doesn't even upgrade the dist.

WTF?
 
Old 11-17-2008, 11:42 PM   #2
phantom_cyph
Senior Member
 
Registered: Feb 2007
Location: West Africa
Distribution: Slackware/Debian (when necessary)
Posts: 2,443
Blog Entries: 1

Rep: Reputation: 105Reputation: 105
Take a look at this thread in the Debian forum. Debian users have been posting their sources here for a while.
Another thing is, if you use aptitude instead of apt-get, it might work better and work faster.
 
Old 11-18-2008, 01:49 AM   #3
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
I have tried nearly half of those debian source list options and nothing seems to help. I run apt-get update every time and still I get something like this:
Code:
debian2:/# apt-get install php-pear
Reading package lists... Done
Building dependency tree... Done
Package php-pear 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 php-pear has no installation candidate
I have had a bit of luck with aptitude but it crashes when i try to install php-gd. Also, it is a REAL pain to install lots of packages at once. apt-get makes it easy to do stuff like this (from the tutorial i linked above):
Code:
apt-get install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
I'm really stumped here.
 
Old 11-18-2008, 09:23 AM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
so when you do apt-get update does it update successfully ?
IT looks like it doesn't have a complete list of packages from your source..

try this..
apt-cache policy php-pear

Where does the output say this package should come from ?


On a side note...
I'm curious why you think aptitude is more difficult that apt-get..
Your example for instance, using aptitude instead of apt-get would be..
Code:
aptitude install libapache2-mod-php5 php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-json php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
How is that any more difficult that apt-get ? the only thing that has changed is the first word in the line, and you type one additional character..

aptitude handles dependency resolution better than apt-get, and is the recommended method of updating a Debian system since the release of Etch (per the devs), but you can make your own call to switch or stick with apt-get. keep in mind it is not any more difficult to use, so that reasoning doesn't fly .
Aptitude command line reference

IF you do decide to switch to aptitude from apt-get make sure your first command is aptitude keep-all you only need to do that once, then you should use aptitude exclusively from there forward.
 
Old 11-18-2008, 09:34 AM   #5
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Do you have an /etc/apt/apt.conf file or an /etc/apt/prefereces file? If so, what's in them?

Aptitude rules!
 
Old 11-18-2008, 02:43 PM   #6
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
I managed to get php-pear installed using aptitude. I had NO IDEA aptitude was command-line capable. What happens when you need to choose between different versions of a package? like etch11 vs. etch13? Someone had told me it was GUI style so I had been manually selecting everything. How about php5-gd?
Code:
debian2:~# apt-cache policy php5-gd
php5-gd:
  Installed: (none)
  Candidate: (none)
  Version table:
     5.2.0-8+etch13 0
         -1 http://http.us.debian.org stable/main Packages
         -1 http://security.debian.org stable/updates/main Packages
     5.2.0-8+etch11 0
        100 /var/lib/dpkg/status
or apache2?
Code:
debian2:~# apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: (none)
  Version table:
     2.2.3-4+etch6 0
         -1 http://http.us.debian.org stable/main Packages

trying to install php5-gd with aptitude also fails:
Code:
debian2:~# aptitude install php5-gd
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
No candidate version found for php5-gd
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
I don't have an apt.conf but I do have a preferences file. Here's the contents:
Code:
Package: *
Pin: release o=Debian,a=stable
Pin-Priority: 900
Package: *
Pin: release o=Debian
Pin-Priority: -1
 
Old 11-18-2008, 02:45 PM   #7
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
Oh...and yes, apt-get update does appear to run successfully:
Code:
debian2:~# apt-get update
Get:1 http://http.us.debian.org stable Release.gpg [386B]
Get:2 http://security.debian.org stable/updates Release.gpg [189B]
Hit http://http.us.debian.org stable Release
Hit http://security.debian.org stable/updates Release
Ign http://http.us.debian.org stable/main Packages/DiffIndex
Ign http://security.debian.org stable/updates/main Packages/DiffIndex
Ign http://http.us.debian.org stable/contrib Packages/DiffIndex
Ign http://http.us.debian.org stable/non-free Packages/DiffIndex
Ign http://security.debian.org stable/updates/contrib Packages/DiffIndex
Ign http://security.debian.org stable/updates/non-free Packages/DiffIndex
Ign http://http.us.debian.org stable/main Sources/DiffIndex
Ign http://http.us.debian.org stable/contrib Sources/DiffIndex
Ign http://http.us.debian.org stable/non-free Sources/DiffIndex
Hit http://http.us.debian.org stable/main Packages
Hit http://security.debian.org stable/updates/main Packages
Hit http://http.us.debian.org stable/contrib Packages
Hit http://security.debian.org stable/updates/contrib Packages
Hit http://http.us.debian.org stable/non-free Packages
Hit http://http.us.debian.org stable/main Sources
Hit http://http.us.debian.org stable/contrib Sources
Hit http://http.us.debian.org stable/non-free Sources
Hit http://security.debian.org stable/updates/non-free Packages
Fetched 2B in 1s (2B/s)
Reading package lists... Done
 
Old 11-18-2008, 03:37 PM   #8
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Code:
Package: *
Pin: release o=Debian,a=stable
Pin-Priority: 900
Package: *
Pin: release o=Debian
Pin-Priority: -1
Code:
debian2:~# apt-cache policy apache2
apache2:
  Installed: (none)
  Candidate: (none)
  Version table:
     2.2.3-4+etch6 0
         -1 http://http.us.debian.org stable/main Packages
I'm starting to see a connection...

where the same command on my system shows a much different picture for the package priorities..
Code:
user@it-etch:~$ apt-cache policy apache2
apache2:
  Installed: 2.2.9-10
  Candidate: 2.2.9-10
  Version table:
 *** 2.2.9-10 0
        500 http://ftp.uwsg.indiana.edu lenny/main Packages
        100 /var/lib/dpkg/status

man apt_preferences
Code:
How APT Interprets Priorities
       Priorities (P) assigned in the APT preferences file must be positive or negative integers. They are
       interpreted as follows (roughly speaking):

       P > 1000
           causes a version to be installed even if this constitutes a downgrade of the package

       990 < P <=1000
           causes a version to be installed even if it does not come from the target release, unless the installed
           version is more recent

       500 < P <=990
           causes a version to be installed unless there is a version available belonging to the target release or
           the installed version is more recent

       100 < P <=500
           causes a version to be installed unless there is a version available belonging to some other distribution
           or the installed version is more recent

       0 < P <=100
           causes a version to be installed only if there is no installed version of the package

       P < 0
           prevents the version from being installed
Code:
       the Origin: line
           names the originator of the packages in the directory tree of the Release file. Most commonly, this is
           Debian. Specifying this origin in the APT preferences file would require the line:

               Pin: release o=Debian
so your preference of -1 for any packages that come from Debian (with no specific archive selected) is telling the system do NOT install these packages... That looks like the reason apt won't install anything, because your preferences file is set to Not allow anything to be installed.




way to nail it rickh

Last edited by farslayer; 11-18-2008 at 03:38 PM.
 
Old 11-18-2008, 03:51 PM   #9
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Quote:
way to nail it rickh
When there is absolutely no reason for it not to work, I've found that is a pretty good bet.

Code:
debian2:~# apt-cache policy php5-gd
php5-gd:
  Installed: (none)
  Candidate: (none)
  Version table:
     5.2.0-8+etch13 0
         -1 http://http.us.debian.org stable/main Packages
         -1 http://security.debian.org stable/updates/main Packages
     5.2.0-8+etch11 0
        100 /var/lib/dpkg/status
You'd have figured it out pretty quickly yourself when you started thinking about that -1 priority on php5-gd

Last edited by rickh; 11-18-2008 at 03:56 PM.
 
Old 11-18-2008, 04:39 PM   #10
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
You guys are amazing. Thanks so much for your help.

As you might have surmised, I'm not the debian master configurator. It is my understanding according to that man page that the preferences file 'overrides the priorities that APT assigns to package versions by default, thus giving the user control over which one is selected for installation.' Let's re-examine my preferences:
Code:
Package: *
Pin: release o=Debian,a=stable
Pin-Priority: 900
Package: *
Pin: release o=Debian
Pin-Priority: -1
I understand that o=Debian restricts the descriptor to any packages with origin=Debian and a=stable restricts the descriptor to a stable archive. That said, any packages with origin=Debian and archive=stable get the go-ahead value of 900 in my file.

On the other hand, ALL OTHER packages are not installed. Am I to understand that php5-gd is no longer considered stable? Or does it not originate from Debian? These concepts of Archive/Component/Origin/Label are pretty foreign to me. Any tips for a better apt preferences file would be much appreciated. My goal here is really just to have my dev server be a good, stable LAMP machine with current versions of Apache, MySQL, and PHP. Ideally, I'd like the latest PHP5, the latest MySQL release (is 6 out already???), and a version of apache that is as up-to-date and advanced as possible without introducing multi-threading problems due to the mongrel nature of PHP5.

EDIT:
I've also been looking to install the PHP ID3 functions and I'd like the latest version of Ming too. I have ming working but I installed php-getid3 but functions like id3_get_tag are still not defined. Yes, I did restart apache.

Last edited by sneakyimp; 11-18-2008 at 04:49 PM.
 
Old 11-18-2008, 04:49 PM   #11
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,247
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
your -1 is overriding the 900..

if there was an archive such as testing, unstable or experimental attached to that -1 entry it would make sense.

Personally I would just remove that section (the bottom 3 lines of the file) all together since it is not needed with a vanilla sources list.

or you could do as the example shows..
Code:
The following APT preferences file will cause APT to assign a priority higher than the default (500) to all
package versions belonging to a stable distribution and a prohibitively low priority to package versions
belonging to other Debian distributions.

           Explanation: Uninstall or do not install any Debian-originated
           Explanation: package versions other than those in the stable distro
           Package: *
           Pin: release a=stable
           Pin-Priority: 900

           Package: *
           Pin: release o=Debian
           Pin-Priority: -10
Remove the origin of Debian from your first entry.

Last edited by farslayer; 11-18-2008 at 04:51 PM.
 
Old 11-18-2008, 04:52 PM   #12
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Pinning is a big subject, you probably don't need it. Just delete the /etc/apt/preferences file, and study the concept at your leisure. Whoever set that file up, just didn't want nobody messing with nothin'. If it is now your system to mess with. Start studying. It's not rocket science, but you can do a better job of learning it on your own, than having us try to explain it in a paragraph or two.

When you honestly believe you have identified a need for it, ask specific questions. The man page excerpt farslayer posted includes basically everything you need to know.
 
Old 11-18-2008, 05:01 PM   #13
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
Changing the pref file back to the example didn't help as far as installing gd. Removing those last 3 lines did. I now have gd installed and it's working. Thanks for that! I think apt will likely be more cooperative now.

Agreed that pinning is something worth studying and asking you for paragraph synposis is not fair. farslayer's recommendation to remove last 3 lines seems to be working.

Still having problems getting id3 functions visible in php. Any thoughts would be appreciated.

Last edited by sneakyimp; 11-18-2008 at 05:39 PM. Reason: spelling
 
Old 11-18-2008, 05:40 PM   #14
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,055

Original Poster
Rep: Reputation: 78
OK I managed to get id3 functions installed using 'pecl install id3' and then creating a id3.ini file in /etc/php5/conf.id that has extension=id3.so.

THANKS so much for your help. I lost a whole day to this yesterday and you guys really helped me put it to bed.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apt-get update and apt-get install problem please solve it. regent_royal Linux - Newbie 11 06-26-2008 08:38 AM
Is there knoppix-like distro, that we can: apt-get update; apt-get install programs ? frenchn00b Linux - Distributions 7 04-28-2008 03:06 PM
LXer: Apt-get remove SUSE; apt-get install Etch LXer Syndicated Linux News 0 05-26-2007 08:46 PM
Question about 'apt-get upgrade' versus 'apt-get install' eur0dad Red Hat 8 07-16-2006 06:41 PM
knoppix 3.4 and no apt-setup how to fix info install apt-file + base-config maximalred Debian 0 10-16-2004 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration