0

I was trying to install libglu1-mesa-dev freeglut3-dev and mesa-common-dev on lubuntu due to an online course that requires opengl to run the code for the exercices and initially it raised an error due to som dependencies, but I ended up holding broken packages, as I didn't know how to solve it I googled it and found someone saying to do this:
1 sudo apt-get --fix-broken install
2 sudo rm /var/lib/apt/lists/* -vf
3 sudo aptitude safe-upgrade
however I'm still holding broken packages and yet can't purge them because it says they are not installed, I don't know if that's because of the files I removed (and I made a mistake: I did it without doing first a backup of the files on /var/lib/apt/lists nor searhing for another solution first) or I could purge it before, I've tried to recover the files using testdisk, but the option "undelete" doesn't apear. I've also tried using gparted selecting "Attempt data rescue" on "Devices" it found this file system: "#1. ext2/3/4, ReiserFS or XFS (size of my hard disk)" when I click view it displays an error message: "the file system couldn't be mounted (as swap) due to inconsistencies on the file system". The output of the command history (on the relevant lines - that is: the ones since I started trying to install the packages) is the following:
242 sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
243 sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgll-mesa-dev libxext-dev libxt-dev libxll-dev
244 sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgll-dev libxext-dev libxt-dev libxll-dev
245 sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl-dev libxext-dev libxt-dev libxll-dev
246 sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl-dev libxext-dev libxt-dev libx11-dev
247 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
248 sudo apt-get --fix-broken install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
249 sudo apt-get --fix-broken install
250 rm /var/lib/apt/lists/* -vf
251 sudo rm /var/lib/apt/lists/* -vf
252 sudo apt-get update
253 aptitude safe-upgrade
254 sudo aptitude safe-upgrade
255 sudo aptitude install --force libglu1-mesa-dev freeglut3-dev mesa-common-dev
256 sudo aptitude install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
257 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
258 sudo apt-get purge -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
259 reboot
260 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
261 sudo apt-get purge -f libglu1-mesa-dev freeglut3-dev
262 sudo apt-get clean
263 sudo apt-get update
264 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
265 sudo dpkg --configure -a
266 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
267 sudo apt-get autoremove
268 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
269 sudo aptitude -f install libglu1-mesa-dev freeglut3-dev mesa-common-dev
270 sudo aptitude -f purge libglu1-mesa-dev freeglut3-dev mesa-common-dev
271 sudo aptitude -f purge libglu1-mesa-dev freeglut3-dev mesa-common-dev libgl-dev libxext-dev libxt-dev libx11-dev
272 sudo apt-get --fix-missing update
273 sudo apt-get install -f libglu1-mesa-dev freeglut3-dev mesa-common-dev
274 sudo apt-get update
275 sudo apt-get autoclean
276* sudo apt-get
277 sudo dpkg --configure -a
278 sudo dpkg -l | grep ^..r
279 sudo -i gedit /var/lib/dpkg/status
280 sudo -i leafpad /var/lib/dpkg/status
281 sudo cat /var/lib/dpkg/status | grep "Status:"
282 sudo cat /var/lib/dpkg/status | grep "Status: [^install ok installed]"
283 sudo cat /var/lib/dpkg/status | grep "Status: [^sgdk]"
284 sudo cat /var/lib/dpkg/status | grep "Status: [^"install ok installed"]"
285 sudo cat /var/lib/dpkg/status | grep "Status: ^[install ok installed]"
286 sudo cat /var/lib/dpkg/status | grep "Status: ^install ok installed"
287 sudo cat /var/lib/dpkg/status | grep "Status:" | grep -v "install ok installed"
288 sudo cat /var/lib/dpkg/status | grep "Status:" | grep -v "ok"
289 sudo cat /var/lib/dpkg/status | grep -n "Status:" | grep -v "ok"
290 sudo cat /var/lib/dpkg/status | grep -n "Status:" | grep -v "install ok installed"
291 sudo -i leafpad /var/lib/dpkg/status
292 sudo aptitude install testdisk
293 testdisk
294 sudo aptitude install gpart
295 dpkg --get-selections | grep "hold"
296 dpkg --get-selections | grep hold
297 synaptic
298 sudo synaptic
299 sudo ls -l /var/lib/apt/lists/
300 testdisk
301 history

8
  • Please provide OS/release details, and copy/paste the actual command & error message into your question (also if you get any errors when you sudo apt update those errors maybe helpful, plus any errors you get with sudo apt -f install)
    – guiverc
    Apr 14, 2020 at 2:55
  • 2
    "Held broken packages" does not usually mean that the packages themselves are corrupt. It usually means that you have unwisely added non-Ubuntu sources, and that those sources have --in turn-- provided packages that conflict with your release of Ubuntu. The usual solution is to remove those non-Ubuntu soruces, and to uninstall all packages that you installed from those non-Ubuntu sources.
    – user535733
    Apr 14, 2020 at 2:55
  • release: 18.04.4 LTS (Bionic Beaver) Apr 16, 2020 at 19:57
  • sudo apt update doesn't raise any error just says that 2 packages can be updated/upgraded Apr 16, 2020 at 20:03
  • sudo apt -f install libglu1-mesa-dev freeglut3-dev mesa-common-dev: Os pacotes a seguir têm dependências desencontradas: freeglut3-dev : Depende: libgl1-mesa-dev mas não será instalado ou libgl-dev Depende: libxext-dev mas não será instalado Depende: libxt-dev mas não será instalado libglu1-mesa-dev : Depende: libgl1-mesa-dev mas não será instalado ou libgl-dev mesa-common-dev : Depende: libx11-dev mas não será instalado E: Impossível corrigir problemas, você manteve (hold) pacotes quebrados. Apr 16, 2020 at 20:04

1 Answer 1

0

I've solved the problem I just needed to use aptitude but I was confused because the first option it showed to me was to do nothing so when I ran it before it did nothing I just had to don't accept the first option and choose the second instead thanks to you all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .