LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   I've broken apt-get/synaptic due to insalling a .deb file (https://www.linuxquestions.org/questions/linux-desktop-74/i%27ve-broken-apt-get-synaptic-due-to-insalling-a-deb-file-485289/)

grahamu 09-20-2006 08:35 AM

I've broken apt-get/synaptic due to insalling a .deb file
 
Hi

I recently tried to install jedit on my ubuntu machine. I tried doing this by using the debian package on the jedit download page (cant post url due to low post level)

Unfortunately I didnt spot the apt-get instructions at the bottom of the page.

The command I used to install was: dpkg -i jedit_4.3pre6_all.deb

The install failed (sorry I dont have any error message output for that anymore), and has now left me unable to use apt-get or synaptic.

Whenever I try to install anything using apt-get I get this message:

Reading package lists... Done
Building dependency tree... Done
E: The package jedit needs to be reinstalled, but I can't find an archive for it.

If I try apt-get remove jedit, I get exactly the same message.

I also get a similar error when starting synaptic:

E: The package jedit needs to be reinstalled, but I can't find an archive for it.
E: Internal error opening cache (1). Please report.

and synaptic then doesnt reposond to search.

I also was not able to post my sources file due to my low post level so far, please let me know if there is anything else I can include to help sort out this problem. Im quite new to linux and apt-get and synaptic are the only methods I know to get software/updates, so this is quite an urgent matter for me to resolve.

Thanks in advance for any help

Graham

w3bd3vil 09-20-2006 08:43 AM

I just did a search on packages.ubuntu.com for jedit and it didnt give anything out, so that should mean it wouldnt be available on the default repos. thats the reason your getting the errors, its not that you have broken apt-get or something.
try installing again from the deb package, and show us the error that you get, you are probably just missing some dependencies.

grahamu 09-20-2006 09:27 AM

These are the messages as a result of running: dpkg -i jedit_4.3pre6_all.deb

I should mention that after the original attempt to install jedit I managed to install it via the java installer file. Just mentioning in case its relevant to any of the following messages:

Selecting previously deselected package jedit.
(Reading database ...
dpkg: serious warning: files list file for package `jedit' missing, assuming package has no files currently installed.
116616 files and directories currently installed.)
Preparing to replace jedit 4:04.03.06.00 (using jedit_4.3pre6_all.deb) ...
Unpacking replacement jedit ...
dpkg: error processing jedit_4.3pre6_all.deb (--install):
unable to create `./usr/lib/menu/jedit': No such file or directory
dpkg (subprocess): unable to execute new post-removal script: No such file or directory
dpkg: error while cleaning up:
subprocess post-removal script returned error exit status 2
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
jedit_4.3pre6_all.deb

Thanks again

Graham

grahamu 09-22-2006 03:35 AM

Hi All

Has anybody got any advice on fixing the above problem?

Thanks

Graham

CrashedAgain 09-23-2006 08:39 PM

try using apt-get instead of dpkg. apt-get selects and downloads the files it needs from the repositories and then uses dpkg to install them. Dpkg installs packages but doesn't go looking for them.
first, type
Code:

dselect update
to update apt-get's files list, then
Code:

apt-get -f install
which may solve the problem. (the -f means fix...apt-get should go looking for the missing files).
Post back whether this works or not.
Will post a brief outline of using apt-get later...busy right now.

rickh 09-23-2006 10:30 PM

# dpkg --purge jedit

CrashedAgain 09-24-2006 07:49 PM

Here's a brief overview of installing packages in a Debian based system:

Actual package installation is done by dpkg. This is a text based application. For an already downloaded package you could do 'dpkg -i <path & package name>. But this may fail because there may be dependencies which dpkg does not know how to find and has not been told to install.

So the next level is apt-get which will search the net for the packages it needs (including dependency packages), download and install them. It uses dpkg to do the actual install and maintains a file called /etc/apt/sources.list to know where to search for packages. This file must be updated regularly as packages get moved around in the internet repositories. This is done with the command 'apt-get update'.

But to use apt-get you must know what packages are available, so you will need a 'package browser list.

The most basic of these is dselect, which is text based and not overly user friendly. It also maintains a package available database file which must be updated regularly with 'dselect update'. I've been told that dselect update will update both the dselect database and the apt-get sources.list so it is preferable to use this instead of the 'apt-get update' command which only updates apt sources.list.

More user friendly alternatives for seaching for packages are the gui based applications Kpackage and Synaptic. Both of these provide information on the packages available and can download and install the package.

Dselect, Kpackage and Synaptic all use apt-get to do the actual downloading & installing.

Debian based systems must use either Debian packages or applications compiled from source. To install an RPM package, first convert it to a .deb using 'alien'.
ie: alien -d <rpm packagename>

So, for an already download package, you can try dpkg -i <package> but be prepared for dependency problems which you will have to solve yourself by manually tacking down and installing any required dependencies.

Better way is to use apt-get & let it redo the download:

First, you must become 'root'. Permissions are a big thing in Linux, only root (administrator level permissions) is allowed to install things. So, type 'su' to become root. Then do 'dselect update'. Usually the first time it is run it will need to download quite a bit & some of the downloads may fail. If this happens, just run the command again, eventually it will get all the data it needs.

then 'apt-get install <your package>'. For example, to install firefox do 'apt-get install firefox'. It should download the application & all required dependencies & install the application.

Selecting 'firefox' from Kpackage & following the install procedure (check mark & install marked, etc) should do the same thing. But you do have to 'dselect update' first. Kpackage is going to ask you for a root password so you will have to set one before you run it.

grahamu 09-25-2006 04:20 AM

Hi

Thanks for your reponses, sadly I am still no further forward.

After running dselect update, I get the following:

sudo dselect update
Get: 1 http://security.ubuntu.com dapper-security Release.gpg [189B]
Get: 2 http://security.ubuntu.com dapper-security Release [30.9kB]
Get: 3 http://gb.archive.ubuntu.com dapper Release.gpg [189B]
Get: 4 http://archive.ubuntu.com dapper-updates Release.gpg [189B]
Get: 5 http://security.ubuntu.com dapper-security/main Sources [12.4kB]
Get: 6 http://security.ubuntu.com dapper-security/universe Packages [18.9kB]
Get: 7 http://archive.ubuntu.com dapper Release.gpg [189B]
Get: 8 http://gb.archive.ubuntu.com dapper-updates Release.gpg [189B]
Get: 9 http://security.ubuntu.com dapper-security/main Packages [50.2kB]
Get: 10 http://security.ubuntu.com dapper-security/restricted Packages [4496B]
Get: 11 http://security.ubuntu.com dapper-security/multiverse Packages [2159B]
Get: 12 http://gb.archive.ubuntu.com dapper-backports Release.gpg [189B]
Get: 13 http://archive.ubuntu.com dapper-backports Release.gpg [189B]
Get: 14 http://security.ubuntu.com dapper-security/universe Sources [2702B]
Hit http://archive.ubuntu.com dapper-updates Release
Hit http://gb.archive.ubuntu.com dapper Release
Hit http://archive.ubuntu.com dapper Release
Hit http://gb.archive.ubuntu.com dapper-updates Release
Get: 15 http://archive.ubuntu.com dapper-backports Release [23.3kB]
Get: 16 http://gb.archive.ubuntu.com dapper-backports Release [23.3kB]
Hit http://gb.archive.ubuntu.com dapper/main Sources
Hit http://archive.ubuntu.com dapper-updates/main Packages
Hit http://gb.archive.ubuntu.com dapper/restricted Sources
Get: 17 http://archive.ubuntu.com dapper-updates/restricted Packages [14B]
Hit http://gb.archive.ubuntu.com dapper/universe Sources
Hit http://archive.ubuntu.com dapper-updates/universe Packages
Hit http://gb.archive.ubuntu.com dapper-updates/main Sources
Hit http://archive.ubuntu.com dapper-updates/multiverse Packages
Get: 18 http://gb.archive.ubuntu.com dapper-updates/restricted Sources [14B]
Hit http://archive.ubuntu.com dapper/universe Packages
Get: 19 http://gb.archive.ubuntu.com dapper-backports/main Sources [3489B]
Hit http://archive.ubuntu.com dapper/main Packages
Hit http://archive.ubuntu.com dapper/restricted Packages
Get: 20 http://gb.archive.ubuntu.com dapper-backports/restricted Sources [14B]
Hit http://archive.ubuntu.com dapper/multiverse Packages
Get: 21 http://gb.archive.ubuntu.com dapper-backports/universe Sources [5556B]
Get: 22 http://archive.ubuntu.com dapper-backports/main Packages [7279B]
Get: 23 http://archive.ubuntu.com dapper-backports/restricted Packages [14B]
Get: 24 http://gb.archive.ubuntu.com dapper-backports/multiverse Sources [653B]
Get: 25 http://archive.ubuntu.com dapper-backports/universe Packages [13.9kB]
Get: 26 http://archive.ubuntu.com dapper-backports/multiverse Packages [1130B]
Ign http://dl.sourceforge.net ./ Release.gpg
Ign http://dl.sourceforge.net ./ Release
Ign http://dl.sourceforge.net ./ Packages
Ign http://dl.sourceforge.net ./ Sources
Hit http://dl.sourceforge.net ./ Packages
Hit http://dl.sourceforge.net ./ Sources
Fetched 202kB in 1m3s (3170B/s)
Reading package lists... Done
Merging available information
Replacing available packages info, using /var/cache/apt/available.
Information about 18873 package(s) was updated.

I then ran sudo apt-get -f install and got:

Reading package lists... Done
Building dependency tree... 0%
Building dependency tree... Done
E: The package jedit needs to be reinstalled, but I can't find an archive for it.

which is becoming an all too fammiliar message.

So I tried: dpkg --purge jedit
dpkg: error processing jedit (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
Errors were encountered while processing:
jedit

Any other ideas?

thanks for all the suggestions so far and the excellent write up of dselect, apt-get etc.

Graham

CrashedAgain 09-25-2006 09:48 AM

Hmmm. Looks like it really is a bad package.
So maybe try forcing dpkg to remove it.
From 'man dpkg' (section on forcing options) gives:
Code:

remove-reinstreq: Remove a package, even if it's broken and marked to  require
              reinstallation. This may, for example, cause parts of the package to remain on
              the system, which will then be forgotten by dpkg.

So try
Code:

dpkg --force-remove-reinstreq --purge jedit

grahamu 09-25-2006 10:02 AM

It worked!
 
That worked, Thanks!

Your help is very much appreciated, thought I might have been looking at a reinstall.

Graham


All times are GMT -5. The time now is 10:37 PM.