Gems/Python Packages Updaten

Erstmal herausfinden was installiert ist:

root@puppet ~ # pip list
backports.ssl-match-hostname (3.4.0.2)
configobj (5.0.6)
decorator (3.4.0)
Flask (0.10.1)
Flask-WTF (0.10.3)
gunicorn (19.1.1)
iniparse (0.4)
IPy (0.81)
itsdangerous (0.24)
javapackages (1.0.0)
Jinja2 (2.7.3)
lxml (3.4.1)
MarkupSafe (0.23)
policycoreutils-default-encoding (0.1)
puppetboard (0.0.4)
pycurl (7.19.5)
pygobject (3.8.2)
pygpgme (0.3)
pyliblzma (0.5.3)
pypuppetdb (0.1.1)
pyudev (0.16.1)
pyxattr (0.5.3)
requests (2.5.0)
seobject (0.1)
sepolicy (1.1)
six (1.8.0)
slip (0.4.0)
slip.dbus (0.4.0)
urlgrabber (3.10)
Werkzeug (0.9.6)
wsgiref (0.1.2)
WTForms (2.0.1)
yum-metadata-parser (1.1.4)
root@puppet ~ #

Dann feststellen was davon nicht mehr aktuell ist:

root@puppet ~ # pip list --outdated
Could not find any downloads that satisfy the requirement yum-metadata-parser
Could not find any downloads that satisfy the requirement policycoreutils-default-encoding
Could not find any downloads that satisfy the requirement sepolicy
Could not find any downloads that satisfy the requirement slip.dbus
Could not find any downloads that satisfy the requirement javapackages
IPy (Current: 0.81 Latest: 0.82)
Could not find any downloads that satisfy the requirement seobject
root@puppet ~ #

Pakete die hier nicht gefunden werden können wurden über die Paketverwaltung (in diesem Fall yum) installiert und nicht über pip/easy_install. Geupdatet werden können die Pakete wie folgt:

root@puppet ~ # pip install --upgrade ipy
Downloading/unpacking ipy from https://pypi.python.org/packages/source/I/IPy/IPy-0.82.tar.gz#md5=0625e884df8bde533b54a88c85cf5029
  Downloading IPy-0.82.tar.gz
  Running setup.py egg_info for package ipy
    
Installing collected packages: ipy
  Found existing installation: IPy 0.81
    Uninstalling IPy:
      Successfully uninstalled IPy
  Running setup.py install for ipy
    
Successfully installed ipy
Cleaning up...
root@puppet ~ #

Aktuell liefert pip leider keine Möglichkeit automatisiert alle Pakete zu updaten. Das ganze nun analog für Ruby, erst die Gems auflisten:

root@puppet ~ # gem list 

*** LOCAL GEMS ***

activemodel (4.1.8)
activesupport (4.1.8)
bigdecimal (1.2.5, 1.2.0)
builder (3.2.2)
bundler (1.7.7)
colored (1.2)
cri (2.6.1, 2.5.0)
ethon (0.7.1)
faraday (0.9.0, 0.8.9)
faraday_middleware (0.9.1)
faraday_middleware-multi_json (0.0.6)
ffi (1.9.6)
git (1.2.8)
her (0.7.2)
i18n (0.6.11)
io-console (0.4.2)
json (1.8.1, 1.7.7)
json_pure (1.8.1)
kgio (2.9.2)
log4r (1.1.10)
minitest (5.4.3)
multi_json (1.10.1, 1.8.4)
multipart-post (2.0.0, 1.2.0)
net-ssh (2.9.1)
psych (2.0.6, 2.0.0)
puppet_forge (1.0.3)
r10k (1.4.0, 1.3.5)
rack (1.5.2)
raindrops (0.13.0)
rake (10.4.1, 0.9.6)
rdoc (4.1.2, 4.0.0)
systemu (2.6.4, 2.5.2)
thread_safe (0.3.4)
typhoeus (0.6.9)
tzinfo (1.2.2)
unicorn (4.8.3)
root@puppet ~ #

Updates finden:

root@puppet ~ # gem outdated
bundler (1.7.7 < 1.7.8)
psych (2.0.6 < 2.0.8)
rake (10.4.1 < 10.4.2)
rdoc (4.1.2 < 4.2.0)
root@puppet ~ #

Ein einzelnes Gem updaten:

root@puppet ~ # gem update psych
Updating installed gems
Updating psych
Fetching: psych-2.0.8.gem (100%)
Building native extensions.  This could take a while...
Successfully installed psych-2.0.8
Parsing documentation for psych-2.0.8
Installing ri documentation for psych-2.0.8
Installing darkfish documentation for psych-2.0.8
Done installing documentation for psych after 3 seconds
Gems updated: psych
root@puppet ~ #

Oder alle Gems:

root@puppet ~ # gem update
Updating installed gems
Updating bundler
Fetching: bundler-1.7.8.gem (100%)
Successfully installed bundler-1.7.8
Parsing documentation for bundler-1.7.8
Installing ri documentation for bundler-1.7.8
Installing darkfish documentation for bundler-1.7.8
Done installing documentation for bundler after 7 seconds
Updating rake
Fetching: rake-10.4.2.gem (100%)
Successfully installed rake-10.4.2
Parsing documentation for rake-10.4.2
Installing ri documentation for rake-10.4.2
Installing darkfish documentation for rake-10.4.2
Done installing documentation for rake after 5 seconds
Updating rdoc
Fetching: rdoc-4.2.0.gem (100%)
Depending on your version of ruby, you may need to install ruby rdoc/ri data:

<= 1.8.6 : unsupported
 = 1.8.7 : gem install rdoc-data; rdoc-data --install
 = 1.9.1 : gem install rdoc-data; rdoc-data --install
>= 1.9.2 : nothing to do! Yay!
Successfully installed rdoc-4.2.0
Parsing documentation for rdoc-4.2.0
Installing ri documentation for rdoc-4.2.0
Installing darkfish documentation for rdoc-4.2.0
Done installing documentation for rdoc after 22 seconds
Gems updated: bundler rake rdoc
root@puppet ~ #

Hier werden keine alten Versionen automatisch deinstalliert, dies kann man allerdings manuell triggern. gem beachtet dabei die Abhängigkeiten einzelner gems zu anderen auf ältere Versionen und deinstalliert diese dann nicht. Um zu sehen welche Gems deinstalliert werden kann man einen dry Run machen:

