Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

There is a program named notepad on my Ubuntu which I want to remove as I never use it. I have got update for notepad of 80 MB from software updater. And I don't want to download that 80 MB.

I entered .wine folder of my home directory & there deleted the program named notepad. Still when I run the command notepad on terminal, the notepad window opens. To find where this program is, I did:

ravbholua@ravbholua-Aspire-5315:~$ which notepad
/usr/bin/notepad
ravbholua@ravbholua-Aspire-5315:~$ sudo apt-get purge notepad
[sudo] password for ravbholua: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package notepad
ravbholua@ravbholua-Aspire-5315:~$ 

So, whats the package name for this program? This program runs on wine (this I came to know after seeing the menu item named 'about notepad' for this program). How come this run on wine as the program name wine I deleted from the directory tree under ~/.wine and there is no other program named notepad under this folder?

EDIT #1

W.R.T. to an answer, I'm posting the below:

ravbholua@ravbholua-Aspire-5315:~$ dpkg-query --search notepad
wine1.7: /usr/share/icons/hicolor/24x24/apps/wine-notepad.png
wine1.7: /usr/share/icons/hicolor/22x22/apps/wine-notepad.png
wine1.7: /usr/share/applications/wine-notepad.desktop
wine1.7-i386: /usr/lib/i386-linux-gnu/wine/fakedlls/notepad.exe
wine1.7: /usr/share/icons/hicolor/32x32/apps/wine-notepad.png
wine1.7: /usr/share/man/man1/notepad.1.gz
wine1.7: /usr/bin/notepad
wine1.7-i386: /usr/lib/i386-linux-gnu/wine/notepad.exe.so
wine1.7: /usr/share/icons/hicolor/16x16/apps/wine-notepad.png
wine1.7: /usr/share/icons/hicolor/48x48/apps/wine-notepad.png
wine1.7: /usr/share/icons/hicolor/scalable/apps/notepad-48.svg
kdelibs5-plugins: /usr/lib/kde4/notepadpart.so
ravbholua@ravbholua-Aspire-5315:~$ 

From this, whats the package name of notepad?

EDIT#2

The answer wrote by @slm has worked with the following note.

Earlier I was getting an update for wine for 80.2 MB. Then after holding wine1.7 using command sudo apt-mark hold wine1.7, I got update for ~50MB. So, I understood it's working. Now to hold everything on wine, I did the following.

ravbholua@ravbholua-Aspire-5315:~$ dpkg --get-selections | grep wine
wine-gecko2.24:i386                                 install
wine-mono0.0.8                                      install
wine1.4                                             install
wine1.4-i386                                        install
wine1.7                                             hold
wine1.7-i386                                        install
winetricks                                          install

I see here that the package wine1.7 which I had held from update is only marked as hold. So, I ran the below to hold all these.

$ sudo apt-mark hold wine-gecko2.24:i386 wine-mono0.0.8 wine1.4 wine1.4-i386 wine1.7 wine1.7-i386 winetricks

And now I'm not getting the update at all.

share|improve this question
    
each line start with wine1.7 I assume you need to remove wine to remove this notpead binary –  Kiwy Feb 7 at 14:10

2 Answers 2

up vote 3 down vote accepted

You can use the command readlink to track down errant links to files, so that you can find out the true executable behind the link.

Example

link

$ ls -l /sbin/reboot
lrwxrwxrwx. 1 root root 16 Dec 16 11:38 /sbin/reboot -> ../bin/systemctl

real file

$ readlink -f /sbin/reboot
/usr/bin/systemctl

$ ls -l /usr/bin/systemctl
-rwxr-xr-x. 1 root root 337048 Dec  8 22:20 /usr/bin/systemctl

Determining what package a file belongs to

You need to use apt to find out what the actual package name, since notepad likely belongs to a package, and isn't necessarily its own package.

using apt

$ apt-file search notepad

-or-

$ apt-file search /usr/bin/notepad

using dpkg

You can also use dpkg to find out more as well:

$ dpkg-query --search notepad
app-install-data: /usr/share/app-install/icons/wine-notepad.png
kdelibs5-plugins: /usr/lib/kde4/notepadpart.so
app-install-data: /usr/share/app-install/desktop/wine1.4:wine-notepad.desktop

Excluding packages from update

If you need to block an application from being considered for updating by APT you can use one of the following commands.

$ sudo -i
$ echo “wine hold” | dpkg --set-selections

-or-

$ sudo apt-mark hold wine

You can confirm using these commands:

$ dpkg --get-selections | grep wine
wine                                        hold
wine-gecko1.4:amd64                         install
wine-gecko1.4:i386                          install
wine1.4                                     install
wine1.4-amd64                               install
wine1.4-i386                                install
winetricks                                  install

-or-

$ apt-mark showhold
wine

But I think there's an issue with excluding just the package named "wine". I believe you also want to exclude wine1.7 in your case, here it would be wine1.4 for me.

$ sudo apt-mark hold 'wine1.4'

$ apt-mark showhold
wine
wine1.4

If you continue to encounter additional warnings about "wine" packages you might want to "hold" everything related to wine.

share|improve this answer
    
I have shown the output of the dpkg--query in my edit. Please say what's the package name for notepad. It is not clear to me. –  Ravi Feb 7 at 13:03
    
Also please say whether both ls -l & readlink would give the link? If so, then either can be used & not necessarily readlink. In my case readlink didn't show any link; so it means it has no link!! Am I right? –  Ravi Feb 7 at 13:07
    
@Ravi - wine1.7 is the package. This app is provided by wine itself. –  slm Feb 7 at 14:01
    
@Ravi - correct on the link Q. I was showing that on the off chance that you were dealing w/ a link to a program which wasn't under control of any package that was install via APT. –  slm Feb 7 at 14:07
    
Thanks slm. Also @Kiwy what I want is to get rid of the update message from the software updater to update notepad. So, if I delete the executable using sudo rm, will it solve my purpose? And also as per mart's answer (in comment section), will wine work properly even if the executable is removed? –  Ravi Feb 7 at 15:41

the location in /usr/bin/notepad is probably a link to some other location. Try ls -lh /usr/bin/notepad to see where it's linked from.

Also use dpkg-query to search for the containing package, as in: dpkg-query --search /usr/bin/notepad. man dpkg-query for more information.

share|improve this answer
    
No I don't think so. Please see the output of the command you told -rwxr-xr-x 1 root root 1.6K Dec 7 02:50 /usr/bin/notepad . Does it show that its not linked!! –  Ravi Feb 7 at 8:49
    
then removing that file should do the job. However, is notepad not necessary for wine? In the file list here is it included, I think this is because some windows programs depend on it: packages.ubuntu.com/en/precise-updates/i386/wine1.4/filelist –  mart Feb 7 at 8:55
    
@Ravi - did you run dpkg-query --search? –  grebneke Feb 7 at 9:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.