OpenSolaris JeOS Prototype (Part 15: Uninstall rest pkgs BE)

This entry is part of OpenSolaris JeOS (Just Enough Operating System) Prototype workshop.


L5 osol0906redu Try JeOS Uninstall Rest scenario

Lets try to uninstall all packages, just leave onse from list.

Note: This scenario is hard to process in PGK, because it don't allow you to break dependencies.

Its very hard to achieve with this scenario usable results, so I keep it here just for reference

1. Create a BE osol0906redu

beadm create  osol0906redu 

mkdir /tmp/osol0906redu

beadm mount osol0906redu /tmp/osol0906redu

I use procedure described in Amazon EC2 section, just use -R /tmp/jeosredu into pkg commands like list or uninstall commands

2. Get list of all installed packgages

pkg -R /tmp/jeosredu list -s | sort >/tmp/jeosredu/install.lst

cat /tmp/jeosredu/install.lst | awk {'print $1'} >/tmp/jeosredu/install-1.lst

cat /tmp/jeosredu/install.lst | wc -l
587

3. Prepare source of packages to keep, see attached 'JeOS-ec2.lst' in Amazon EC2 section

cat >/tmp/jeosredu/JeOS-ec2.lst
Paste it here
cat /tmp/jeosredu/JeOS-ec2.lst | grep -v "\^#" | awk {'print $1'} | sort >/tmp/jeosredu/JeOS-ec2-inst.lst

4. Generate needed lists

diff  /tmp/jeosredu/install-1.lst /tmp/jeosredu/JeOS-ec2-inst.lst | grep "<" | awk {'print $2'} | sort > /tmp/jeosredu/remove.lst

diff  /tmp/jeosredu1/install-1.lst /tmp/jeosredu1/JeOS-ec2-inst.lst | grep ">" | awk {'print $2'} | sort > /tmp/jeosredu1/add.lst

Workarounds remove Virtual Meta Packages packages from repo 

pkg  -R /tmp/jeosredu1 uninstall  slim_install babel_install

PHASE                                        ACTIONS
Removal Phase                                589/589
PHASE                                          ITEMS
Reading Existing Index                           9/9
Indexing Packages                                2/2

5. Evaluate it, it will process list to few lines, we need chek if there are not any tight depencies

Get multi line execution file
cat /tmp/jeosredu/remove.lst | awk '{ print $1 }' | xargs -t -n 1  pkg  -R /tmp/jeosredu uninstall -vnr 

6. Process the removal

cat /tmp/jeosredu/remove.lst | awk '{ print $1 }' | xargs -t -n 1 pkg  -R /tmp/jeosredu uninstall -r

Removal Phase                            46694/46694
PHASE                                          ITEMS
Reading Existing Index                           9/9
Indexing Packages                            137/137
pkg: Not found in inventory: SUNWipoib
pkg: Not found in inventory: SUNWlibcanberra
pkg: Not found in inventory: SUNWlibgsf
pkg: Not found in inventory: SUNWnwam-manager
pkg: Not found in inventory: SUNWpkgcmds
pkg: Not found in inventory: SUNWprint-monitor
pkg: Not found in inventory: SUNWrmvolmgr
pkg: Not found in inventory: SUNWrpcib
pkg: Not found in inventory: SUNWswmt
pkg: Not found in inventory: SUNWtavor
pkg: Not found in inventory: SUNWthunderbird
pkg: Not found in inventory: SUNWudaplt
pkg: Not found in inventory: SUNWxwsvr
pkg: Not found in inventory: slim_install

!!! Multiple times !!!

pkg -R /tmp/jeosredu list -s | wc -l
450

pkg -R /tmp/jeosredu verify | egrep "pkg:|depend:"  
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Hands-on experience with Virtualization

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today