Author Topic: How to reinstall files missing from /usr/bin?  (Read 5221 times)

Pete

  • Hero Member
  • *****
  • Posts: 1391
  • Karma: +13/-0
    • View Profile
How to reinstall files missing from /usr/bin?
« on: February 13, 2025, 09:02:59 am »
Hi All

Posted this earlier but it seems to have disappeared...

This is a question for our *nixy-knowledgeable friends.

Due to distraction - wife having diabetic problems - I managed to delete the contents of /usr/bin and I don't have an up-to-date backup...

I fired up ANPM which downloaded and installed the current yum package(s) and I am wondering if there is anyway to reinstall my "missing" files to /usr/bin from the various packages within the /var/cache/yum subdirectories - doesn't look possible from within ANPM...


All help appreciated

Pete

Remy

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-1
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #1 on: February 13, 2025, 11:56:12 am »
Hi Pete !

Did you check with yum command ?
You can get a list of all installed packages using:
yum list installed *
or yum list installed * >mylist.txt   (save into mylist.txt)

Then check yum help
yum --help

There is a re-install packages option.

Regards
« Last Edit: February 14, 2025, 11:06:09 am by Remy »

Martin Iturbide

  • OS2World NewsMaster
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 5212
  • Karma: +44/-1
  • Your Friend Wil Declares...
    • View Profile
    • Martin's Personal Blog
Re: How to reinstall files missing from /usr/bin?
« Reply #2 on: February 13, 2025, 02:54:05 pm »
Hello Remy

Some time ago people on this forum help me create this article:
- https://www.os2world.com/wiki/index.php?title=RPM:_Switching_from_i686_to_Pentium4

It has a different scope, and maybe it is outdated for switching to i686 to Pentium 4 (Maybe there are easy procedures today), but there is a REXX script that may help you proving the information of what was installed on your system using the same "yum list" command.

Check it out to see if it works for you.

Regards
Martin Iturbide
OS2World NewsMaster
... just share the dream.

Remy

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-1
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #3 on: February 13, 2025, 05:32:40 pm »
Hello Remy

Some time ago people on this forum help me create this article:
- https://www.os2world.com/wiki/index.php?title=RPM:_Switching_from_i686_to_Pentium4

It has a different scope, and maybe it is outdated for switching to i686 to Pentium 4 (Maybe there are easy procedures today), but there is a REXX script that may help you proving the information of what was installed on your system using the same "yum list" command.

Check it out to see if it works for you.

Regards

It looks like you are missing some installed packages (e.g. ASPIROUT  AN base installed)
Because you do a grep install (fist line which may contain INSTALL is taken too like: in french Paquets installés)
I think that first comment line may always have less than 3 words.

May I suggest something close to your rexx but not using a temporary output file during the process:
/* REXX to get just package names from RPM installed output */

rc = SysLoadFuncs()
Parse Arg fileout

rc = SysFileDelete(fileout)
list = ''

NEWQ= 'YUM'||time(S)
NEWQ=RXQUEUE('Create',NEWQ)   
oq = RXQUEUE('Set',NEWQ)

address cmd 'yum list installed * 2>&1 |RXQUEUE 'NEWQ' /FIFO'
Do queued()
   parse pull pkgs
   If words(pkgs)>2 then do
      parse var pkgs package'.'.
      list = Strip(list || ' ' || package)
   End
End
rc = Lineout(fileout,'yum install -y 'list)

call RXQUEUE 'Delete',NEWQ
call RXQUEUE 'Set',oq
Return

Regards
   

Pete

  • Hero Member
  • *****
  • Posts: 1391
  • Karma: +13/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #4 on: February 13, 2025, 07:56:26 pm »
Hi All

Thanks for responses to date.

Sadly they all seem to show the current installed list not the list of packages that existed prior to my cockup.

Looks like reinstalling yum has wiped out the package list and history.

I tried reinstall:
yum reinstall J:\var\cache\yum\netlabs-rel\packages\sane-backends-1.0.28-2.oc00.pentium4.rpm
which resulted in
No package matched to remove: sane-backends-0:1.0.28-2.oc00
Error: Problem in reinstall: no package matched to remove

I also tried:
yum install J:\var\cache\yum\netlabs-rel\packages\sane-backends-1.0.28-2.oc00.pentium4.rpm
which resulted in packages being downloaded.

I guess I will have to reinstate the missing bits 1 (+whatever dependencies) at a time ...


Thanks

Pete








ivan

  • Hero Member
  • *****
  • Posts: 1623
  • Karma: +20/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #5 on: February 13, 2025, 09:03:54 pm »
And here we see the advantage of WARPIN over RPM/YUM.  Sorry I don't like RPM, never did even when I encountered it 20 odd years ago and I admit I use linux Mint now in parallel with OS/2 (ArcaOS) because of Firefox because it doesn't use rpm/yum as a program loader.

