i can't clean, autoremove or purge?

Asked by Randy Adamson

randy@randy-N751JK:~$ sudo apt-get --purge
[sudo] password for randy:
E: Command line option --purge is not understood in combination with the other options
randy@randy-N751JK:~$ sudo apt-get --purge
E: Command line option --purge is not understood in combination with the other options
randy@randy-N751JK:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get clean
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo purge-old-kernels
sudo: purge-old-kernels: command not found
randy@randy-N751JK:~$ sudo dpkg-reconfigure -plow unattended-upgrades
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
randy@randy-N751JK:~$ sudo dpkg-reconfigure -plow unattended-upgrades
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
randy@randy-N751JK:~$ sudo apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ Unattended-Upgrade::Remove-New-Unused-Dependencies "false"Unattended-Upgrade::Remove-New-Unused-Dependencies: command not found
randy@randy-N751JK:~$ Unattended-Upgrade::Remove-Unused-Dependencies "true";
Unattended-Upgrade::Remove-Unused-Dependencies: command not found
randy@randy-N751JK:~$ $ sudo rm -rv ${TMPDIR:-/var/tmp}/mkinitramfs-*
$: command not found
randy@randy-N751JK:~$ ## In Ubuntu 16.04 and earlier there may be leftover temporary
randy@randy-N751JK:~$ ## files to delete.
randy@randy-N751JK:~$ ## See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814345
randy@randy-N751JK:~$
randy@randy-N751JK:~$ $ uname -r ## This command identifies the currently-running kernel
$: command not found
randy@randy-N751JK:~$ 4.2.0-21-generic ## This is the current kernel.
4.2.0-21-generic: command not found
randy@randy-N751JK:~$ ## DO NOT REMOVE it!
randy@randy-N751JK:~$
randy@randy-N751JK:~$ $ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
$: command not found
randy@randy-N751JK:~$ ## This command lists all the kernels excluding the booted
randy@randy-N751JK:~$ ## kernel in the package database, and their status.
randy@randy-N751JK:~$ rc linux-image-4.2.0-14-generic ## The oldest kernel in the database
The program 'rc' is currently not installed. You can install it by typing:
sudo apt install rc
randy@randy-N751JK:~$ ## Status 'rc' means it's already been removed
randy@randy-N751JK:~$ ii linux-image-4.2.0-15-generic ## The oldest installed kernel. Eligible for removal.
The program 'ii' is currently not installed. You can install it by typing:
sudo apt install ii
randy@randy-N751JK:~$ ## Status 'ii' means Installed.
randy@randy-N751JK:~$ ii linux-image-4.2.0-16-generic ## Another old installed kernel. Eligible for removal
The program 'ii' is currently not installed. You can install it by typing:
sudo apt install ii
randy@randy-N751JK:~$ ii linux-image-4.2.0-18-generic ## Another old installed kernel. Eligible for removal
The program 'ii' is currently not installed. You can install it by typing:
sudo apt install ii
randy@randy-N751JK:~$ ii linux-image-4.2.0-19-generic ## The previous good kernel. Keep
The program 'ii' is currently not installed. You can install it by typing:
sudo apt install ii
randy@randy-N751JK:~$ iU linux-image-4.2.0-22-generic ## DO NOT REMOVE. Status 'iU' means it's not installed,
iU: command not found
randy@randy-N751JK:~$ ## but queued for install in apt.
randy@randy-N751JK:~$ ## This is the package we want apt to install.
randy@randy-N751JK:~$
randy@randy-N751JK:~$ ## Purge the oldest kernel package using dpkg instead of apt.
randy@randy-N751JK:~$ ## First you need to remove the image initrd.img file manually
randy@randy-N751JK:~$ ## due to Bug #1678187.
randy@randy-N751JK:~$ sudo update-initramfs -d -k 4.2.0-15-generic
update-initramfs: Deleting /boot/initrd.img-4.2.0-15-generic
randy@randy-N751JK:~$ sudo update-initramfs -d -k 4.2.0-15-generic
update-initramfs: Deleting /boot/initrd.img-4.2.0-15-generic
randy@randy-N751JK:~$ sudo dpkg --purge linux-image-4.2.0-15-generic linux-image-extra-4.2.0-15-generic
dpkg: warning: ignoring request to remove linux-image-4.2.0-15-generic which isn't installed
dpkg: warning: ignoring request to remove linux-image-extra-4.2.0-15-generic which isn't installed
randy@randy-N751JK:~$ sudo dpkg --purge linux-headers-4.2.0-15-generic
dpkg: warning: ignoring request to remove linux-headers-4.2.0-15-generic which isn't installed
randy@randy-N751JK:~$ ## Try also purging the common header package.
randy@randy-N751JK:~$ sudo dpkg --purge linux-headers-4.2.0-15
dpkg: warning: ignoring request to remove linux-headers-4.2.0-15 which isn't installed
randy@randy-N751JK:~$ sudo apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Reading package lists... Done
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get clean hello
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo purge-old-kernels
sudo: purge-old-kernels: command not found
randy@randy-N751JK:~$ sudo dpkg-reconfigure -plow unattended-upgrades
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
randy@randy-N751JK:~$ sudo apt-get clean
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo rm -rv ${TMPDIR:-/var/tmp}/mkinitramfs-*
removed '/var/tmp/mkinitramfs-FW_0TPIdt'
removed '/var/tmp/mkinitramfs-OL_LmLRie'
randy@randy-N751JK:~$ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
ii linux-image-3.13.0-108-generic 3.13.0-108.155 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-3.13.0-24-generic 3.13.0-24.47 amd64 Linux kernel image for version 3.13.0 on 64 bit x86 SMP
ii linux-image-4.4.0-72-generic 4.4.0-72.93 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
randy@randy-N751JK:~$ sudo apt autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo purge-old-kernels
sudo: purge-old-kernels: command not found
randy@randy-N751JK:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get remove 50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.
Reading package lists... Done
Building dependency tree
Reading state information... Done
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
E: Unable to locate package 50unattended-upgrades.ucf-old in directory /etc/apt
E: Couldn't find any package by glob '50unattended-upgrades.ucf-old in directory /etc/apt'
E: Couldn't find any package by regex '50unattended-upgrades.ucf-old in directory /etc/apt'
randy@randy-N751JK:~$ sudo apt-get install 50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.
Reading package lists... Done
Building dependency tree
Reading state information... Done
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
E: Unable to locate package 50unattended-upgrades.ucf-old in directory /etc/apt
E: Couldn't find any package by glob '50unattended-upgrades.ucf-old in directory /etc/apt'
E: Couldn't find any package by regex '50unattended-upgrades.ucf-old in directory /etc/apt'
randy@randy-N751JK:~$ sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