root@puppet ~ # gem cleanup -d
Cleaning up installed gems...
Dry Run Mode: Would uninstall typhoeus-0.6.9
Dry Run Mode: Would uninstall rdoc-4.0.0
Dry Run Mode: Would uninstall rdoc-4.1.2
Dry Run Mode: Would uninstall rake-10.4.1
Dry Run Mode: Would uninstall rack-1.5.2
Dry Run Mode: Would uninstall r10k-1.4.0
Dry Run Mode: Would uninstall puppet_forge-1.0.3
Dry Run Mode: Would uninstall psych-2.0.0
Dry Run Mode: Would uninstall psych-2.0.6
Dry Run Mode: Would uninstall psych-2.0.8
Dry Run Mode: Would uninstall psych-2.0.9
Dry Run Mode: Would uninstall net-ssh-2.9.1
Dry Run Mode: Would uninstall minitest-5.4.3
Dry Run Mode: Would uninstall kgio-2.9.2
Dry Run Mode: Would uninstall json_pure-1.8.1
Dry Run Mode: Would uninstall json-1.7.7
Dry Run Mode: Would uninstall her-0.7.2
Dry Run Mode: Would uninstall git-1.2.8
Dry Run Mode: Would uninstall git-1.2.9
Dry Run Mode: Would uninstall faraday-0.9.0
Dry Run Mode: Would uninstall ethon-0.7.1
Dry Run Mode: Would uninstall cri-2.5.0
Dry Run Mode: Would uninstall bundler-1.7.7
Dry Run Mode: Would uninstall bundler-1.7.8
Dry Run Mode: Would uninstall bundler-1.7.9
Dry Run Mode: Would uninstall bundler-1.7.11
Dry Run Mode: Would uninstall bigdecimal-1.2.0
Dry Run Mode: Would uninstall minitest-5.5.0
Dry Run Mode: Would uninstall json-1.8.1
Dry Run Mode: Would uninstall i18n-0.6.11
Dry Run Mode: Would uninstall typhoeus-0.6.9
Dry Run Mode: Would uninstall rdoc-4.0.0
Dry Run Mode: Would uninstall rdoc-4.1.2
Dry Run Mode: Would uninstall rake-10.4.1
Dry Run Mode: Would uninstall rack-1.5.2
Dry Run Mode: Would uninstall r10k-1.4.0
Dry Run Mode: Would uninstall puppet_forge-1.0.3
Dry Run Mode: Would uninstall psych-2.0.0
Dry Run Mode: Would uninstall psych-2.0.6
Dry Run Mode: Would uninstall psych-2.0.8
Dry Run Mode: Would uninstall psych-2.0.9
Dry Run Mode: Would uninstall net-ssh-2.9.1
Dry Run Mode: Would uninstall minitest-5.4.3
Dry Run Mode: Would uninstall kgio-2.9.2
Dry Run Mode: Would uninstall json_pure-1.8.1
Dry Run Mode: Would uninstall json-1.7.7
Dry Run Mode: Would uninstall her-0.7.2
Dry Run Mode: Would uninstall git-1.2.8
Dry Run Mode: Would uninstall git-1.2.9
Dry Run Mode: Would uninstall faraday-0.9.0
Dry Run Mode: Would uninstall ethon-0.7.1
Dry Run Mode: Would uninstall cri-2.5.0
Dry Run Mode: Would uninstall bundler-1.7.7
Dry Run Mode: Would uninstall bundler-1.7.8
Dry Run Mode: Would uninstall bundler-1.7.9
Dry Run Mode: Would uninstall bundler-1.7.11
Dry Run Mode: Would uninstall bigdecimal-1.2.0
Dry Run Mode: Would uninstall minitest-5.5.0
Dry Run Mode: Would uninstall json-1.8.1
Dry Run Mode: Would uninstall i18n-0.6.11
Clean Up Complete
root@puppet ~ #

und das eigentliche deinstallieren geht dann ohne -d:

root@puppet ~ # gem cleanup
Cleaning up installed gems...
Attempting to uninstall typhoeus-0.6.9
Successfully uninstalled typhoeus-0.6.9
Attempting to uninstall rdoc-4.0.0
Unable to uninstall rdoc-4.0.0:
	Gem::InstallError: rdoc is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems rdoc
Attempting to uninstall rdoc-4.1.2
Successfully uninstalled rdoc-4.1.2
Attempting to uninstall rake-10.4.1
Successfully uninstalled rake-10.4.1
Attempting to uninstall rack-1.5.2
Successfully uninstalled rack-1.5.2
Attempting to uninstall r10k-1.4.0
Successfully uninstalled r10k-1.4.0
Attempting to uninstall puppet_forge-1.0.3
Successfully uninstalled puppet_forge-1.0.3
Attempting to uninstall psych-2.0.0
Unable to uninstall psych-2.0.0:
	Gem::InstallError: psych is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems psych
Attempting to uninstall psych-2.0.6
Successfully uninstalled psych-2.0.6
Attempting to uninstall psych-2.0.8
Successfully uninstalled psych-2.0.8
Attempting to uninstall psych-2.0.9
Successfully uninstalled psych-2.0.9
Attempting to uninstall net-ssh-2.9.1
Successfully uninstalled net-ssh-2.9.1
Attempting to uninstall minitest-5.4.3
Successfully uninstalled minitest-5.4.3
Attempting to uninstall kgio-2.9.2
Successfully uninstalled kgio-2.9.2
Attempting to uninstall json_pure-1.8.1
Successfully uninstalled json_pure-1.8.1
Attempting to uninstall json-1.7.7
Unable to uninstall json-1.7.7:
	Gem::InstallError: json is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems json