Rant over and back to Pete's problem.  You need to get a copy of ARCVIEW-22 and its tools, it will allow you to get individual files from the various rpm packages and put them where you want them.  It is what I use when I can't find what I want as normal files.

Steven Levine

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +12/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #6 on: February 13, 2025, 09:24:39 pm »
Hi All

yum reinstall J:\var\cache\yum\netlabs-rel\packages\sane-backends-1.0.28-2.oc00.pentium4.rpm
which resulted in
No package matched to remove: sane-backends-0:1.0.28-2.oc00
Error: Problem in reinstall: no package matched to remove

Yum cannot install an rpm directly, but anpm can.  You can also use rpm to install rpms. <g>

I find it best to think of yum as a front-end for rpm.  Yum uses rpm under the covers, much like anpm uses yum and rpm.

If you have not lost the content of /var/lib/rpm

  rpm -qa

will list all of the package rpm thinks you have installed.


Pete

  • Hero Member
  • *****
  • Posts: 1391
  • Karma: +13/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #7 on: February 13, 2025, 11:28:46 pm »
Hi Steven

Yes, rpm -qa > rpmlist.txt seems to have all the previously installed packages showing.
Guess I can just work through the list (re)installing 1 by 1 - unless there is some way of presenting rpm with a list to (re)install?


Thanks

Pete

Pete

  • Hero Member
  • *****
  • Posts: 1391
  • Karma: +13/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #8 on: February 13, 2025, 11:43:52 pm »
Hi Ivan

I'm quite in agreement with your rant  :-)
I encountered rpm in the late 1990s and have been a devoted hater ever since.
However, it is what we are currently having to use so I try to make the best of it... and it is certainly not the fault of rpm/yum that I got into this mess.

I have arcview 2.1 installed and that does not let me pull out individual files, have to unpack all files, copy the required files to where ever, then delete the unpacked rpm files - Is arcview 2.2 on hobbesarchive, arcanoae or Alexs site?

While unpacking with arcview means I now have printing and scanning working again ANPM/yum do not know that which means that should I want to install a package that relies on something within cups/hplip/sane/hpaio it will be necessary to also install whatever package(s) are required. Also, of course, updates are not be offered for packages that are not known to be installed.

Regards

Pete


Tom

  • Full Member
  • ***
  • Posts: 220
  • Karma: +6/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #9 on: February 14, 2025, 12:38:05 am »
Is arcview 2.2 on hobbesarchive, arcanoae or Alexs site?

Arcview 2.25 is available as a Warpin package on both hobbesarchive and Alex's website:

https://hobbesarchive.com/Home/Download?path=/Hobbes/pub/os2/util/archiver/ArcView-2_25.wpi
https://altsan.org/programming/os2/arcview_225.wpi

ivan

  • Hero Member
  • *****
  • Posts: 1623
  • Karma: +20/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #10 on: February 14, 2025, 12:43:52 am »
Hi Pete,

I just checked and he has an updated version on his site  http://altsan.org/os2/fixpaks/fixgraphics.html  you just have to look at what is there.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 5292
  • Karma: +123/-1
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #11 on: February 14, 2025, 03:49:49 am »
Hi Steven

Yes, rpm -qa > rpmlist.txt seems to have all the previously installed packages showing.
Guess I can just work through the list (re)installing 1 by 1 - unless there is some way of presenting rpm with a list to (re)install?


Thanks

Pete

Wonder if using ANPM, Manage-->Yum Tools-->Import Package List... would work?
Once finished, there's Export Package List... that might be a good idea, and that's for everyone being a good idea.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1417
  • Karma: +27/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #12 on: February 14, 2025, 05:40:36 am »
'yum history' will give you a breakdown of what what installed and when.

You could then chose to re-execute the specific TRX ID, but by all accounts this is a vastly manual effort.

Steven Levine

  • Jr. Member
  • **
  • Posts: 65
  • Karma: +12/-0
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #13 on: February 14, 2025, 06:50:38 am »
Wonder if using ANPM, Manage-->Yum Tools-->Import Package List... would work?
Once finished, there's Export Package List... that might be a good idea, and that's for everyone being a good idea.

It should.  What Pete will need to do is map the rpm file names to package names which is easy to do.

Another option using 4OS2 is something like

  for %XX in ( @rpmlist.txt ) rpm --install %XX

which should install what needs to be installed and will complain about what's already installed.

rpm will take of list of rpm file names on the command line, but then one needs to beware of command line length limits.

I would recommend using ANPM since it does a better job of ensuring that the packages get installed in the required order.


Remy

  • Hero Member
  • *****
  • Posts: 827
  • Karma: +14/-1
    • View Profile
Re: How to reinstall files missing from /usr/bin?
« Reply #14 on: February 14, 2025, 11:05:20 am »
I tried both cmd:

a.  yum list installed *       (the one I suggested - sorted result with pkgf name, release and status) 
b.  rpm -qa                         (the other nice cmd suggested under the post - unsorted result) 

Same package count here (no difference)