No effect on /var/cache/apt/archives with remove or clean

Background: I am using an Intel NUC 8iHVK7 with Intel Core i7; 1+1 GiB primary and 32 GiB secondary memory. I have installed Ubuntu 24.04.01 LTS; Gnome ver 46; window system X11; Linux kernel 6.8.0-41 generic.
I have a lot of pictures on my internal memory and many TB on externals.
I started to delete a lot of files and noticed a warning that the Trash was full and needed to be emptied. But I did not take that serious and shut down the computer as I normally do.
When trying to start the computer next day it did not start the GMD3 due to full archive.
It booted and started in tty - mode. I could empty the Trash but it did not help so I tried
autoremove and auto clean and clean the archives but neither worked. When cd to archives and used the dpkg -l, I found 3192 items. Some looks old but still not being able to remove.
BOOT partition says 191, 56 GiB used and 3,95 GiB free.
I also made a flash with Ubuntu and started the try session. It turned out good but I found that I could not do back up on the home directory. When I open the different subdirectories, I found that they are empty. I found another way to look in my home directory and then I
saw that all files are there. (sorry I did so many trials so I lost track on how I did). It seems that since I can not open GDM3, that part of the memory are hidden. (Archives is locked?)
So I hope that someone can advice me on how to clear the archive in order to install GMD3.
Since I found out that there are data still in the system, that I can not back-up, a total new Ubuntu installation is the last thing. I think I remember that in earlier Ubuntu installations there were an option just to repair the existing system. But I dare not to start the installation since I am not sure that it still exists. I am using a Swedish version of Ubuntu.

I am sorry for the long introduction but I tried to give as many basics as I thought nessary.

gogol8 - Hello - Welcome to Ubuntu Discourse.

Firstly - Before we jump in head first; If the package manager is in a consistent state, I would expect the /var/cache/apt/archives/ directory to be void.
So, let us dip a toe in and see what we have to deal with.
As you boot to a TTY you do not have the ammenities of a terminal emulator - I suggest we use a pastebin site to get some information. I like termbin.
run in this TTY terminal commands:

df -h | nc termbin.com 9999

which gives a quick over view of disk usage -

next we get more specific and see about sizes:

cd /
sudo du -sx * | sort -h | nc termbin.com 9999

The results of these commands are URLs back to the TTY - pass these URLs back to this post.
sudo - so will require your password - the command will take some small amount of time to process and as ;proc/ is a moving target - ignore the warning - cannot access ‘proc/…’.

If you need to drill down further, use cd to move to a directory of interest then repeat the du command.

-see where we go from these-

1 Like

Thanks a lot for your quick answer.

I tried your first suggestion but the system could not find termbin.com
I tried to install it , but the system could not find that package. Neither any package with similar pattern.
Also I probably can not install it due to the full(?) archive. I could not install GMD3.
Or if the archives are locked?

Termbin is a website, it will show the collected info from the commands run before the nc in the line so you can give us the link here and we can inspect the collected info to help you…

