When doing
Code:
$ sudo apt update $$ sudo apt upgrade -y
I get the following dpkg warnings
Code:
dpkg: warning: unable to delete old directory '/var/lib/ubuntu-advantage': Directory not empty
and
Code:
dpkg: warning: unable to delete old directory '/etc/ubuntu-advantage': Directory not empty
. After googling about it I see instruction advising to
Code:
sudo rm -rf /var/lib/ubuntu-advantage/* && sudo rm -rf /etc/ubuntu-advantage/*
in order to resolve the issue.
Of course I would
Code:
sudo mv /var/lib/ubuntu-advantage /var/lib/ubuntu-advantage.backup && sudo mv /etc/ubuntu-advantage /etc/ubuntu-advantage.backup
and then remove that later if no problems arose.
But is
Code:
sudo rm -rf /var/lib/ubuntu-advantage/* && sudo rm -rf /etc/ubuntu-advantage/*
a safe course of action? And is it the only thing that should be done or should I also
Code:
sudo apt-get install --reinstall ubuntu-advantage
after that.
Maybe I shouldn't
Code:
sudo rm -rf /var/lib/ubuntu-advantage/* && sudo rm -rf /etc/ubuntu-advantage/*
at all bc it would break my system?
And what about dpkg?
If I did
Code:
sudo rm -rf /var/lib/ubuntu-advantage/* && sudo rm -rf /etc/ubuntu-advantage/*
is there some follow up dpkg command I should issue to fix any broken or unresolved issues with it?
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
tldr; Basically I'm getting a dpkg warning about two directories that it can't remove because they have contents in them. I googled about it and found instruction telling me to manually force remove the directories but I'm not sure that is the safe or right thing to do. Also I'm not sure if I should reinstall the package associated with the directories (Ubuntu Advantage) in order to do a complete fix or if I should just not be removing those dirs at all. One final question is (if it is safe to remove the dirs and I do) is there some follow up command for dpkg or anything else that I should issue to resolve any conflicts or unresolved stuff?
I realize that because its just a warning it isn't critical to the operation of my system but I like to keep things clean and tidy so I really just want to fix this.
Thanks in advance for any help.