Electric Sheep, help with Source code install.

Asked by Pen16

I am trying to install electric sheep on my newly updated ubuntu 11.10 since in come with no screensaver.

My problem is i have install the packages from the software center but dont know how access it or even if its there anyways. So i went back to the website for electric sheep and am trying the source code install but the problem is, i have no idea what im doing.

This is what is said:

Otherwise, the preferred way to install it is from source. Get it from http://code.google.com/p/electricsheep/source/checkout and then run ./autogen.sh. then install the latest wxWidgets 2.9.1 or later, and then:

CXXFLAGS="`wx-config --cxxflags`" LDFLAGS="`wx-config --libs all`" ./configure
make
sudo make install

It should configure itself to be your screensaver, but you can also run it from the command line just by typing "electricsheep". You can also use "electricsheep-preferences" to configure it.

Ok, so i went to the url and it gave me a directory of files and folders so i copied and pasted into my terminal and it either listed the directory or it installed it all on my system, i have no idea. But the part im stumped on is the 'run ./autogen.sh.'

What do i do? It cant find the file and i cant find the file from manually looking, whats going on? I realize you guys are probably gonna have to tell me some linux common knowledge and im sorry for my ignorance. I think you in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu electricsheep Edit question
Assignee:
No assignee Edit question
Solved by:
Pen16
Solved:
Last query:
Last reply:
Revision history for this message
Pen16 (pen16-kc) said :
#1

Ok, i found the folder in my home directory and clicked on autogen.sh and told to run in terminal and i think that did it but where do i get wxwidgets 2.9.1, its not in software or synaptic manager?

Revision history for this message
Alessandro Menti (elgaton) said :
#2

wxWidgets 2.9 is not in the Ubuntu repositories yet, you'll have to fetch it from http://www.wxwidgets.org/ and build it yourself... it's a bit complicated.

By looking at the list of files in the Electric Sheep package (http://packages.ubuntu.com/oneiric/i386/electricsheep/filelist), you can determine that:
-to access Electric Sheep, you'll just need to type "electricsheep" in a terminal;
-likewise, you'll have to type "electricsheep-preferences" to access the preferences.

The screensaver should also be listed among the available ones as well as among the available applications.

Revision history for this message
Pen16 (pen16-kc) said :
#3

Ok, I may have totally gone about it in the wrong way. I downloaded the entire directory from the google source page and justed double clicked the autogen.sh to run in terminal. That seemed to work because i can run it by typing 'electricsheep' and access the preferences but its not displayed on any of my menus.

I also downloaded the wxwidgets package unzipped it and tried to install it like you would a source code program but it wouldn't have it, those are the errors i put up in the first post. What repositories do i need for it to install properly?

If this is a lot of tedious work you don't have to explain but I would appreciate a lesson, Im tryin to get the hang of linux in all its glory.

Revision history for this message
Alessandro Menti (elgaton) said :
#4

OK, if you want to build and install the latest version of Electric Sheep follow these steps. I have added some clarifications so that, in case you'll need to build a program from source and have to search for libraries, you'll know what to do.

1) The Electric Sheep page told you that you would need at least wxWidgets 2.9.1. Since wxWidgets is a library, you should search in Synaptic for a package whose name begins with "lib" (that's a widely used convention). In this case, a search returns the packages "libwxbase2.6-0" and "libwxbase2.8-0" (corresponding respectively to wxWidgets 2.6 and 2.8 - that's not what we want).
2) Before building wxWidgets from source, let's try to see if someone has already compiled wxWidgets 2.9 for Ubuntu and has packaged them in a PPA ("Personal Package Archive" or repository), so that you won't need to compile them from source, too. In this case, a Google search for "wxWidgets 2.9 ppa" and some "digging" returns this result:
https://launchpad.net/~fransschreuder1/+archive/usbpicprog-stable
(it is a repository devoted to a completely different program, but it provides wxWidgets 2.9 packages as well). Run the following command from a terminal:
sudo apt-add-repository ppa:fransschreuder1/usbpicprog-stable
This will add the repository to your software sources.
3) Run the following command to install the wxWidgets libraries and "development files" (the packages ending in -dev - you will need them to be able to build Electric Sheep properly):
sudo apt-get install libwxbase2.9-0 libwxbase2.9-dev libwxgtk2.9-0 libwxgtk2.9-dbg libwxgtk2.9-dev wx-common wx2.9-headers wx2.9-i18n
4) Remove the Electric Sheep Ubuntu packages you have installed before so that your installation is not garbled:
sudo apt-get purge electricsheep
5) cd again to the directory where the source code of Electric Sheep is and type (each command should go on its own line):
./autogen.sh
CXXFLAGS="`wx-config --cxxflags`" LDFLAGS="`wx-config --libs all`" ./configure
make
sudo make install
No command should return errors (in case something strange shows up, please post the error messages here and I'll help you).
6) Now Electric Sheep should be installed and should be listed among your available screensavers.

