You are not logged in.
Pages: 1
Hey all,
Let's say I messed up permissions and things for all my files and libraries. What's the best way to purge and reinstall every installed package so as to get more or less of a clean install? I basically want to reinstall without reinstalling. I can't uninstall packages manually and then reinstall them since that would eventually leave the system in an unusable state ex: when the glibc package gets uninstalled.
Last edited by solarwind (2008-09-28 23:32:18)
Offline
This should do it...
pacman -Qq > pkglist
for pkg in $(pacman -Qqm); do
sed -i "s#^${pkg}*##" pkglist
done;
pacman -S $(cat pkglist)
Edit: Corrected commands.... Thank to AD28 for pointing out I was stupid!
Offline
This should do it...
pacman -S $(pacman -Qqm)
What happens when something like glibc or the kernel or some other library comes around? Wont it crash?
Offline
I believe the kernel and drivers and such are loaded into memory when your system boots.. it's not read directly from disk.
Offline
I believe the kernel and drivers and such are loaded into memory when your system boots.. it's not read directly from disk.
So it's safe to run the above command?
Offline
Yes, it is exactly the same as updating glibc etc and you probably never think twice about that. You should keep an eye out for messages regarding bad folder permissions.
Offline
So it's safe to run the above command?
As long as the power doesn't go out half way thru
Even then, you'd have to be unlucky for it ro really stuff things I think. But there's no more 'risk' than if it happened during a normal -Syu update.
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Doesn't '-Qqm' only return manually compiled packages? I think this might be what you're looking for, but I'd wait for confirmation from someone more knowledgeable than I am..
pacman -S $(pacman -Qq)
Offline
Yes, it is exactly the same as updating glibc etc and you probably never think twice about that. You should keep an eye out for messages regarding bad folder permissions.
You said exactly the same which makes me want to make sure: is it purging the files? Or is it just copying over in which case permissions will be the way they are?
Offline
Doesn't '-Qqm' only return manually compiled packages? I think this might be what you're looking for, but I'd wait for confirmation from someone more knowledgeable than I am..
pacman -S $(pacman -Qq)
Crap, I was playing around to stop the attempt at installing foreign packages and cut and pasted wrong....
It is probably best to go:
pacman -Qq > pkglist
for pkg in $(pacman -Qqm); do
sed -i "s#^${pkg}*##" pkglist
done;
pacman -S $(cat pkglist)
Offline
Allan wrote:Yes, it is exactly the same as updating glibc etc and you probably never think twice about that. You should keep an eye out for messages regarding bad folder permissions.
You said exactly the same which makes me want to make sure: is it purging the files? Or is it just copying over in which case permissions will be the way they are?
It removes the files and reinstalls them.
Offline
Hmm just out of curiosity, is there a difference between 's###' and 's///' in sed?
Offline
Hmm just out of curiosity, is there a difference between 's###' and 's///' in sed?
No, that is just the separator character. I like #...
Offline
Ah I see.. my limited knowledge of sed is just from some very basic tutorials. I was always under the impression that / was "the" separator syntax recognized by sed.
Offline
Pages: 1