Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I used to have Linux Mint 17.3 installed on my desktop computer. Today I decided to install a LAMP server because I wanted to run a local installation of Wordpress and Drupal. I read online that the easiest way to install LAMP was to use tasksel.
It took almost an hour and asked me to create a MySQL password so i thought it was working. However later on when i checked it, I saw the status reading "removing" and lots of important stuff afterward like Cinnamon and Mono. There was no cancel button, so I had no choice but to let it "remove" everything, even though all i wanted was to install something, not remove! After the install completed I noticed almost all my program icons missing, such as Libre Office, VLC, and my image programs like Gimp. When I tried to reboot, my computer now shows only a black screen with Ubuntu and four dots underneath. It just sits there and i can't do anything. I tried forcing off and on but that black screen is all i get now.
I guess Mint has been uninstalled. I am panicking because this was my primary computer and has/had all my work and photos on it. I don't know what to do. Is my computer toast? If not, how can i recover it?
Last edited by Avatar; 11-28-2017 at 08:45 AM.
Reason: add info
Never heard of it, so went looking for the doco - did you ?.
Quote:
Originally Posted by tasksel
Already-installed tasks will have an asterisk beside their name. Select a task by scrolling down and pressing space. This will put an asterisk beside the selected task and mark it for installation. Removing an asterisk marks the task for removal. Once "ok" is selected the task installations and/or removals will take place using apt-get.
They are only packages, your data should be safe - check the filesystem(s) from a liveCD. Should be able to recovery that and either re-install the (meta-)packages you removed, or just start again.
Thanks for the reply. I usually only read the docs if I'm confused about how the program works. This one seemed really easy to use, but I guess I made a dangerous assumption.
Still, there were only two things already selected, print server and samba server. I figured I was unselecting them because tasksel wanted to install them by default, but even if they were already installed, I don't use them and wouldn't miss them if they were removed. I certainly didn't see anything about office, fonts, my graphics programs, Cinnamon, or my entire OS.
Do you think all my programs and my OS are really gone?
https://forums.linuxmint.com/viewtopic.php?t=92643
yep, it's scary.
but your data is not lost.
what you need to do to recover it - have a live bootable medium (usually usb stick with some - any - linux live distro) plus separate storage (can be an internal partition or another usb storage).
boot live, and access your files. make sure they're in a safe location so they won't get erased when you reinstall.
ondoho, thanks for the link. Yes, I had an old copy of parted magic laying around and I can see my data, I only have a NTFS USB stick right now but I'm trying to format it for linux so I can save my files on it.
To be honest I am more concerned about the hours and days it will take to reinstall everything from scratch (I know, lesson learned in using unfamiliar tools!). I take religious backup images of Windows computers but I only know how to copy files in linux, not take images that can easily be restored, and never got around to learning it. (That's for another thread though!)
In the link you provided, I saw this post:
Quote:
Ok, here is some help to restore the system from "TTY_only" after tasksel removed important packages:
Code:
sudo apt-get install $(for i in $(cat /var/log/dpkg.log |grep -oP "(?<=`date +%Y-%m-%d`\s\d\d\:\d\d:\d\d\sremove)\s\S*\s"); do echo -n "$i "; done
Which basically looks in the dpkg.log for packages removed today and reinstalls them by handing the package-names over to apt-get.
It also restores other packages
Since my OS is already destroyed, I figure there is no harm in trying this. My question, since my OS will not boot, is it possible to run this command from a live CD? If not, is it possible to get TTY_only (not really sure what that is, I assume command line) on boot?
Hi ondoho, thank you for all your help. I did look at the log file and see all the packages it was removing (which I find completely incomprehensible that any tool would remove all those important packages without being told to!).
When I tried the given command, it gave me an error that GREP didn't understand option "P". I modified it and here is the exact command I used.
Code:
root@PartedMagic:/media/sdb2# for i in $(cat /media/sda1/var/log/dpkg.log |grep -o "(?<=`date +2017-11-24`\s\d\d\:\d\d:\d\d\sremove)\s\S*\s"); do echo -n "$i "; done > list.txt
Unfortunately the list.txt it produces is an empty file.
Well, I am very happy to report that my computer has been completely restored and is back in business!
I'll outline the steps I did here since I followed some links, and also had to do a bit of searching around, and it might be useful to someone in the future.
I definitely couldn't have done anything without a Live CD so this was important! Luckily I had a really old copy of Parted Magic laying around (probably from 2009 or so!) and it did just what I needed.
From the Live CD I was able to access the apt-get logs and extract all the package names of the ones that had been removed (a shocking 654 of them!)
My host filesystem was mounted on /media/sda1, so change the path according to your own host filesystem. At the command line:
From https://serverfault.com/questions/38...apt-get-remove
This will select all removed packages from the apt history log, and save them in a file called "restore" in the current directory (so make sure you are in a directory on your HOST file system, not on the Live CD). This command also includes the "apt-get install" directives so it basically is a ready-made command file for reinstalling all your packages!
If your system is bootable, you can just run this file, however mine was not, so I had a few extra steps to do.
The next thing I had to do was figure out how to boot to a command line. Usually you can do this from the Grub menu but, my system did not show me a Grub menu on boot and since I couldn't boot my computer I couldn't update Grub to change this. Fortunately, you can press the Esc key on boot at just the right time to get to Grub. It took me several tries
At the Grub menu you can boot to "Recovery Mode" which brings you to a "single user" command line. Unfortunately the file system is read-only and does not have a network connection so we have to set those up. Run:
Code:
mount -o rw,remount /
and
Code:
vi /etc/network/interfaces
and add the line "iface eth0 inet dhcp" to it. Save with ":w" and exit with ":q"
Now you can run "ifup eth0" (or your network connection name) to get connected to download your packages.
Next I just ran /path/to/restore and ran the file I made earlier. It took a couple of hours (I have a slow Internet connection) but my computer is back to normal and everything is back where it should be.
Re-installing is also a viable option, but since my only computer didn't work, and the only other device I have is a clunky Windows tablet, I wouldn't have been able to download a new OS until I had access to another computer. This really saved my bacon!
Thank you to the people who took the time to help me out, and to those out in Internet-land who figured all this stuff out and posted it to help others.
Last edited by Avatar; 12-01-2017 at 01:30 PM.
Reason: clarity
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
Just run tasksel from the install DVD 'rescue' environment. Use rescue mode. Open a root shell. Make sure you check everything you want, even if it's already installed. I've used this method, and it works. There is no reason your data should be lost. But you might want to save it to an external drive just to be safe, before you run tasksel again.
I would just like to chip in and say thanks Avatar for your step by step explanation of your recovery process. It's a really helpful learning tool for others who have similar issues and is very much better than, 'solved, thanks a bunch everyone' which I have always thought of as lazy and certainly unhelpful to the greater community.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.