As for the errors you have encountered:
-you have said: "I downloaded the entire directory from the google source page and justed double clicked the autogen.sh to run in terminal. That seemed to work because i can run it by typing 'electricsheep' and access the preferences but its not displayed on any of my menus.". That's partly wrong: the "autogen.sh" is a script commonly used to prepare a program for building/compiling, and it does not perform the actual build on its own. You've done the right thing by running it, but you should have run the other three commands too to complete the compilation and installation. You was able to run the "electricsheep" command only because you had the Ubuntu package already installed; the source code you downloaded was not compiled.
-As a rule of thumb, if you build a program from source code you should build and install the libraries it depends on (like wxWidgets, in this case) *first*. That's because the configuration step (./configure) automatically detects if you have the required libraries on your system and finds the development files required for building the program itself. Without the libraries and development files in place, you can't neither run nor build the program. So, if (for example) we would have needed to build wxWidgets from source because we weren't able to find it prepackaged, we should have built and installed it before even we had attempted to configure and build Electric Sheep itself.

I've summarized the basic practices for building software from source below.
1) Check that the libraries required by the program are already installed. Usually, you can get a complete list from the README or INSTALL files included in the program's package. You can perform the check by searching in Synaptic - make also sure that the development files corresponding to the libraries (the packages containing them have the same name as the one providing the library itself, plus a "-dev" suffix) are installed as well.
If some of them are missing, try searching for a PPA (use Google and type "<nameoflibrary> ppa"). If no PPA is found, download, compile and install the additional libraries just like you would do with normal programs (it's a recursive procedure).
2) Extract the archive, cd to the directory where you have extracted the sources and do:
./configure
make
sudo make install
The first command will "configure" the package (it finds the compiler's path and the "development files" of the dependent libraries so that they can be used during the actual compilation, as well as enabling/disabling some system-dependent options). Some packages may use also "./configure" command options to let you enable or disable some features: read the INSTALL file of each program for more details.
The second one will compile the program and the third one will install it into your system.

Let me know if you need further clarifications.

Revision history for this message
Pen16 (pen16-kc) said :
#5

Wow, thank you so much! You have taught me many things I had no previous knowledge about and for that, I am very grateful!

I didn't even know there were Personal Package Archive's and you cleared up what the lib and dev files are really for and that i need all the 'Parts' before i build.

I am having a problem finding and installing the required dev packages from this code:

sudo apt-get install libwxbase2.9-0 libwxbase2.9-dev libwxgtk2.9-0 libwxgtk2.9-dbg libwxgtk2.9-dev wx-common wx2.9-headers wx2.9-i18n

Terminal tells me it cant find any of those packages, it says for all of them:

E: Unable to locate package libwxbase2.9-0
E: Couldn't find any package by regex 'libwxbase2.9-0'

What is regex also?
I am already grateful for the information given and I know I might not be able to repay the favor but if there is anything i can do for you, just shout!

Revision history for this message
Alessandro Menti (elgaton) said :
#6

Sorry - forgot to say that, after adding the repository, you should run "sudo apt-get update" to update the list of available packages. Run it and then apt-get will install the packages.

As for the "regex", or "regular expression", it's a powerful way to match strings of text: see <https://secure.wikimedia.org/wikipedia/en/wiki/Regular_expression>. Seem that apt-get uses it to match your input to existing package names.

Revision history for this message
Pen16 (pen16-kc) said :
#7

Sorry, Alessandro, but when i put in sudo apt-get update it lists everything fine until it gets to the ppa location we used, it says:

W: Failed to fetch http://ppa.launchpad.net/fransschreuder1/usbpicprog-stable/ubuntu/dists/oneiric/main/source/Sources 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/fransschreuder1/usbpicprog-stable/ubuntu/dists/oneiric/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/fransschreuder1/usbpicprog-stable/ubuntu/dists/oneiric/main/binary-i386/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Does this mean in the short time the files were taken down, or did i do something in the wrong order?

Revision history for this message
Alessandro Menti (elgaton) said :
#8

Sorry again - I didn't notice that the PPA does not offer any package for Oneiric, but I think you could use the packages for Natty as well. My bad. Open Software Sources, go to the "Other Software" tab, find the lines corresponding to the new repository and edit them so that the distribution is "natty".

Revision history for this message
Pen16 (pen16-kc) said :
#9

Oh, crap something just screwed up! I opened software source from the ubuntu software center and change the last two lines that are the PPA url and changed them to natty.

First, the process did not work still, spitting out the same error in terminal when i try to install the dev files. So i tried to go back to software source to see if i missed a line on the 'other' tab.

Problem is now Ubuntu Software Center wont even open! On my task bar it displays the name like its going to open but then just disappears with no window. This is the second time this has happened to me, the first being banshee media player. I didn't know how to fix it so i just installed rythembox. Did i accidently tell the software center to run in natty?

Revision history for this message
Pen16 (pen16-kc) said :
#10

I cant update my system either, When i try to list the updates it spites this error:

E:Type 'ain' is not known on line 3 in source list /etc/apt/sources.list.d/fransschreuder1-usbpicprog-stable-oneiric.list'

That's the line i changed, is there a way to change it back from terminal and not gui?

Revision history for this message
Pen16 (pen16-kc) said :
#11

Ok, under preferences for updating i was able to change the two fransschreuder sources back to oneiric but the update manager still says the same thing. I'm gonna try and restart my computer and see what happens.

Revision history for this message
Alessandro Menti (elgaton) said :
#12

I think that, while editing the software sources, an 'm' accidentally got deleted. (I think the "Type" the error message references to is the "section" of the repository from where the packages should be fetched; usually it is 'main', not 'ain').

There is a way to change it back from the terminal (it's also a bit more practical). Use the command:
sudo nano /etc/apt/sources.list.d/fransschreuder1-usbpicprog-stable-oneiric.list
and edit the file as needed, then use Ctrl+X to quit. When you are asked if you want to save the file, press the 'Y' key and then Enter.

Could you please post the contents of the /etc/apt/sources.list.d/fransschreuder1-usbpicprog-stable-oneiric.list, so that I'll be able to have a look?

Revision history for this message
Pen16 (pen16-kc) said :
#13

Ok, I dont know i deleted a character during this process but i put in the command and sure enough:

deb http://ppa.launchpad.net/fransschreuder1/usbpicprog-stable/ubuntu natty main
deb-src http://ppa.launchpad.net/fransschreuder1/usbpicprog-stable/ubuntu natty$
ain

The ain im assuming needs to be main like you said so i changed that. I do have a question though, why did source list for the new software completely screw my software center and update center, even after I tried to omit them from being eligable for update? Wouldn't this new list be completely separate from all the other previous ones? I guess im asking why this list had enough power to do what it did?

Ok, then i tried to list update's and it gave me the same error but instead of ain it said main so I deleted the whole third line and saved it and now my updates and software center work fine.

When i changed the running distribution to natty did that have an entry in the file not compatibly with oneiric because i do not remember changing anything else or accidentally deleting a character from that file unless i made the file myself and i don't think i did.

(Sorry for the questions.) What type of files are the list files? Meaning what is their function, because like i said earlier my Banshee program wouldn't run after I updated from natty to oneiric. Maybe there is an entry on that list that isn't compatible with oneiric. And is there a way for me to see these errors for programs attemping to run on my system that just dont work?

Revision history for this message
Pen16 (pen16-kc) said :
#14

After the update, the sources are still set to natty. Am I supposed to have two?

But fetching those dev files still doesn't find them.

Revision history for this message
Alessandro Menti (elgaton) said :
#15

I'll try to answer your questions one by one.
1) The sources.list screwed up Software Center as well because Software Center/Update Center are just "graphical frontends" (interfaces) to the underlying system for package management used by Ubuntu (simplifying, it's made up of two parts: dpkg, a program that handles .deb "packages" - archives containing the compiled executables and data files needed to run a program, each package generally contains a program or a relevant part of it - and apt, a tool that handles the download from the repositories and manages dependencies between packages, so that, for example, if a particular library is required for a program to run and you choose to install that program, the library gets downloaded and installed as well).
Therefore, if apt/dpkg does not run without errors (like in this case, as a repository entry was not correct), Software Center/Update Center is unable to install or upgrade packages: it can not act on its own.

2) The fact that the repository did not offer packages for Oneiric was a choice (or oversight) of that PPA's maintainer. Packages in the PPAs are divided by "series" (released Ubuntu versions). When a new version of Ubuntu is released, PPA maintainers have to check if the software they publish works correctly in the new version and tell Launchpad it can offer the built packages for that version too, or they have to fix the program/packaging as appropriate and upload the new version. The migration from an old to a new series is not performed manually, as there is a risk of malfunctioning (like dependencies not being met).
I think the maintainer either forgot to copy the packages from a series to another or stopped supporting that software altogether, that's why Oneiric packages were not offered for that archive; consequently, you encountered the error "W: Failed to fetch http://ppa.launchpad.net/fransschreuder1/usbpicprog-stable/ubuntu/dists/oneiric/main/source/Sources 404 Not Found". That meant apt-get was not able to find package lists in that PPA for Oneiric (more on that later); it made sense since none were offered. I told you to change the distribution to "natty" for that PPA because there were packages for that series (and I thought they would be compatible too; generally speaking, packages are compatible throughout different series, with some exceptions).

3) There are two kinds of "list files": sources.list files (the ones found in /etc/apt/sources.list.d/ and /etc/apt/sources.list) and package list files.