If you can not reach termbin.com, you can just copy/paste the output of the commands into a message here, just make sure to put three backticks ``` on the lines before and after the pasted text so the formatting stays intact and it stays readable for us…

Sorry for the delay. I found that my keybord has not the same layout in tty mode as I was used to. But I am working to solve it (by trial and error) and will come back asap.

1 Like

I hope that I have found most of the characters now.

I have been able to run the commands and here are the results: (running from /)

df -h | nc termbin.com 9999 gave https://termbin.com/7ckp

du -sx * | sort -h | nc termbin.com 9999 gave (I have a Swedish Ubuntu version so I need to translate)

can not get proc/8494/task/8494 /fd/4 : The file or catalogue does not exist
can not get proc/8494/task/8494 /fdinfo/4 : The file or catalogue does not exist
can not get proc/8494 /fd/3 : The file or catalogue does not exist
can not get proc/8494 /fdinfo/3 : The file or catalogue does not exist
https:// termin.com/4rd7

When running from /Home

Df gives https://termbin.com/6g0s
Du gives https:// termini.com/ei7j

Still working on how to copy/paste from tty-mode…

gogol8 - Yuk on me :frowning:

I am sorta stuck presently on a viable way forward.
One can not copy and paste from that TTY - and you can not install any new tools. I am scratching my head for a way around these limitations.
(by the way - I am running 24,04 and “nc” appears to be installed natively)

We have confirmation your surmise root (/) is full -
Now we need some way to look at root and see why it is full, and what we can then do to get us some operating head room.

After I have my mind free I will return to this.

Regards -

Wise move.

FYI: Several of your termin links return 404.

In the ‘Try Ubuntu’ environment, try using Disk Usage Analyzer to see if anything specific is taking up all that space.

Also look for a big discrepancy between df and du. That might suggest a failed mount.

Also check /var/log for a runaway logfile.

First I write this on my Apple Laptop, but I will try to start the Discourse on Ubuntu Try asap.

When using Try and look at the home directory, I found that it contained all subdirectories, but all was empty. But when I quit Try and opened the tty and moved to my home directory and then ls, I found the subdirectories and all files in them.

Anyway. In Try I started with Gparted. There I got the following:

/dev/nvme0n1n 931,51 GiB

                                                                      Size               Used              Free                Note

/dev/nvme0n1p2 Data f ntfs 97,66 GiB 93,42 GiB 4,24 GiB msftdata
/dev/nvme0n1p1 Document ext4 195,31GiB 11,55 GiB 183,76 GiB
/dev/nvme0n1p3 Pictures ext4 585,94GiB 156,62 GiB 439,32 GiB
/dev/nvme0n1p4 Div ext4 52,61 GiB 8,29 GiB 44,31 GiB

Devices

/dev/nvme0n1 931,51 GiB
/dev/mvne1n1 931,51 GiB
/dev/sda 1,82 TB
/dev/sdb 57,73 GiB

System monitor

                                                                   tot                             avail                       used              %

/dev/sdbl CD-ROM ISO966 6,2 GiB 0 6,2 GiB 100
/dev/loopC /rofs squash 1,8 GiB 0 1,8 GiB 100
/dev/disk/t /var/crash 54,6 MiB 51,7 MiB 57,4 MiB
/dev/disk/t /var/log 54,6 MiB 54,6 MiB 57,4 MiB

Disks (in Utilities)

1,0 TB disk
1,0 TB disk
2,0 Tb hard disk
62 GiB Kingstone Data Traveller (Ubuntu Try flash)
Drive Mass Storage Class
Drive Mass Storage Class
1,8 GiB Loop device /cdrom/casper/minimal squashfs mounted at /rofs
494 MiB Loop device /dev/loop1 read only
917 MiB Loop device /dev/loop2 read only

210 GiB contain system size 195,1 GiB
home 74% 145,5 GiB
var 19% 37,9 GiB
usr 4% 8,9 GiB
swapfile 1% 2,1 GiB
opti 0% 501,6 MiB
several minor parts

In tty- mode df -h

Filesystem Size Used Free Used% Mounted at

tmpfs 3,2G 5,7M 3,2G 1 /run
/dev/nvme1n1p2 192G 186G 0 100 /
tmpfs 16G 0 16G 0 /dev/shm
tmpfs 5,0M 12K 5,0M 1 /run/lock
efivarfs 128K 68K 56K 5 /sys/firmware/efi/efivars
/dev/nvme1n1p4 339G 55G 267G 17 /home/hans/part y
0n1p4 52G 6,1G 43G 13 /home/hans/9c0e-------
0n1p1 192G 8,6G 173G 5 /home/hans/3a8f--------
1n1p1 511M 6,2M 505M 2 /boot/efi
0n1p3 576G 151G 396G 28 /home/hans/996b--------
tmpfs 3,2G 92K 3,2G 1 /run/user/1000

When open /var/log I got many different items. Files and directories and something with .ez
Don not know what output you expected?
Also how to compare df and du? df -h (se above) and du ??

But I am happy that you are trying to find me a solution to crack the archives lock.
Thank’s so much.

gogol8 -

I have not forgotten you - nor are you ignored.
I just do not have a simple way to expedite this. Lacking any headroom to operate in makes for a difficult situation.

However - off the top of my head I do have one suggestion we can attempt.
How many kernels do you have installed ?

ls -al /boot/

Maybe here we can manually remove some old kernels - to get some headroom.
Would be cumbersome and one would then have to heal the package manger – but is one option.
I would prefer this approach rather than arbitrarily removing log files; or to teach someone new to Ubuntu how to set up and execute a full change root from a live USB execute within the installed root directory.

-looking for that better way-

hi again, no problem

I issued ls -al /boot/ and found this: I shortened to the major items

287 419 config-6.8.0-50-generic
287 419 config-6.8.0-51-generic

70 363 786 initrd.img-6.8.0-50-generic
70 360 175 initrd.img-6.8.0-51-generic

9 072 978 system.map-6.8.0-50-generic
9 072 978 system.map-6.8.0-51-generic

14 973 320 vmlinuz-6.8.0-50-generic
14 969 224 vmlinuz-6.8.0-51-generic

vmlinuz.old => vmlinuz-6.8.0-50-generic

Question: Are the"50" versions necessary and if not – how to remove? (about 95 GiB)

Another issue that might be related;

I read about problem with /partial and the solution was:

sudo rm /var/cache/apt

sudo mkdir /var/cache/apt/archives/partial

But I dare not try it because I do not know if there are side effects causing me to
reinstall Ubuntu which I will not do until “the bitter end”.

gogol8 - Unk uh

Do nothing other than figure out a way to remove un-needed stuff from the install to get some operating head room.

From your latest — will not be any kernels — as it is needful to keep one backup kernel; just in case.

We do need to free up some disk space in order to attain to a terminal and to be able to install netcat-openbsd (nc).
Presently, due to my lack of experience in this realm. I do not have a good/safe way to proceed to get us that operating head room.

Trash ? Hummm maybe - that would be a safe ones to remove.
what shows:

ls -ld .local/share/Trash
sudo ls -l /root/.local/share/Trash/

-search’n for a way-

Hi.
The first line gave drew---------- 2 hans hans 4096 jan 2 20:50 .local/share/Trash
the .local/share/Trash is marked as directory.
But when trying to open the directory I got the answer that the directory doesn’t exist

The second line say the same thing - the directory doesn’t exist

As you can see I have not set the time and date and obviously tty doesn’t take it from the
boot.

Well —

In this case of Trash, seems that you have never moved anything to the Trash directories - thus does not exist.

I guess at this point we fall back to removing old log files - fairly safe and if real old will have little to no adverse impacts.
looking into the directory /var/log/ for old files ending in .number.gz (dmesg.4.gz). [I personally do not keep old log files as I I am hands on and up front with my operating system]

ls -al /var/log/

and rm several of these old old log files.

Reboot and see now if you can boot to the desktop. We got head room now ?

-maybe yes-

I tested to remove the file you suggested. First I opened /var/log. Then ls which gave me a list of log files including dmesg.4.gz. In red text.
Then I issued sudo rm – /var/log/dmesg.4.gz
Then ls where dmsg.4.gz was gone(?).
But now the interesting.
I rebooted the computer and (booted in tty-mode) moved to
/var/log/ and again ls. The dmsg.4.gz was back!!
I can think of two cases (there are possibly more)
Either has the log-file not been fully removed and the boot system put it back.
Or the boot system has created a new log- file and the old dmsg.3.gz has been dmsg.4.gz
In either cases the has not been more space.
I tried to install netcat-openbsd but it seems that it is already installed?
I got the answer:
netcat-openbsd is already the newest version (1.226-1ubuntu2)
netcat-openbsd is set to manually installed.

Is there some particular reason you cannot move ALL your pictures onto externals? If the externals have the capacity, that might solve this part of the problem much more simply. There may be many more steps after freeing enough space to boot. It’s already been nine days, and the real work has not even begun yet.

gogol8 Hey !

Progress is being made :stuck_out_tongue:
As to .4.gz; that is only an example. I can accept that the files were rotated.
I did express to pick the oldest log files to remove - higher number is older … and to remove several.

Once we have some overhead then nc (netcat-openbsd) should be able to work.

Once we have the room — now we are back where we 1st began this episode:

cd /
sudo du -sx * | sort -h | nc termbin.com 9999

The result here is a URL back in terminal - pass that link back to this post.
We see here from this command where the disk space is allocated. Maybe then able to suggest remedial action.

-looking better ?-

Well, its no problem to move the picture subdirectory in my home directory, but I have no idea how to do it.

When using Ubuntu Try, I can see the main sub directories in my home directory,
but when issuing ls the answer is that they are empty. Are the files hidden? If I move the “empty” directories to some other place, does the “hidden” files also move or …

When booting in tty mode, I can go to the subdirectories and also list the files in them.

I am sorry for my very minor knowledge of Linux and I can not get hold of my “Linux bible”.

So I am very grateful for all help I can get.

I am working on it and comes back asap. But I tried the line you sent me but I didn’t get
a URL but a list of like dev, etc, home etc. and their sizes. Tomorrow I will try to remove more log files and see if the nc works better.

Still hopeful…