LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-28-2010, 11:33 AM   #46
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33

Still doesn't work. Nevermind.

Let's try to install everything then.
You said that 'If a package is already installed, the apt-get will tell you that'.
I think it's important to save that information. That way, I could use this new list and remove all these packages from p2install.txt. This new list would be all the packages that have really be installed, and this way it would be easy to undo everything. Don't you think ?
If you agree, then how to save this information ?
 
Old 02-28-2010, 11:48 AM   #47
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Of course it doesn't work, just like I told you a couple of times why it wouldn't work.
If you would have been able to run the command:
Code:
dpkg --get-selections>myselections.txt
on the previous (crashed) install, then you would have something to compare to originalselections.txt because it originated from the same source.

Got it?

Quote:
You said that 'If a package is already installed, the apt-get will tell you that'.
I think it's important to save that information. That way, I could use this new list and remove all these packages from p2install.txt. This new list would be all the packages that have really be installed, and this way it would be easy to undo everything. Don't you think ?
If you agree, then how to save this information ?
There's no need for that since you basically already know by looking at the originalselections.txt file. That contains a list of all the packages installed. For example if your first line in p2install.txt is amsn, then apt-get will install it will all necessary dependencies like amsn-data and some more. If it were already installed, apt-get would do nothing and move on to the next line.

The only thing you need to do, is run the script to install all packages listed in the p2install.txt file as explained in a previous post. Once it's finished then run this command again:
Code:
dpkg --get-selections>originalselections.txt
In doing that you'll save an updated list of your installed packages. Just keep that file in some place safe and you'll be able to reinstall your system a lot easier than you are doing now.

Kind regards,

Eric
 
Old 02-28-2010, 12:24 PM   #48
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
Who cares where it comes from, in the end it's just a file with package names, so I think I should be able to compare them if I wanted to, but it keeps telling me that it's not in sorted order, even though it seems to be, and even though I removed all spaces and 'install' and everything else but the package names.

I think you haven't understood my idea :
I'd like to have the option to undo the installation we're about to make.
I think that if we don't do anything special, it won't be possible. Indeed, the list p2install.txt may contain packages that are already installed, as you said, so if I were to uninstall all the packages that are in that list, I'd remove some packages besides the ones that I would have installed. Am I wrong ?
 
Old 02-28-2010, 12:41 PM   #49
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
LOL, you're not getting me on a high horse my friend. You'd be way past your bedtime before you can achieve that.

Preparing for an undo is easy enough if you think a bit logical. You already have the file originalselections.txt which is the state your installed packages are in now and when you finish the installation of the packages listed in p2install.txt you'd have a 'new state'. When you run the command:
Code:
dpkg --get-selections>newstate.txt
you'll have the state with the new packages installed. If you'd like to revert to the previous state you can use the originalselection.txt to achieve that. After a clean install you can use these commands for that:
Code:
sudo dpkg --clear-selections
sudo dpkg --set-selections<originalselection.txt
sudo apt-get update
sudo apt-get dselect-upgrade
You cannot just use this method to uninstall packages you are going to install now. The method described with get-selections, set-selections and dselect-upgrade is a way to have a backup of what you have installed in your system so you can reinstall it in an easy way.

If you would like to use this process to uninstall the packages you're going to install then you'll have to find what the differences are between orginalselections.txt and newstate.txt and then for those lines only change the word 'install' to 'deinstall' in newinstall.txt. Then you can use the same process with newinstall.txt to uninstall the referred packages and their dependencies if those are not used by another package.

You'll have to keep track of the version of your get-selections output for yourself though.

Another way you could do it is by using the p2install.txt file, change in the autoinstall.sh script the word 'install' to 'remove' and run the script. That way you would remove all the packages in the list and their dependencies. That's another way, maybe simpler to track, but I haven't tested it this way to remove packages. Normally should work.

Kind regards,

Eric
 
Old 02-28-2010, 02:11 PM   #50
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
I know I don't know how to work with Linux as much as you do, for this is the very reason why I'm using this forum. There's no need to remind it to me in these terms. I'm just trying to learn here. Sorry if my questions/suggestions look too stupid to you.

I made the shell script and run it. A lot of lines appeared.
I don't know if it's relevant, but some of them were :
- Do you want to continue [Y/n]? Abort.
- E:Couldn't find package xx.

What should I do now ?
 
Old 02-28-2010, 02:22 PM   #51
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

There are no stupid questions in my opinion. I got the impression that you were getting a bit over-exited because the compare didn't work the way you want it to. And it seemed to me that you were not really interested in the reason why it didn't work, so that's why I put the high horse answer in my last post. And believe me, I'm here for the same reason as you are, to learn. Pretty soon you'll be sharing what you have learned here with other, to help them out, and that's what LQ is all about. So, just to set things straight, if I have offended you in any way with that then I apologize. I never meant to insult you in any way.

