kanotix.com
General Support - Location package list file
LRC - 22.11.2006, 05:42 Uhr
Titel: Location package list file
I resently installed 2006-01-RC4 over my old 2005-4 installation. I seem to remember at one point the script mentioning saving an old package list file in some folder. Would anyone know which folder it was placed. I was n a hurry and didn't make a note. It is more as an instrest to see if there are packages I really would like back but cannot recall at the moment.
gs - 22.11.2006, 05:50 Uhr
Titel: Location package list file
to my knowledge it is a text file which is saved in the /home directory. Somewhere in FAQ or forum - use search function - is explained what to write in a konsole to reinstall the packages, best after editing the old-packages-list...
Crest - 22.11.2006, 05:50 Uhr
Titel: RE: Location package list file
Excerpt from the FAQ:
Reinstall of Packages Deleted During the Upgrade
With the help of this old-packages file, these packages can be reinstalled
# cd /root
# apt-get install $(<old-packages-yyyymmdd.txt
It is advisable before reinstalling to edit this list, so you can delete packages you don't want re-installed.
LRC - 22.11.2006, 06:07 Uhr
Titel: RE: Location package list file
Thank you. Hadn't even thought of that possibility. Next time I'll tryand remember that. Would make my life alot easier. As a side issue then, is there a way I can make a similar list, but of current packages. Would make my life easier to find out what I probably just as soon avoid from any mistakes I made last time around.
gs - 22.11.2006, 06:38 Uhr
Titel: RE: Location package list file
typing dpkg -l in Konsole shows all packages installed.
There is a thread on the topic, although in German, giving more details:
http://kanotix.com/index.php?name=PNphp ... +installed
mzilikazi - 22.11.2006, 16:27 Uhr
Titel:
Code:
dpkg -l
shows you the output formatted like this::
Code:
ii acpi 0.09-1 displays information on ACPI devices
ii acpid 1.0.4-5 Utilities for using ACPI power management
ii adduser 3.99 Add and remove users and groups
BUT apt will puke and die if it tries to read that so a simple way to make a kicklist of packages currently installed:
Code:
dpkg -l|grep ii|awk '{print $2}' |sed '1,5d'>packages.txt
and it gets formatted like this:
Code:
acpi
acpid
adduser
Now you can feed apt the list:
Code:
apt-get install $(<packages.txt)
There are several utilities/scripts out there that provide the same functionality if you want to look into it even further.
h2 - 22.11.2006, 18:34 Uhr
Titel:
dpkg -l | cut -d ' ' -f 3 >> packages.txt
if you want it a bit simpler will do the same thing.
LRC - 23.11.2006, 00:45 Uhr
Titel:
Thankyou very much for all you help and sugestions. h2 gave me exactly what I wanted.
mzilikazi - 23.11.2006, 02:06 Uhr
Titel:
h2 hat folgendes geschrieben::
dpkg -l | cut -d ' ' -f 3 >> packages.txt
if you want it a bit simpler will do the same thing.
Well actually that does not work. 2 problems:
1) dpkg -l will also show you packages that are NOT installed but were at one time.
These are noted by 'rc' like so:
Code:
dpkg -l|less
ii abcde 2.3.99.6-1 A Better CD Encoder
rc acm 5.0-23 A multi-player aerial combat simulation
snip
So......abcde is installed but acm is not.
A kicklist made from this output will also install pkgs you thought you'd removed. Use grep ii
2) You are left with some garbage at the beginning of the file.
apt will barf. Try it.
Use sed '1,5d'
If you prefer cut over awk this works:
Code:
dpkg -l|grep ii|cut -d ' ' -f 3|sed '1,5d'>packages.txt
Code:
dpkg -l|grep ii|awk '{print $2}'|sed '1,5d'>packages.txt
Is there a shorter, better, faster, smarter way?
Maybe............... but once it's in a script it's all good.
As it stands you'll need to open the file in a text editor and prepare to remove (not comment) anything that apt cannot find. apt will immediately halt at this point.
Now what would be a cool addition to this rather puny script would be the ability to skip over any packages that are not available and simply dump them to a text file. You could also very easily make the outputted packages.txt be named for the date the file was made. Nice for archival purposes. Probably though we are reinventing an existing wheel!
h2?
LRC - 25.11.2006, 05:58 Uhr
Titel:
Good point as I have a lot of extras floting around that aren't installed. Thanx
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007