sources.list files are, collectively, the list of repositories that apt should check when searching for new packages and/or downloading them. Each line has the following format:
type origin series sections
Two examples are:
deb http://it.archive.ubuntu.com/ubuntu/ oneiric main restricted
deb-src http://archive.canonical.com/ubuntu oneiric partner
(the "sections" may be more than one).
The "type" (either "deb" or "deb-src") specifies the type of packages that should be searched for ("deb" means binary, compiled packages, they are the ones you normally download and install when you use Software Center, Synaptic or apt-get, while "deb-src" corresponds to source packages, that is, the program's sources and some additional files used to create the binary package automatically; they're useful only to packagers and Ubuntu developers).
The "origin" is the base directory of the repository, the one apt starts searching for when downloading packages. If you browse to that location, you'll see a fairly standard directory layout (for example, try browsing to <http://en.archive.ubuntu.com/ubuntu/> and navigate there while reading the rest of this answer, so you'll be able to see how that really works):
/
|- dists
|- indices
|- pool
|- project
|- ubuntu
-The "ubuntu" directory is just a pointer to the directory itself.
-The "project" directory contains, among the other files, the GPG key used to sign package list files (I'll discuss their purpose later).
-The "indices" directory may contain (if present) some special directives to be used by apt when choosing packages (some of them, for example, are used if a package should be fetched from a particular location instead of another in the repository).
-The "pool" directory is the most important one: it contains the actual binary and source packages, divided by the initial letter of their name.
-The "dists" directory contains several subdirectories. Each of them corresponds to a particular "series" (released Ubuntu version). Every series subdirectory contains a list of checksums of all the files in that directory, as well as the digital signature that is used by apt to check that packages or package list files have not been altered during download, and other subdirectories (each one of them is called a "section"); in turn, every "section" subdirectory contains the package list files.

Package list files are, as their name says, just a complete list of all the packages that have been published for that series and into that section, including some information about them as well (like their name and description, size and dependencies - open a package list file and see!). Those are the files that get downloaded into your system (at /var/lib/apt/lists/) when you search for new updates using Update Center and that are used by it (or, more correctly, by apt) when you try to install a program (for example, these ensure you are installing all the required dependencies as well).

That said, it's easy to see if a repository provides packages for a specific Ubuntu series: the directory with the series name should be present in the "dists" directory of that repository.

4) As for Banshee, I don't think that a problem in either type of list files has caused it not to run. During the upgrade, Ubuntu automatically changes the sources.list files and downloads the most recent package list files to calculate the list of packages to download and upgrade, so it should have chosen the Oneiric version of Banshee. (I must note that there is, in fact, a problem in the package lists that may cause a program not to function after an upgrade: a missing dependency caused by the fact that some files have been moved between packages from a series to another, but that's a fairly rare eventuality).
There are several ways to check what the problem really is, and most of them require the use of the terminal.