It's normal that a lot of lines have appeared, but they were just output of the apt-running. Normally at this moment the packages that apt-get could find in the repositories have been installed. An easy way to check if the entire file has been processed is to verify if the last package in the p2install.txt file is indeed installed. So, run:
Code:
tail -1 p2install.txt
to find out what that package is (that's -1 <number one>). Next run:
Code:
dpkg -l <packagename>
with <packagename> being the name of the package you got from the tail command.

Post output of the dpkg command here please.

Kind regards,

Eric
 
Old 02-28-2010, 11:56 PM   #52
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
hello and good morning,

No harm done.

No package found matching zlib1g-dev.
It's zlib(one)g-dev, but it doesn't matter since I made a copy/paste.
(The font chosen by this forum for the code parts is really annoying when it comes to differenciate L and One. Can I change that in my preferences ?)
So I'm guessing the script didn't work afterall ?

Last edited by elishac; 03-01-2010 at 12:02 AM.
 
Old 03-01-2010, 12:04 AM   #53
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello and good morning,

The error(s) you got when running the script don't mean it failed completely. It just means that at least one package wasn't installed correctly but since it was a development library I wouldn't give it much thought. You can check the complete list of what has been installed by checking the log file of apt (/var/log/apt/term.log); it mentions dates and everything so easy to trace what has been installed and what not. Take note of what has not been installed and then we'll have a look at that.

I'm at the office right now, so sometimes you might have to wait for me to reply.

Kind regards,

Eric
 
Old 03-01-2010, 12:16 AM   #54
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
I'm lost. What am I supposed to do exactly?
In term.log, during the last log session, the last line was 'processing triggers for python-support'.
Yet this line was produced when I updated the system after the fresh reinstallation.
There is no line produced in term.log at the timeframe when I run the script.

Last edited by elishac; 03-01-2010 at 12:20 AM.
 
Old 03-01-2010, 12:30 AM   #55
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Run the following command to paginate through the apt log:
Code:
less /var/log/apt/term.log
and see if you find any errors in there. You could also try:
Code:
cat /var/log/apt/term.log | grep -B2 -A2 "Error|error" | less
to shorten the list. Using this command you'll only get the lines that contain the word Error or error and two lines before and after that same line. So the information should be more relevant. It's just to check if there are any other packages with errors.

Kind regards,

Eric
 
Old 03-01-2010, 12:50 AM   #56
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
The second command produced no input.
I'm guessing the first one is the equivalent of gedit /var/log/apt/term.log, so I used gedit which I am more familiar with.
And by the way your command line must be wrong because I found one (and only one) string that has the word 'error' in it, using ctrl+f in gedit : "Installation finished. No error reported."

Last edited by elishac; 03-01-2010 at 12:56 AM.
 
Old 03-01-2010, 01:27 AM   #57
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
That's always possible

You said the command only gave one mention of error and thus the command I provided is wrong. Try the following:
Code:
cat /var/log/apt/term.log | grep "Error"
cat /var/log/apt/term.log | grep "error"
Also can you look through /var/log/dpkg.log and /var/log/dpkg.log.1 the same way (with gedit) and check if you can find any errors in there? The dpkg log lists status of packages like this:
Code:
2010-03-01 06:36:59 configure smbclient 2:3.2.5-4lenny9 2:3.2.5-4lenny9
2010-03-01 06:36:59 status unpacked smbclient 2:3.2.5-4lenny9
2010-03-01 06:36:59 status half-configured smbclient 2:3.2.5-4lenny9
2010-03-01 06:36:59 status installed smbclient 2:3.2.5-4lenny9
and it might give important information too in order to find out what packages have not been installed.

Kind regards,

Eric
 
Old 03-01-2010, 01:58 AM   #58
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
cat /var/log/apt/term.log | grep "error" works and gives the line I mentioned above (with 'error' in red).
cat /var/log/apt/term.log | grep "Error" gives no output.

On the other hand, the timestamp errors in dpkg.log are in adequation with the time when I run the script you wrote.
The file is quite big so I used sudo cat /var/log/dpkg.log |grep "error" (no Error found), instead of ctrl+f. Here is the result :
install libgpg-error0 <none> 1.6-1ubuntu1
status half-installed libgpg-error0 1.6-1ubuntu1
status unpacked libgpg-error0 1.6-1ubuntu1
status unpacked libgpg-error0 1.6-1ubuntu1 (twice)
configure libgpg-error0 1.6-1ubuntu1 1.61ubuntu1 (1.61ubuntu1 written twice)
status unpacked libgpg-error0 1.6-1ubuntu1
status half-configured libgpg-error0 1.6-1ubuntu1
status installed libgpg-error0 1.6-1ubuntu1
Do you want the timestamps too? 8 seconds occured between the first and last line.
 
Old 03-01-2010, 02:16 AM   #59
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

No, I don't need the timestamps. That output looks a bit 'screwed up' to me but definitely something went wrong. Run the following command in a terminal in the directory where the p2install.txt file is located to get a reference to the package from the p2install.txt list:
Code:
grep "libgpg" p2install.txt
and put the output here please.

Kind regards,

Eric
 
Old 03-01-2010, 02:36 AM   #60
elishac
Member
 
Registered: Nov 2009
Posts: 522

Original Poster
Rep: Reputation: 33
I probably didn't understand what you meant, because I wrote grep "libgpg" p2install.txt and there was no output. I have never made a cd the whole time, all is in the home directory.
 
  


Reply



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
reinstallation changd Linux - Newbie 1 07-07-2006 04:13 PM
Win98 reinstallation michaelc187 General 2 11-05-2004 11:43 AM
Reinstallation! Jmcatch742 Linux - Newbie 3 10-02-2004 06:44 PM
Reinstallation: Doin' it right! mattp Linux - Newbie 40 03-08-2004 10:20 PM
reinstallation Nay Linux - Newbie 10 12-21-2003 08:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:57 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
Open Source Consulting | Domain Registration