sudo mv /etc/apt/apt.conf.d/50unattended-upgrades.ucf-old $HOME

cd $HOME

sudo chown $USER$USER ./50unattended-upgrades.ucf-old

Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#2

You don't need to change any of the commands. It uses BASH variables to make things easier.

You should now be able to run:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get --purge autoremove
sudo apt-get clean

Revision history for this message
Randy Adamson (adamsonrandy3) said :
#3

randy@randy-N751JK:~$
randy@randy-N751JK:~$ sudo apt-get update
[sudo] password for randy:
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Hit:4 http://archive.canonical.com/ubuntu xenial InRelease
Fetched 204 kB in 0s (306 kB/s)
Reading package lists... Done
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  linux-generic linux-headers-generic linux-image-generic
The following packages will be upgraded:
  activity-log-manager activity-log-manager-control-center chromium-browser
  chromium-browser-l10n chromium-codecs-ffmpeg-extra unattended-upgrades
6 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
Need to get 68.9 MB of archives.
After this operation, 58.4 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 chromium-browser-l10n all 58.0.3029.96-0ubuntu0.16.04.1279 [3,303 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 activity-log-manager amd64 0.9.7-0ubuntu23.16.04.1 [101 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 activity-log-manager-control-center all 0.9.7-0ubuntu23.16.04.1 [1,696 B]
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 unattended-upgrades all 0.90ubuntu0.5 [32.7 kB]
Get:5 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 chromium-browser amd64 58.0.3029.96-0ubuntu0.16.04.1279 [64.5 MB]
Get:6 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 chromium-codecs-ffmpeg-extra amd64 58.0.3029.96-0ubuntu0.16.04.1279 [999 kB]
Fetched 68.9 MB in 14s (4,808 kB/s)
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
Preconfiguring packages ...
(Reading database ... 359189 files and directories currently installed.)
Preparing to unpack .../chromium-browser-l10n_58.0.3029.96-0ubuntu0.16.04.1279_all.deb ...
Unpacking chromium-browser-l10n (58.0.3029.96-0ubuntu0.16.04.1279) over (58.0.3029.81-0ubuntu0.16.04.1277) ...
Preparing to unpack .../chromium-browser_58.0.3029.96-0ubuntu0.16.04.1279_amd64.deb ...
Unpacking chromium-browser (58.0.3029.96-0ubuntu0.16.04.1279) over (58.0.3029.81-0ubuntu0.16.04.1277) ...
Preparing to unpack .../chromium-codecs-ffmpeg-extra_58.0.3029.96-0ubuntu0.16.04.1279_amd64.deb ...
Unpacking chromium-codecs-ffmpeg-extra (58.0.3029.96-0ubuntu0.16.04.1279) over (58.0.3029.81-0ubuntu0.16.04.1277) ...
Preparing to unpack .../activity-log-manager_0.9.7-0ubuntu23.16.04.1_amd64.deb ...
Unpacking activity-log-manager (0.9.7-0ubuntu23.16.04.1) over (0.9.7-0ubuntu23) ...
Preparing to unpack .../activity-log-manager-control-center_0.9.7-0ubuntu23.16.04.1_all.deb ...
Unpacking activity-log-manager-control-center (0.9.7-0ubuntu23.16.04.1) over (0.9.7-0ubuntu23) ...
Preparing to unpack .../unattended-upgrades_0.90ubuntu0.5_all.deb ...
Unpacking unattended-upgrades (0.90ubuntu0.5) over (0.90ubuntu0.3) ...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.1) ...
Processing triggers for gnome-menus (3.13.3-6ubuntu3.1) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20160824-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Setting up chromium-codecs-ffmpeg-extra (58.0.3029.96-0ubuntu0.16.04.1279) ...
Setting up chromium-browser (58.0.3029.96-0ubuntu0.16.04.1279) ...
Setting up chromium-browser-l10n (58.0.3029.96-0ubuntu0.16.04.1279) ...
Setting up activity-log-manager (0.9.7-0ubuntu23.16.04.1) ...
Setting up activity-log-manager-control-center (0.9.7-0ubuntu23.16.04.1) ...
Setting up unattended-upgrades (0.90ubuntu0.5) ...
Installing new version of config file /etc/init.d/unattended-upgrades ...
Synchronizing state of unattended-upgrades.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable unattended-upgrades
Processing triggers for libc-bin (2.23-0ubuntu7) ...
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$ sudo apt-get clean
N: Ignoring file '50unattended-upgrades.ucf-old' in directory '/etc/apt/apt.conf.d/' as it has an invalid filename extension
randy@randy-N751JK:~$

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

Just move the problematic file out. You can check it's contents to see if you need that configuration. The packages seem to be updating OK though