The first one is to simply run the program from the terminal. In your case, you would just run "banshee". Many softwares print informational and error message to the terminal when they are run, so that, if there are any problems, they can be identified. Note that it's normal to see some warnings coming from GTK (marked by GTK-Warning) or KDE/QT (depending on the library the program is using). Most of the times, if an error message is printed on the terminal, you should be able to correct it, or at least to tell it to the developers so they can fix the bug.

The second one is a bit more complex and should be used preferably only when the first one did not work. It involves the use of the "strace" program (it can be installed with "sudo apt-get install strace"). What this program does is monitor the execution of a particular binary, logging all actions done. For example, if you want to see what the command "echo Hello" does, you can type:
strace -o HelloTrace.log echo Hello
and see the actions in the HelloTrace.log file.
Be warned that the log file can (and does) grow rapidly, as everything is logged. Also, strace monitors what the program does in terms of "system calls" (they are just functions offered by the Linux kernel to running programs to perform common tasks, such as opening/closing files, using memory, printing to the screen, and so on; if you want to know more about a specific system call, type "man 2 name" where name is the name of the system call); therefore, finding the error will be quite complex and requires experience. A strategy that might work could be to ask someone who does not experience the problem to run strace on the program as well and comparing logs; another one could be thinking how the program should run (correctly) in terms of system calls, following the log, and identifying the point where the error occurs.

