by mistake I run the command /* but cancelled immediately, but looks like some core files got deleted. when I run the command ll I am getting the error Command 'ls' not found, but can be installed with: apt install coreutils when I run apt install coreutils Code: Reading package lists... Done Building dependency tree Reading state information... Done coreutils is already the newest version (8.28-1ubuntu1). The following packages were automatically installed and are no longer required: gyp libc-ares2 libhttp-parser2.7.1 libicu64 libjs-async libjs-inherits libjs-node-uuid libpcre16-3 libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix2 libpcre3-dev libpcre32-3 libpcrecpp0v5 libssl1.0-dev libtidy5 libuv1 libuv1-dev nodejs-doc pkg-php-tools shtool Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded. 3 not fully installed or removed. Need to get 0 B/3,861 kB of archives. After this operation, 0 B of additional disk space will be used. Do you want to continue? [Y/n] y E: Sub-process /usr/bin/apt-listchanges --apt || test $? -lt 10 returned an error code (100) E: Failure running script /usr/bin/apt-listchanges --apt || test $? -lt 10 looks like I have broken the system, but how can I fix this? Note: Website is still working fine in the browser.
The issue is resolved anyway. how I resolved. found that bin folder was deleted. tried to rsync from another system, but didn't work. then I zipped the bin folder in another system and copied it to a webroot and from there I downloaded it with wget. and then unzipped the bin in the current system root. all commands start working now.
It is possible that there are still missing files that will cause issues later. I would recommend you to set up a new system and migrate to that while things are working.
No Th0m, there were only two folders bin and boot which I have restored from other system. reason I am saying there cannot be other folder as I compared other folders with the working system, besides as I said, I cancelled the command immediately.
It's up to you ofcourse - I am just recommending it. You could also restore a snapshot if you have one ofcourse.
This depends on how your server is hosted. Most virtual server software or VPS providers will have such a function.
I would probably force a reinstall of all packages, too, to ensure all binaries are present and at the correct versions.
okay If I want to re-install a fresh system - if I take the backup of /var/www /var/lib /etc/ is that enough?
actually I faced a issue with booting, I had to boot with a OCS - SYSCRD5.1.0(rescue) as reboot was not working. can you help me repair the booting? I can mount the ssd in which the os is loaded.
Learning to rebuild would be fun and good experience but I think it would be safer to migrate the server to another server instead of rebuilding the accidentally removed core files if the server is meant for public clients.
I would recommend setting up a new server according to https://www.howtoforge.com/ispconfig-autoinstall-debian-ubuntu/ and migrate your data to it with the migration tool: https://www.ispconfig.org/add-ons/ispconfig-migration-tool/
Like @Th0m wrote, virtual server software has features that allow taking snapshot or dump of the virtual machine, so it can be restored to a state it was before or moved to another host. If your system is on a computer box in your office, you can use tools like Clonezilla to take an image copy of the disk, which then can be restored on the same host or another host. Both ways allow you to restore a booting system, not just the data on the system. Practise using these before trusting your production system on them.