Installing linux headers

Asked by hilary

Hi,

I'm actually working on installing my WUSB54GS Linksys device, which someone has written a tutorial for:
http://ubuntuforums.org/showthread.php?t=225206&highlight=RT73
but I'm stuck on the first code, which is typical of me since I'm still a newbie at this.

The code I'm supposed to enter is the following:
sudo apt-get install cpp gcc build-essential linux-headers-$ (uname -r)

i replaced (uname -r) with my username hilary, so the result was:
sudo apt-get install cpp gcc build-essential linux-headers-$ hilary

what i received was the following, with an error at the end:
reading package lists...done
building dependency tree
reading state info...done
cpp is already newest version
gcc is already newest version
E: couldn' t find package build-essential

It has been suggested to me to cut out the 'cpp gcc' part since that's all up to date, and try removing the $ sign and I'm still getting the error in the last line. The same person suggested I use synaptic, but the computer i'm doing this on doesn't have the internet, (that' s necessary to download things, right?) and if it isn't necessary, what am i downloading specifically? do i just type essential linux-headers?

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
exactt (giesbert) said :
#1

you ain't supposed to replace uname with your username. just enter it the command as is. uname -r is a command you could run on its own. the output of it is then set into the above command.

i think it should actually read like this: no psace between $ and (
sudo apt-get install cpp gcc build-essential linux-headers-$(uname -r)

it is the same as:
sudo apt-get install cpp gcc build-essential linux-headers-`uname -r`

Revision history for this message
hilary (hardysmiles) said :
#2

Allright,
so i typed the command as is and received:
E: could not get lock /av/lib/dpkg/lock - open (Resource temporarily unavailable)
E: Unable to lock the administrator directory (/var/lib/dpkg), is another process using it?

also i looked in synaptic to see what headers I did have, and the following are already installed:

linux-headers-2.6.20-15
linux-headers-2.6.20-15-generic
linux-headers-generic

are these sufficient for what I need to install the linksys adapter? to i really need to bother with that first code?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#3

Just type this in a terminal:

uname -r

If the output is:

2.6.20-15-generic

than you are set.

If the computer you are running this doesn't have internet then apt-get will not work.

Revision history for this message
exactt (giesbert) said :
#4

i think you get the lock message because you have another package managing application open. probably synaptic. if you close it the command should work.

Revision history for this message
hilary (hardysmiles) said :
#5

Yea, I did have synaptic open the last time i tried, though i just tried again, and it said it couldn't find the build-essential package, which I'm assuming is because it doesn't have internet hooked up as Cesare said. I double checked on the linux header, and it is 2.6.20-15-generic, so I've headed on to the next step, but I'm getting all error messages.

This step is building the ndiswrapper. Here's what i'm supposed to do: extract folders from attachment in tutorial, then go into the ndiswrapper folder in the terminal and run:
sudo make uninstall
make
sudo make install

He mentioned that some have the error message about directories unable to be deleted so he suggests the command:
sudo rm -fR /lib/modules/$(uname -r)/kernel/drivers/net/ndiswrapper

Then finish it off with
sudo ndiswrapper -m

Here's what went on in my terminal:

hilary@hilary:~$ cd /home/hilary/ndiswrapper-files/ndiswrapper-1.28
hilary@hilary:~/ndiswrapper-files/ndiswrapper-1.28$ sudo make uninstall
NOTE: Not all installed files are removed, as different distributions install ndiswrapper files at different places.
Run uninstall as many times as necessary until no "removing" messages appear below.
removing /lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper
/bin/rm: cannot remove `/lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper': Is a directory
make: *** [uninstall] Error 1
hilary@hilary:~/ndiswrapper-files/ndiswrapper-1.28$ sudo rm -fR lib/modules/$(uname -r)/kernel/drivers/net/ndiswrapper
hilary@hilary:~/ndiswrapper-files/ndiswrapper-1.28$ sudo make
make -C driver
make[1]: Entering directory `/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver'
make -C /lib/modules/2.6.20-15-generic/build SUBDIRS=/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver
make[2]: Entering directory `/usr/src/linux-headers-2.6.20-15-generic'
  CC [M] /home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.o
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39:47: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c: In function ‘ndis_init’:
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39: error: ‘INIT_WORK’ undeclared (first use in this function)
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39: error: (Each undeclared identifier is reported only once
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39: error: for each function it appears in.)
make[3]: *** [/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.o] Error 1
make[2]: *** [_module_/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.20-15-generic'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver'
make: *** [all] Error 2
hilary@hilary:~/ndiswrapper-files/ndiswrapper-1.28$ sudo make install
make -C driver install
make[1]: Entering directory `/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver'
make -C /lib/modules/2.6.20-15-generic/build SUBDIRS=/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver
make[2]: Entering directory `/usr/src/linux-headers-2.6.20-15-generic'
  CC [M] /home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.o
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39:47: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c: In function ‘ndis_init’:
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39: error: ‘INIT_WORK’ undeclared (first use in this function)
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39: error: (Each undeclared identifier is reported only once
/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.c:39: error: for each function it appears in.)
make[3]: *** [/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver/ndis.o] Error 1
make[2]: *** [_module_/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver] Error 2
make[2]: Leaving directory `/usr/src/linux-headers-2.6.20-15-generic'
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/hilary/ndiswrapper-files/ndiswrapper-1.28/driver'
make: *** [install] Error 2
hilary@hilary:~/ndiswrapper-files/ndiswrapper-1.28$ sudo ndiswrapper -m
sudo: ndiswrapper: command not found
hilary@hilary:~/ndiswrapper-files/ndiswrapper-1.28$

Revision history for this message
Cesare Tirabassi (norsetto) said :
#6

hilary,

first of all, you should not:

1) give commands you don't know what they are doing or you don't understand
2) keep giving commands in a chain when a previous one didn't work