Attempting to uninstall her-0.7.2
Successfully uninstalled her-0.7.2
Attempting to uninstall git-1.2.8
Successfully uninstalled git-1.2.8
Attempting to uninstall git-1.2.9
Successfully uninstalled git-1.2.9
Attempting to uninstall faraday-0.9.0
Successfully uninstalled faraday-0.9.0
Attempting to uninstall ethon-0.7.1
Successfully uninstalled ethon-0.7.1
Attempting to uninstall cri-2.5.0
Successfully uninstalled cri-2.5.0
Attempting to uninstall bundler-1.7.7
Successfully uninstalled bundler-1.7.7
Attempting to uninstall bundler-1.7.8
Successfully uninstalled bundler-1.7.8
Attempting to uninstall bundler-1.7.9
Successfully uninstalled bundler-1.7.9
Attempting to uninstall bundler-1.7.11
Successfully uninstalled bundler-1.7.11
Attempting to uninstall bigdecimal-1.2.0
Unable to uninstall bigdecimal-1.2.0:
	Gem::InstallError: bigdecimal is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems bigdecimal
Attempting to uninstall minitest-5.5.0
Successfully uninstalled minitest-5.5.0
Attempting to uninstall json-1.8.1
Successfully uninstalled json-1.8.1
Attempting to uninstall i18n-0.6.11
Successfully uninstalled i18n-0.6.11
Attempting to uninstall rdoc-4.0.0
Unable to uninstall rdoc-4.0.0:
	Gem::InstallError: rdoc is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems rdoc
Attempting to uninstall psych-2.0.0
Unable to uninstall psych-2.0.0:
	Gem::InstallError: psych is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems psych
Attempting to uninstall bigdecimal-1.2.0
Unable to uninstall bigdecimal-1.2.0:
	Gem::InstallError: bigdecimal is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems bigdecimal
Attempting to uninstall activemodel-4.1.8
Successfully uninstalled activemodel-4.1.8
Attempting to uninstall json-1.7.7
Unable to uninstall json-1.7.7:
	Gem::InstallError: json is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems json
Attempting to uninstall rdoc-4.0.0
Unable to uninstall rdoc-4.0.0:
	Gem::InstallError: rdoc is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems rdoc
Attempting to uninstall psych-2.0.0
Unable to uninstall psych-2.0.0:
	Gem::InstallError: psych is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems psych
Attempting to uninstall bigdecimal-1.2.0
Unable to uninstall bigdecimal-1.2.0:
	Gem::InstallError: bigdecimal is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems bigdecimal
Attempting to uninstall activesupport-4.1.8
Successfully uninstalled activesupport-4.1.8
Attempting to uninstall json-1.7.7
Unable to uninstall json-1.7.7:
	Gem::InstallError: json is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems json
Attempting to uninstall rdoc-4.0.0
Unable to uninstall rdoc-4.0.0:
	Gem::InstallError: rdoc is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems rdoc
Attempting to uninstall psych-2.0.0
Unable to uninstall psych-2.0.0:
	Gem::InstallError: psych is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems psych
Attempting to uninstall json-1.7.7
Unable to uninstall json-1.7.7:
	Gem::InstallError: json is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems json
Attempting to uninstall bigdecimal-1.2.0
Unable to uninstall bigdecimal-1.2.0:
	Gem::InstallError: bigdecimal is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems bigdecimal
Attempting to uninstall rdoc-4.0.0
Unable to uninstall rdoc-4.0.0:
	Gem::InstallError: rdoc is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems rdoc
Attempting to uninstall psych-2.0.0
Unable to uninstall psych-2.0.0:
	Gem::InstallError: psych is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems psych
Attempting to uninstall json-1.7.7
Unable to uninstall json-1.7.7:
	Gem::InstallError: json is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems json
Attempting to uninstall bigdecimal-1.2.0
Unable to uninstall bigdecimal-1.2.0:
	Gem::InstallError: bigdecimal is not installed in GEM_HOME, try:
	gem uninstall -i /usr/share/gems bigdecimal
Clean Up Complete
root@puppet ~ #

Gems die hier nicht deinstalliert werden können wurden über die Paketverwaltung der Distribution installiert.

This entry was posted in General, Linux, Short Tips. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.