Having obtained the error message (if any), if you are still unable to fix the problem you should search if a bug report has been filed. To do this, open the Ubuntu bug report website (<https://bugs.launchpad.net/ubuntu/>) and perform a search using the name of the program, some words describing the error or the error message. If a bug report has been filed, open it; sometimes a workaround is suggested in the comments, allowing you to "bypass" the error until an official fix is released. If no report has been filed AND you are able to describe the problem well (by "well" I mean being able to write a description of what you are experiencing and to provide a step-by-step guide that tells the developers how they could recreate the problem so they can see it), you should use the "Help->Report a problem" menu item of the affected application or (from a terminal) the command "apport appname", where "appname" is the name of the package containing the application (use Synaptic to check if you're in doubt). This will open a new Launchpad bug report and automatically attach some information/logs from your system, so that developers may know more about your specific configurations (I sometimes help dealing with bug reports and the logs help me out two times out of three); just type an appropriate title (include there the exact text of any error messages, if any) and a description which includes the symptoms of the problem, the step-by-step guide I have mentioned before and any error messages that appear.

I know I have been a bit long-winded with this answer, but I wanted to explain everything in detail, so that you would understand precisely what each part of the system does and how things work "behind the curtains". As always, feel free to ask if you have any questions.

Revision history for this message
Pen16 (pen16-kc) said :
#16

Thank you very much I now know where all these packages and programs come from and what the lists are and i think most of the system file extensions i have down.

I gotta admit when first switching from windows to linux the whole software center and program fetching seemed like magic, i mean with windows you gotta get yourself.

I applaud your patients and think you again for the Linux 101 lesson. And now im assuming the electric sheep isn't gonna work till dude-man updates his wxwidget repositories for oneiric.

Anyway this has been the most help with a linux problem i have had online and it makes me happy to see that people do care very much for the support of the community, thank you.

Revision history for this message
Alessandro Menti (elgaton) said :
#17

I think Electric Sheep should work even if you install wxWidgets for Natty - try and tell me if it works.

You're welcome ;)