I'm telling you because this way you are risking to seriously damage your installation.

For instance, you got this error message:

cannot remove /lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper

After which you issued this command:

sudo rm -fR lib/modules/$(uname -r)/kernel/drivers/net/ndiswrapper

I know that you've taken it from the wiki, but you just deleted this directory

lib/modules/2.6.20-15-generic/kernel/drivers/net/ndiswrapper

instead of this

/lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper

Now, why are you compiling ndiswrapper?
ndiswrapper is already (or at least was before you deleted the wrong directory) included in Ubuntu 7.04

Revision history for this message
C de-Avillez (hggdh2) said :
#7

Please use current (1.47) version of ndiswrapper. You can download it from http://ndiswrapper.sf.net. 1.28 is hopelessly outdated.

After getting the new version, go from the beginning again.

Revision history for this message
C de-Avillez (hggdh2) said :
#8

and, BTW... Cesare is correct. We *do* have a working ndiswrapper in Feisty.

Revision history for this message
hilary (hardysmiles) said :
#9

Allright thanks for the heads up on stupid errors i'm making

I'm just going to reinstall fiesty again, and make sure I have everything the way its supposed to be.

So which do I use, the ndiswrapper that comes from fiesty, or the 1.47 version to download from the site?

Should I then skip th first two steps (installing the linux-headers and building the ndiswrapper?

Have either of you looked at the instructions the guy gives at http://ubuntuforums.org/showthread.php?t=225206&highlight=RT73 ?

Do you think that as long as I'm using an updated ndiswrapper and try and avoid stupid mistakes that it can still work, or is it too outdated now?

Revision history for this message
C de-Avillez (hggdh2) said :
#10

hilary, I would stick with the Feisty-provided ndiswrapper first. It comes with the kernel, so just by re-installing your linux-image you should get it. With that you do not need to install linux-headers nor make/build ndiswrapper. In fact, this is the version of ndiswrapper I myself am using right now.

If you follow the instructions from the Forum starting with Step3 you should be OK -- but YMMV... I do not have this brand of wireless, so I cannot attest to the procedure.

Also, mistakes happen. Do not get upset with them. If we are able to get you up & working, all is fine :-)

Revision history for this message
hilary (hardysmiles) said :
#11

Ok system reinstalled. And guess what? I have more questions! :-D And still on step 3 :p

I'm supposed to do this:

Step 3 - Getting the drivers

WITH THE ATTACHMENT (I downloaded the ndiswrapper 1.47.tar, and then extracted its folder into my home directory: /home/hilary
 No i'm supposed to run the following commands in the terminal:

bunzip2 ndiswrapper-files.tar.bz2
tar -xf ndiswrapper-files.tar
rm ndiswrapper-files.tar
mkdir ~/MyDrivers

I'm not familar with the first three commands, but do they have anything to do with unzipping the attachment? If so I already did that graphically and can skip those three commands, right? That would mean I only need to do the mkdir command (i know that's going to create the following directory)

ok that's all my questions for step three now :-) thanks!

Revision history for this message
hilary (hardysmiles) said :
#12

Ok so, i tried skipping the first three commands because it looked like it was repeating what i did manually and rm is to delete something and i wasn't sure what it was deleting so i skipped that. the following is what i did and I came up short:

hilary@hilbil:~$ mkdir ~/MyDrivers
hilary@hilbil:~$ cp /home/hilary/ndiswrapper-1.47/Drivers_v1/* /home/hilary/MyDrivers/
hilary@hilbil:~$ cd /home/hilary/MyDrivers
hilary@hilbil:~/MyDrivers$ sudo ndiswrapper -i WUSB54GS.inf
Password:
sudo: ndiswrapper: command not found
hilary@hilbil:~/MyDrivers$

Revision history for this message
exactt (giesbert) said :
#13

i think you have to install ndiswrapper first with the following command:

sudo aptitude install ndiswrapper

after that you should find a new menu item in System/Administration or System/Settings where you can set up you driver with ndiswrapper.

it would probably make sense to look for a general HowtoSetupMyWlanWithNdiswrapper guide.

good luck

Revision history for this message
hilary (hardysmiles) said :
#14

Why isn't it finding the ndiswrapper package? I also tried cding into the repertoire where I'd saved the ndiswrapper stuff and it came up with the exact same response.

hilary@hilbil:~$ sudo aptitude install ndiswrapper
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Initializing package states... Done
Building tag database... Done
Couldn't find package "ndiswrapper". However, the following
packages contain "ndiswrapper" in their name:
  ndiswrapper-modules-1.9
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.
hilary@hilbil:~$

----------------------------------------------------------------------------------
Here are the installation instructions that come with the ndiswrapper 1.47 package:
-----------------------------------------------------------------------------------

The instructions below explain how to install ndiswrapper. This is
rather short version; more details about installation,
troubleshooting, FAQ etc. can be found in the Wiki at

http://ndiswrapper.sourceforge.net/wiki

Prerequisites
=============

You need a recent kernel, at least 2.6.6 or 2.4.26, with header files
for the kernel. Make sure there is a link to the kernel source from
the modules directory. The command

  ls /lib/modules/`uname -r`/build

should have at least 'include' directory and '.config' file.
------------------------------------------------------------------------------------------------------
********as you can see below, when I ran this command, there wasnt the .config... what do i do to get it there?
------------------------------------------------------------------------------------------------------
Downloading
===========

Change to ndiswrapper-version directory and run

  make uninstall
  make

Login as root and run
  make install

Install Windows driver
======================

If this is the first time you install ndiswrapper, you need to install
Windows driver for Windows XP (in some cases Windows NT or Windows
2000 may also work). First, get a Windows driver (***I already have the driver)

Once the driver has been unpacked, locate .inf and .sys files. If
necessary, move these files so both .inf and .sys are in the same
directory. Some drivers also come with firmware files, such as
fwrad16.bin etc. These files also should be in the same
directory. Then install the Windows driver with

  ndiswrapper -i driver.inf

This installs .inf file and required .sys and .bin files. Now, see if
installation of Windows driver is "valid" with

  ndiswrapper -l

This should report

"driver present, hardware present"

for the driver installed and if that driver is for the device that is
already in the system. If device is not present, it should report

"driver present"

If not, the Windows driver has not been installed properly.

Now load ndiswrapper module with

  modprobe ndiswrapper

If everything worked properly, this should initialize 'wlan0' wireless
device, which can be configured with wireless tools, such as
'iwconfig', 'wpa_supplicant' etc.
------------------------------------------------------------
***at what point should I plug in the linksys adapter?
------------------------------------------------------------

------------------------------------------------------------
Here is what happened when I attempted to follow these instructions:
------------------------------------------------------------

hilary@hilbil:~$ ls /lib/modules/`uname -r`/build
arch crypto fs init kernel Makefile Module.symvers scripts sound usr
block drivers include ipc lib mm net security ubuntu
hilary@hilbil:~$ cd /home/hilary/ndiswrapper-1.47
hilary@hilbil:~/ndiswrapper-1.47$ make uninstall
NOTE: Not all installed files are removed, as different distributions install ndiswrapper files at different places.
Run uninstall as many times as necessary until no "removing" messages appear below.
removing /lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper/ndiswrapper.ko
/bin/rm: cannot remove `/lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper/ndiswrapper.ko': Permission denied
make: *** [uninstall] Error 1

Revision history for this message
C de-Avillez (hggdh2) said :
#15

hi hilary,

Sorry, I should have been more explicit.

The ndiswrapper kernel module itself is embedded in the standard Linux kernel. Additionally you will need:

 * ndiswrapper-common
 * ndiswrapper-utils-1.9

So you can get them installed by running 'sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9'

Then you can go from step 3.

Again, I am sorry for my omission.

Revision history for this message
hilary (hardysmiles) said :
#16

The command you just gave me up with an error, that it couldn't find the ndiswrapper-common package...When I reinstalled fiesty last night, I reformatted sda5 ( / ) sda1 (/boot) and sda2 (swap) but left sda6 untouched (/home) Where do they put the ndiswrapper that comes with fiesty? if it was in my home directory, than i'm going to have to reinstall again, making sure i reformat sda6 too (i know to make sure that i back up any personal files first).

unless you think its something else?

here's what's in the terminal:

hilary@hilbil:~$ sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9
Password:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ndiswrapper-common
hilary@hilbil:~$

Revision history for this message
C de-Avillez (hggdh2) said :
#17

The kernel module itself is already provided by the standard Ubuntu Feisty kernel. What you need is just the userland utilities, provided by ndiswrapper-common and ndiswrapper-utils-1.9.

I do not understand your error... I went ahead and installed both of them on another (pretty much standard) Feisty box... no errors!

Can you past here your /etc/apt/sources.list? I think you are missing some repositories.

You do not need to reinstall. At all.

Revision history for this message
Jacob Godserv (fun2program8) said :
#18

hilary, the instructions you are following requires an ndiswrapper version of v1.21 or higher. The version included with Feisty is ancient and contains a bug that will crash the kernel when this USB device is registered with the ndiswrapper driver. Don't take another step forward without completing the first Step - Installing the Essentials. They're called essentialls for a good reason.

You cannot, absolutely can NOT continue without completing each step successfully!

Open System -> Administration -> Software Sources, and make sure everything on that first tab is checked. (You can uncheck the ones that weren't checked later if you want, but I find there's much more good stuff to be had with all of them checked.) No internet connection? Click on "Third-Party Software", and click "Add CD-ROM...". Insert the Feisty Install disk when prompted.

Once you've done all this, then you may run...
sudo apt-get install cpp gcc build-essential linux-headers-$(uname -r)

Next, building ndiswrapper. Yes, it's absolutely necessary, and plus it is one of the most easiest compiles you'll ever do. Download ndiswrapper to your home directory (Firefox does this automatically when you tell it to Save to Disk):
http://downloads.sourceforge.net/ndiswrapper/ndiswrapper-1.47.tar.gz?modtime=1181699252&big_mirror=0

Open Places -> Home Folder, and right click the ndiswrapper-1.47.tar.gz file, and click "Extract Here". A new folder called ndiswrapper-1.47 will be created.

Now open a terminal. Run the following commands first:
cd ~/ndiswrapper-1.47
sudo apt-get remove ndiswrapper*
sudo make uninstall

The above command might tell you it cannot delete something or other because it is a directory. You may delete this directory manually yourself by running:
rm -fR <directory mentioned>
Replace "<directory mentioned>" with the directory in the error.

Now that you've uninstalled ndiswrapper, we can install the new version. This step is very very very important. Do not skip if it fails! Run the following commands:
cd ~/ndiswrapper-1.47
make

Now that you've compiled ndiswrapper, tell it to install it:
cd ~/ndiswrapper-1.47
sudo make install

Once it is done, run:
ndiswrapper -v

If somewhere within that output it says...
driver version: 1.47
...everything should be fine.

That was the first half of what you need to do. What needs to happen next is you need the following files:
WUSB54GS.inf usb8023.sys rndismp.sys

You should be able to find them in the attachment in the HOWTO you are following. Copy and paste these files to your home directory, then run in a terminal:
sudo ndiswrapper -i WUSB54GS.inf

Check to be sure it installed with:
ndiswrapper -l (that's an L, not an i)

It will tell you your drivers are invalid. To fix this, run the following commands:
sudo cp usb8023.sys /etc/ndiswrapper/wusb54gs/
sudo cp rndismp.sys /etc/ndiswrapper/wusb54gs/

Now when you run...
ndiswrapper -l (that's an L, not an i)
...everything should be OK.

Run the following command to finalize the installation and load ndiswrapper as a driver:
sudo modprobe ndiswrapper

Now plug in your device. If NetworkManager sees it (the little computer icon in the upper-right corner) you are all set. To make sure ndiswrapper always loads as a driver on startup, run:
sudo ndiswrapper -m

Enjoy!

Revision history for this message
C de-Avillez (hggdh2) said :
#19

@javaJake:

> hilary, the instructions you are following requires an ndiswrapper version of v1.21 or higher. The version included with Feisty is ancient and contains a bug that will crash the kernel
> when this USB device is registered with the ndiswrapper driver.

Sigh. Please do not confuse the issue even more. The Feisty version is *not* ancient: it is 1.38. It should work for hilary, and I considered it would be easier for hilary to try it first.

Revision history for this message
hilary (hardysmiles) said :
#20

Hi there,

Thank you for replying to my email :-) I can't tell you how much I appreciate it! I've read through what you wrote, I understand what I need to do. I started to follow the instructions, running the apt-get with the fiesty cd, and got to the building ndiswrapper part, but there was some sort of glitch at sudo apt-get remove ndiswrapper* I pasted everything that went on in my terminal, but its just the end i really wanted to show you...

hilary@hilbil:~$ sudo apt-get install cpp gcc build-essential linux-headers-$(uname -r)Reading package lists... Done
Building dependency tree
Reading state information... Done
cpp is already the newest version.
gcc is already the newest version.
linux-headers-2.6.20-15-generic is already the newest version.
The following extra packages will be installed:
  dpkg-dev g++ g++-4.1 libc6-dev libstdc++6-4.1-dev linux-libc-dev
Suggested packages:
  debian-keyring gcc-4.1-doc lib64stdc++6 glibc-doc manpages-dev libstdc++6-4.1-doc
The following NEW packages will be installed:
  build-essential dpkg-dev g++ g++-4.1 libc6-dev libstdc++6-4.1-dev linux-libc-dev
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/8050kB of archives.
After unpacking 33.7MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Selecting previously deselected package linux-libc-dev.
(Reading database ... 88002 files and directories currently installed.)
Unpacking linux-libc-dev (from .../linux-libc-dev_2.6.20-15.27_i386.deb) ...
Selecting previously deselected package libc6-dev.
Unpacking libc6-dev (from .../libc6-dev_2.5-0ubuntu14_i386.deb) ...
Selecting previously deselected package libstdc++6-4.1-dev.
Unpacking libstdc++6-4.1-dev (from .../libstdc++6-4.1-dev_4.1.2-0ubuntu4_i386.deb) ...
Selecting previously deselected package g++-4.1.
Unpacking g++-4.1 (from .../g++-4.1_4.1.2-0ubuntu4_i386.deb) ...
Selecting previously deselected package g++.
Unpacking g++ (from .../g++_4.1.2-1ubuntu1_i386.deb) ...
Selecting previously deselected package dpkg-dev.
Unpacking dpkg-dev (from .../dpkg-dev_1.13.24ubuntu6_all.deb) ...
Selecting previously deselected package build-essential.
Unpacking build-essential (from .../build-essential_11.3_i386.deb) ...
Setting up linux-libc-dev (2.6.20-15.27) ...
Setting up libc6-dev (2.5-0ubuntu14) ...
Setting up dpkg-dev (1.13.24ubuntu6) ...
Setting up libstdc++6-4.1-dev (4.1.2-0ubuntu4) ...
Setting up g++-4.1 (4.1.2-0ubuntu4) ...
Setting up g++ (4.1.2-1ubuntu1) ...

Setting up build-essential (11.3) ...
hilary@hilbil:~$ cd ~/ndiswrapper-1.47
hilary@hilbil:~/ndiswrapper-1.47$ sudo apt-get remove ndiswrapper*
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ndiswrapper.8
hilary@hilbil:~/ndiswrapper-1.47$

I stopped here because I didn't want to run any other commands before understanding this last error. I don't understand why it's not finding ndiswrapper.8 because I think I'm looking at it: I found it in the directory created after unzipping the ndiswrapper. Its here: /home/hilary/ndiswrapper-1.47/ndiswrapper.8 I read what you said about running the rm -fR command for errors saying it cannot delete a directory, but this is about finding a file appears to exist, so I wanted to double check with you about what I should do.

Thanks again :-)

Revision history for this message
Jacob Godserv (fun2program8) said :
#21

I'm glad you didn't run that rm -fR command, and asked first! :)

Write the following command before running apt-get again:
cd /

You are right, apt-get is picking up a file within your folder. It's kind of silly IMO but that's what it did. If you move to your root directory there's no real chance of apt-get doing the same thing again, since there's not going to be anything called ndiswrapper up there.

Revision history for this message
Jacob Godserv (fun2program8) said :
#22

Also, hilary, according to hggdh, the ndiswrapper version you have is fine already. If you run:
ndiswrapper -v

And you get v1.38, you are all set (I think). Just follow my instructions after the "ndiswrapper -v" command.

Revision history for this message
hilary (hardysmiles) said :
#23

Ummm... I think another error has come up when cd into my home directory and then ran the apt-get again. It gave me the option to abort the operation near the end, because it said othewise it would delete the terminal, and I'm pretty sure that's not what I want that command to do... I tried closing the terminal, and starting everything from the very beginning and got the same exact result... Here's what it looks like:

hilary@hilbil:~$ sudo apt-get install cpp gcc build-essential linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
cpp is already the newest version.
gcc is already the newest version.
build-essential is already the newest version.
linux-headers-2.6.20-15-generic is already the newest version.
The following packages were automatically installed and are no longer required:
  nvidia-kernel-common
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
hilary@hilbil:~$ cd ~/ndiswrapper-1.47
hilary@hilbil:~/ndiswrapper-1.47$ sudo apt-get remove ndiswrapper*
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ndiswrapper.8
hilary@hilbil:~/ndiswrapper-1.47$ ~ /
bash: /home/hilary: is a directory
hilary@hilbil:~/ndiswrapper-1.47$ ~/
bash: /home/hilary/: is a directory
hilary@hilbil:~/ndiswrapper-1.47$ cd /
hilary@hilbil:/$ sudo apt-get remove ndiswrapper*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting ndiswrapper-modules-1.9 for regex 'ndiswrapper*'
Note, selecting linux-image-2.6.20-15-generic instead of ndiswrapper-modules-1.9
The following packages were automatically installed and are no longer required:
  nvidia-kernel-common
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  linux-image-2.6.20-15-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 71.3MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 89521 files and directories currently installed.)
Removing linux-image-2.6.20-15-generic ...
dpkg: error processing linux-image-2.6.20-15-generic (--remove):
 subprocess pre-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-2.6.20-15-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
hilary@hilbil:/$

Revision history for this message
hilary (hardysmiles) said :
#24

hilary@hilbil:/$ ndiswrapper -v
The program 'ndiswrapper' is currently not installed. You can install it by typing:
sudo apt-get install ndiswrapper-common
bash: ndiswrapper: command not found
hilary@hilbil:/$ sudo apt-get install ndiswrapper-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package ndiswrapper-common
hilary@hilbil:/$

Revision history for this message
Cesare Tirabassi (norsetto) said :
#25

hilary,

can you paste here your /etc/apt/sources.list file?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#26

Also, do you have an active internet connection when issuing the apt-get command?
If you have no internet (perhaps you don't since you have a wireless problem) the command will not work.

Revision history for this message
hilary (hardysmiles) said :
#27

it says for the command /etc/apt/sources.list file that the command /etc/apt/sources.list couldn't be found... I triple checked for typos...

and no, the computer i'm trying to get the wirless going on has no internet connection, though my stepbrother and i have a plan in the works to run a seventy foot ethernet cable to solve this situation, wireless or no... but if i have to take this computer up to school in a month and a half, i'm going to need the wirless running probably, and i'm stubborn and don't want to give up :p

Revision history for this message
Cesare Tirabassi (norsetto) said :
#28

Hilary, to see the content of a file, you should not use the file name, but this command (with the above file name as an example):

cat /etc/apt/sources.list

In any case, as I said above, you can't use apt-get if you don't have internet unless you have a local repository (for instance on a CD).
Try inserting the liveCD while you are booted in ubuntu, it will ask you if you want to use it as a repository. Answer yes, and then try again installing ndiswrapper-common.

Revision history for this message
hilary (hardysmiles) said :
#29

hilary@hilbil:/$ /etc/apt/sources.list file
bash: /etc/apt/sources.list: Permission denied
hilary@hilbil:/$ sudo etc/apt/sources.list file
Password:
sudo: etc/apt/sources.list: command not found
hilary@hilbil:/$ cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://us.archive.ubuntu.com/ubuntu/ feisty main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ feisty restricted main multiverse universe #Added by software-properties

## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ feisty-updates main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-updates main restricted #Added by software-properties

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## universe WILL NOT receive any review or updates from the Ubuntu security
## team.
deb http://us.archive.ubuntu.com/ubuntu/ feisty universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://us.archive.ubuntu.com/ubuntu/ feisty multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse
# deb-src http://us.archive.ubuntu.com/ubuntu/ feisty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu feisty-security main restricted
deb-src http://security.ubuntu.com/ubuntu feisty-security restricted main multiverse universe #Added by software-properties
deb http://security.ubuntu.com/ubuntu feisty-security universe
deb http://security.ubuntu.com/ubuntu feisty-security multiverse
deb cdrom:[Ubuntu 7.04 _Feisty Fawn_ - Release i386 (20070415)]/ feisty main restricted
# deb cdrom:[Ubuntu 7.04 _Feisty Fawn_ - Release i386 (20070415)]/ feisty main restricted
hilary@hilbil:/$

I did try reinserting the live cd, but it didn't ask me if i wanted to use it as a repository, but isn't this what I did manually, when javajake had me:

"Open System -> Administration -> Software Sources, and make sure everything on that first tab is checked. (You can uncheck the ones that weren't checked later if you want, but I find there's much more good stuff to be had with all of them checked.) No internet connection? Click on "Third-Party Software", and click "Add CD-ROM...". Insert the Feisty Install disk when prompted."

Revision history for this message
Cesare Tirabassi (norsetto) said :
#30

OK, so with the CD in, can you install ndiswrapper-common?

Revision history for this message
hilary (hardysmiles) said :
#31

Crap, I think I have a much bigger problem now. No, I wasn't able to install ndiswrapper-common using the fiesty live cd, so I thought I'd go back to square one, reinstall the system which would have a ndiswrapper included, so I went to restart my computer with the live cd, and its not restarting. It's stuck at the Dell startup screen, and its not moving at all. Usually there's options written up top, like F12 (which allows me to run the computer from the live cd) but there are no options anywhere, and I've tried ctrl alt backspace, and F12 and things like that and it just stays stuck at the same screen. if you look up about five posts or so, i talk about what happened when i ran the sudo apt-get install cpp gcc build-essential linux-headers-$(uname -r) command, and it tried erasing my kernel (if i understood right) and it was only because it gave me the option to abort at the last minute that it didn't... but i'm getting the impression that some stuff got messed up and now I can't start it at all. is there anything i can do?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#32

If you get stuck at the Dell screen than you are having a problem with your BIOS.
Can you at least enter the BIOS setup? It should be something like pressing del, F2 or F10.
If you can, check if you have the CD set as a boot source.
If you can't, then your BIOS is seriously corrupt, your only chance is to reflash the EEPROM; for that you need a special floppy disk (or usb key in recent models). If you have not made such thing in the past use the computer you are using to post this to download the BIOS from the Dell support site, and follow the instructions you will be given to make a recovery floppy or usb key from it.

Revision history for this message
C de-Avillez (hggdh2) said :
#33

@hilary:

From a previous comment by you:

"
The following packages will be REMOVED:
  linux-image-2.6.20-15-generic
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 71.3MB disk space will be freed.
Do you want to continue [Y/n]? Y
(Reading database ... 89521 files and directories currently installed.)
Removing linux-image-2.6.20-15-generic ...
dpkg: error processing linux-image-2.6.20-15-generic (--remove):
 subprocess pre-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-2.6.20-15-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
hilary@hilbil:/$
"

So... you removed your Linux kernel. This machine will not boot from HD until you re-install it. So, now, you indeed have to boot from the install CD, and re-install/recover from there. But, per your last comment, it seems you cannot even get to the BIOS setup. Please try Cesare's comments above.

Revision history for this message
hilary (hardysmiles) said :
#34

Ok things are under control again, i shutdown and unplugged my computer overnight, and i guess somesort of machine miracle happened cuz when i turned it on in the morning it started up just as usual :-) i reinstalled fiesty again, and then followed javajake's instructions from a few posts ago. everything went smoothly, i didn't notice any errors, i used the ndiswrapper v1.38 included with the fiesty and at the end when i plugged in the wireless adapter... nothing happened :-( i posted everything that happened in the terminal as well as the system log to show you how the usb adapter is registered when it is unplugged then replugged.

 what's your take on why no wireless network is showing up in the network configuration?
what do think that means when it says in the log: "usb 4-3: no configuration chosen from 1 choice" ?

hilary@hilbil:~$ sudo apt-get install cpp gcc build essential linux-headers-$(uname -r)Reading package lists... Done
Building dependency tree
Reading state information... Done
cpp is already the newest version.
gcc is already the newest version.
E: Couldn't find package build
hilary@hilbil:~$ sudp apt-get install cpp gcc build-essential linux-headers-$(uname -r)
bash: sudp: command not found
hilary@hilbil:~$ sudo apt-get install cpp gcc build-essential linux-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
cpp is already the newest version.
gcc is already the newest version.
build-essential is already the newest version.
linux-headers-2.6.20-15-generic is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
hilary@hilbil:~$ cd ~
hilary@hilbil:~$ cd ~
hilary@hilbil:~$ cd ~/ndiswrapper-1.47
hilary@hilbil:~/ndiswrapper-1.47$ sudo make install
make -C driver install
make[1]: Entering directory `/home/hilary/ndiswrapper-1.47/driver'
make -C /lib/modules/2.6.20-15-generic/build SUBDIRS=/home/hilary/ndiswrapper-1.47/driver
make[2]: Entering directory `/usr/src/linux-headers-2.6.20-15-generic'
  LD /home/hilary/ndiswrapper-1.47/driver/built-in.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/crt.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/hal.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/iw_ndis.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/loader.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/ndis.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/ntoskernel.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/ntoskernel_io.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/pe_linker.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/pnp.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/proc.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/rtl.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/wrapmem.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/wrapndis.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/wrapper.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/usb.o
  CC [M] /home/hilary/ndiswrapper-1.47/driver/divdi3.o
  LD [M] /home/hilary/ndiswrapper-1.47/driver/ndiswrapper.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC /home/hilary/ndiswrapper-1.47/driver/ndiswrapper.mod.o
  LD [M] /home/hilary/ndiswrapper-1.47/driver/ndiswrapper.ko
make[2]: Leaving directory `/usr/src/linux-headers-2.6.20-15-generic'
echo /lib/modules/2.6.20-15-generic/misc
/lib/modules/2.6.20-15-generic/misc
mkdir -p /lib/modules/2.6.20-15-generic/misc
install -m 0644 ndiswrapper.ko /lib/modules/2.6.20-15-generic/misc
/sbin/depmod -a 2.6.20-15-generic -b /
make[1]: Leaving directory `/home/hilary/ndiswrapper-1.47/driver'
make -C utils install
make[1]: Entering directory `/home/hilary/ndiswrapper-1.47/utils'
gcc -g -Wall -I../driver -o loadndisdriver loadndisdriver.c
install -D -m 755 loadndisdriver /sbin/loadndisdriver
install -D -m 755 ndiswrapper /usr/sbin/ndiswrapper
install -D -m 755 ndiswrapper-buginfo /usr/sbin/ndiswrapper-buginfo

NOTE: Windows driver configuration file format has changed since 1.5. You must re-install Windows drivers if they were installed before.
make[1]: Leaving directory `/home/hilary/ndiswrapper-1.47/utils'
mkdir -p -m 0755 /usr/share/man/man8
install -m 644 ndiswrapper.8 /usr/share/man/man8
install -m 644 loadndisdriver.8 /usr/share/man/man8
hilary@hilbil:~/ndiswrapper-1.47$ ndiswrapper -v
module version is too old!
utils version: '1.9', utils version needed by module: '0'
module details:
filename: /lib/modules/2.6.20-15-generic/kernel/ubuntu/misc/ndiswrapper/ndiswrapper.ko
version: 1.38
vermagic: 2.6.20-15-generic SMP mod_unload 586

You may need to upgrade driver and/or utils to latest versions available at
http://ndiswrapper.sourceforge.net
hilary@hilbil:~/ndiswrapper-1.47$ sudo ndiswrapper -i WUSB54GS.inf
installing wusb54gs ...
hilary@hilbil:~/ndiswrapper-1.47$ ndiswrapper -l
wusb54gs : invalid driver!
hilary@hilbil:~/ndiswrapper-1.47$ sudo cp usb8023.sys /etc/ndiswrapper/wusb54gs/
hilary@hilbil:~/ndiswrapper-1.47$ sudo cp rndismp.sys /etc/ndiswrapper/wusb54gs/
hilary@hilbil:~/ndiswrapper-1.47$ ndiswrapper -l
wusb54gs : driver installed
hilary@hilbil:~/ndiswrapper-1.47$ sudo modprobe ndiswrapper
hilary@hilbil:~/ndiswrapper-1.47$ sudo ndiswrapper -m
adding "alias wlan0 ndiswrapper" to /etc/modprobe.d/ndiswrapper ...
hilary@hilbil:~/ndiswrapper-1.47$

i went into the var/log/messages in the system log viewer, and watched to see what was written when I disconnected and reconnected the usb adapter. This is what it looked like:

usb 4-3: USB disconnect, address 5
usb 4-3: new high speed USB device using ehci_hcd and address 6
usb 4-3: no configuration chosen from 1 choice

and in the syslog:
Jul 9 19:13:50 hilbil NetworkManager: <debug info>^I[1184022830.849741] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13b1_e_1111').
Jul 9 19:13:50 hilbil NetworkManager: <debug info>^I[1184022830.993229] nm_hal_device_added (): New device added (hal udi is '/org/freedesktop/Hal/devices/usb_device_13b1_e_1111_usbraw').

Revision history for this message
C de-Avillez (hggdh2) said :
#35

you forgot to 'sudo make uninstall' before making install ndiswrapper.

So:

1. sudo rmmod ndiswrapper # remove current ndiswrapper from memory
2. cd ~/ndiswrapper-1.47
3. sudo make uninstall

You should repeat 'sudo make uninstall' *until* nothing is removed anymore -- the ndiswrapper make script will try to remove the module from a series of known locations, that depend on what distribution you are running.

4. sudo make install

5. sudo modprobe ndiswrapper

6. install your USB driver (sudo ndiswrapper -i ...)

and we will go from there.

Can you help with this problem?

Provide an answer of your own, or ask hilary for more information if necessary.

To post a message you must log in.