我一直在尝试从今天的18.10更新到19.04。当我运行“ sudo do-release-upgrade”时,它会在计算磁盘空间更改并出现以下错误后中止运行:
“升级已中止。升级总共需要6057万空闲空间 磁盘“ /”上的空间。请至少释放另外的2,552 M磁盘 '/'上的空格。清空垃圾桶并取出以下物品的临时包装 以前使用“ sudo apt-get clean”的安装。”
我已经尝试清空垃圾箱并运行“ sudo apt-get clean”,但这还不够。
Next, I ran df -h to see where I don't have enough memory- here is the output
我认为适用的行是:
已使用的文件系统大小可用百分比已安装在
/ dev / sda4 29G 25G 3.3G 89%/
As the "mounted on" matches with the error message and 3.3G roughly matches the amount of free space suggested in the error (1/1000*(6057-2552)). I have combed through other forums and found similar issues, all of which suggested carefully deleting old kernels. I tried that: running uname -r gave me '4.18.0-17-generic'. I listed all of the kernels with "dpkg --list 'linux-image-*'" (don't have the output as I closed the terminal and restarted since then), deleted all but the current version and one previous (I think), and restarted. On running the command again, I get this output.
我有似乎是四个有效的条目(我不知道这是如何工作的,并且不建议删除其他任何东西而没有建议,这有可能破坏重要的东西),还有很多Linux图像条目,其中Version = none。我不确定是否仍需要以某种方式将其删除,或者我可以采取其他措施清除更新空间。
我是否需要做更多操作以删除旧内核,或以其他方式清除更新空间的任何建议,将不胜感激。谢谢!
最佳答案
sudo apt autoremove
Will remove any old packages that were installed as a dependency of something else but no longer needed. For example, if you install pkg1, and it pulls in another package named, let's say, dep1. Then at a later date you uninstall pkg1, but for whatever reason dep1 is still installed. If nothing else has identified dep1 as being something it needs, that means dep1 is just hanging out taking up space until you sudo apt autoremove
it. The command also removes old kernels that are no longer being used. Don't worry, in my experience, it will always leave you one prior kernel version available as a fallback in case an upgrade to a new one goes awry. I've never had an issue with autoremove breaking things because apt remembers which applications you manually installed and which ones were simply installed as a dependency of something else.
sudo apt autoclean
将删除不再需要的所有下载的软件包文件;即下载的Deb,以安装您从存储库安装的任何软件。
除此之外,您始终可以将文件备份到外部驱动器,并仅执行全新安装19.04,尽管这意味着从头开始重新设置所有应用程序。